From 894a0ed7fbe582723bf80e23a0c7e11a129edfe0 Mon Sep 17 00:00:00 2001 From: Dmitry Katsubo Date: Wed, 18 Jan 2023 02:20:54 +0100 Subject: [PATCH 1/4] Optimized internal API to copy annotation members. --- .gitignore | 1 + README.md | 11 +- pom.xml | 93 +++++-------- samples/pom.xml | 2 +- .../sun/tools/xjc/addon/xew/Candidate.java | 18 ++- .../sun/tools/xjc/addon/xew/CommonUtils.java | 63 +++++---- .../xjc/addon/xew/ScopedElementInfo.java | 9 +- .../addon/xew/XmlElementWrapperPlugin.java | 96 ++++--------- .../different_namespaces/package-info.java | 2 + .../xew/XmlElementWrapperPluginTest.java | 126 +++++++++--------- 10 files changed, 178 insertions(+), 243 deletions(-) create mode 100644 src/test/generated_resources/different_namespaces/package-info.java diff --git a/.gitignore b/.gitignore index ed293a2..a381b85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ target/ +playground/ .project .classpath .settings/ diff --git a/README.md b/README.md index e75fe8a..63304b7 100644 --- a/README.md +++ b/README.md @@ -594,12 +594,10 @@ The plugin flow consists of the following parts: There are many pitfalls in JAXB Code Model API which are forcing the developer to use dirty tricks (like accessing private fields) in order to implement the manipulation of code model. Among others: -* [JAXB-784](https://github.com/javaee/jaxb-v2/issues/784) is about NPE in `JAnnotationUse#getAnnotationMembers()` method. -* [JAXB-884](https://github.com/javaee/jaxb-v2/issues/884) is about ClassCastException in `JAnnotationArrayMember#annotations()` method. -* [JAXB-878](https://github.com/javaee/jaxb-v2/issues/878) and [JAXB-879](https://github.com/javaee/jaxb-v2/issues/879) describe the lack of public getters for class fields. -* [JAXB-957](https://github.com/javaee/jaxb-v2/issues/957) mentions what need to be added to make it possible for the inner class to be moved to another class or package. -* [JAXB-883](https://github.com/javaee/jaxb-v2/issues/883) does not allow to learn if "simpleMode" setting is enabled, which in its turn controls plural form for collection property names. There are however some more difficulties to overcome. -* [JAXB-1107](https://github.com/javaee/jaxb-v2/issues/1107) – marshalling of text nodes for mixed-mode contents +* [issue #957](https://github.com/eclipse-ee4j/jaxb-ri/issues/957) mentions what need to be added to make it possible for the inner class to be moved to another class or package. +* [issue #883](https://github.com/eclipse-ee4j/jaxb-ri/issues/883) does not allow to learn if "simpleMode" setting is enabled, which in its turn controls plural form for collection property names. There are however some more difficulties to overcome. +* [issue #1677](https://github.com/eclipse-ee4j/jaxb-ri/issues/1677) add/implement JVar.annotate(JAnnotationUse annotation). +* [issue #1679](https://github.com/eclipse-ee4j/jaxb-ri/issues/1679) add/implement JAnnotationUse.param(String name, JAnnotationValue annotationValue). ## Authors @@ -612,6 +610,7 @@ Original code by [Bjarne Hansen](http://www.conspicio.dk/blog/bjarne/jaxb-xmlele * [Colin Fairless](https://github.com/colin-yell/) * [Patrick Crocker](https://github.com/patrickcrocker/) * [Kermit The Frog](https://github.com/kermit-the-frog/) +* [Dominik Broj](https://github.com/thetric) * and others... ## License diff --git a/pom.xml b/pom.xml index 2131002..b0e1d5b 100644 --- a/pom.xml +++ b/pom.xml @@ -113,60 +113,6 @@ - - test-coverage - - [,9) - - - - - - org.codehaus.mojo - cobertura-maven-plugin - 2.7 - - - xml - html - - - - - - cobertura-report - verify - - cobertura - - - - - - - - - - coveralls - - - - - org.eluder.coveralls - coveralls-maven-plugin - 4.4.1 - - - install - - report - - - - - - - @@ -189,12 +135,11 @@ + - org.junit - junit-bom - 5.8.2 - pom - import + commons-beanutils + commons-beanutils + 1.9.4 @@ -242,23 +187,24 @@ org.junit.jupiter junit-jupiter + 5.9.2 test org.assertj assertj-core - 3.22.0 + 3.24.2 org.xmlunit xmlunit-assertj3 - 2.9.0 + 2.9.1 test org.xmlunit xmlunit-jakarta-jaxb-impl - 2.9.0 + 2.9.1 test @@ -290,5 +236,28 @@ + + + + org.jacoco + jacoco-maven-plugin + 0.8.8 + + + prepare-agent + + prepare-agent + + + + create-report + test + + report + + + + + diff --git a/samples/pom.xml b/samples/pom.xml index 75beb16..7592c3a 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -9,7 +9,7 @@ pom - 2.0-SNAPSHOT + 2.0 3.0.1 3.0.0 3.1.0 diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java b/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java index 92fc0ef..0dabbfc 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java @@ -1,8 +1,7 @@ package com.sun.tools.xjc.addon.xew; -import static com.sun.tools.xjc.addon.xew.CommonUtils.generableToString; import static com.sun.tools.xjc.addon.xew.CommonUtils.getAnnotation; -import static com.sun.tools.xjc.addon.xew.CommonUtils.getAnnotationMemberExpression; +import static com.sun.tools.xjc.addon.xew.CommonUtils.getAnnotationMemberValue; import static com.sun.tools.xjc.addon.xew.CommonUtils.getXsdDeclaration; import static com.sun.tools.xjc.addon.xew.CommonUtils.isHiddenClass; import static com.sun.tools.xjc.addon.xew.XmlElementWrapperPlugin.FACTORY_CLASS_NAME; @@ -16,7 +15,6 @@ import com.sun.codemodel.JAnnotationUse; import com.sun.codemodel.JClass; import com.sun.codemodel.JDefinedClass; -import com.sun.codemodel.JExpression; import com.sun.codemodel.JFieldVar; import com.sun.codemodel.JMethod; import com.sun.tools.xjc.model.CClassInfo; @@ -81,10 +79,10 @@ private String getTargetNamespace(CClassInfo candidateClassInfo, JClass xmlSchem // see com.sun.tools.xjc.generator.bean.PackageOutlineImpl#calcDefaultValues() for (JDefinedClass objectFactoryClass : objectFactoryClasses.values()) { JAnnotationUse schemaAnnotation = getAnnotation(objectFactoryClass.getPackage(), xmlSchemaModelClass); - JExpression elementFormDefault = getAnnotationMemberExpression(schemaAnnotation, "elementFormDefault"); + String elementFormDefault = getAnnotationMemberValue(schemaAnnotation, "elementFormDefault"); - if (elementFormDefault != null && generableToString(elementFormDefault).endsWith(".QUALIFIED")) { - return generableToString(getAnnotationMemberExpression(schemaAnnotation, "namespace")); + if (elementFormDefault != null && elementFormDefault.endsWith(".QUALIFIED")) { + return getAnnotationMemberValue(schemaAnnotation, "namespace"); } } } @@ -98,15 +96,15 @@ private void collectScopedElementInfos(JClass xmlElementDeclModelClass) { // Only value Object Factory methods are inspected: for (JMethod method : objectFactoryClasses.values().iterator().next().methods()) { JAnnotationUse xmlElementDeclAnnotation = getAnnotation(method, xmlElementDeclModelClass); - JExpression scope = getAnnotationMemberExpression(xmlElementDeclAnnotation, "scope"); + String scope = getAnnotationMemberValue(xmlElementDeclAnnotation, "scope"); - if (scope == null || !dotClazz.equals(generableToString(scope))) { + if (scope == null || !dotClazz.equals(scope)) { continue; } scopedElementInfos.put(method.name(), - new ScopedElementInfo(getAnnotationMemberExpression(xmlElementDeclAnnotation, "name"), - getAnnotationMemberExpression(xmlElementDeclAnnotation, "namespace"), + new ScopedElementInfo(getAnnotationMemberValue(xmlElementDeclAnnotation, "name"), + getAnnotationMemberValue(xmlElementDeclAnnotation, "namespace"), method.params().get(0).type())); } } diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java b/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java index 475d6d1..03ba540 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java @@ -4,6 +4,7 @@ import java.io.Writer; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -12,8 +13,6 @@ import com.sun.codemodel.JAnnotationValue; import com.sun.codemodel.JClass; import com.sun.codemodel.JDefinedClass; -import com.sun.codemodel.JExpr; -import com.sun.codemodel.JExpression; import com.sun.codemodel.JFormatter; import com.sun.codemodel.JGenerable; import com.sun.codemodel.JType; @@ -76,10 +75,9 @@ public static JAnnotationValue getAnnotationMember(JAnnotationUse annotation, St return null; } - // FIXME: Workaround for https://java.net/jira/browse/JAXB-1040: - Map memberValues = getPrivateField(annotation, "memberValues"); + Map memberValues = annotation.getAnnotationMembers(); - if (memberValues == null) { + if (memberValues.isEmpty()) { return null; } @@ -87,27 +85,44 @@ public static JAnnotationValue getAnnotationMember(JAnnotationUse annotation, St } /** - * Returns the value of annotation element as {@link JExpression}. For example, for annotation + * Copies the annotation member with a given name from source annotations to target annotations. If given member + * does not exist, then default value is used. + */ + public static void copyAnnotationMemberValue(JAnnotationUse sourceAnnotation, String annotationMember, + String defaultAnotationValue, JAnnotationUse targetAnnotation) { + JAnnotationValue annotationValue = getAnnotationMember(sourceAnnotation, annotationMember); + + if (annotationValue == null) { + if (defaultAnotationValue != null) { + targetAnnotation.param(annotationMember, defaultAnotationValue); + } + return; + } + + Map memberValues = getPrivateField(targetAnnotation, "memberValues"); + + if (memberValues == null) { + memberValues = new LinkedHashMap<>(); + setPrivateField(targetAnnotation, "memberValues", memberValues); + } + + memberValues.put(annotationMember, annotationValue); + } + + /** + * Returns the value of annotation element as string. For example, for annotation * @XmlElementRef(name = "last-name", namespace = "http://mycompany.org/exchange", type = JAXBElement.class) - * for member name the value last-name will be returned. + * for member name the value "last-name" will be returned, for member type + * the value "jakarta.xml.bind.JAXBElement.class" will be returned. */ - public static JExpression getAnnotationMemberExpression(JAnnotationUse annotation, String annotationMember) { + public static String getAnnotationMemberValue(JAnnotationUse annotation, String annotationMember) { JAnnotationValue annotationValue = getAnnotationMember(annotation, annotationMember); if (annotationValue == null) { return null; } - // FIXME: Pending for https://java.net/jira/browse/JAXB-878 - try { - // In most cases the value is some expression... - return getPrivateField(annotationValue, "value"); - } - catch (IllegalArgumentException e) { - // ... and in some cases (like enum) do the conversion from JGenerable to JExpression - // (a bit unoptimal, since this expression is going to be converted back to string) - return JExpr.lit(generableToString(annotationValue)); - } + return generableToString(annotationValue); } /** @@ -119,17 +134,9 @@ public static void addAnnotation(JVar field, JAnnotationUse annotation) { } /** - * Remove the given {@code annotation} from the list of annotations for the given {@code field}. - */ - public static void removeAnnotation(JVar field, JAnnotationUse annotation) { - List annotations = getPrivateField(field, "annotations"); - annotations.remove(annotation); - } - - /** - * Check that given field property has name customization ({@code }). + * Check that given field property has name customization ({@code }). See also + * {@code org.glassfish.jaxb.core.api.impl.NameUtil}. * - * @see com.sun.xml.bind.api.impl.NameUtil * @see com.sun.codemodel.JJavaName * @see com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty#getCustomization(XSComponent) */ diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/ScopedElementInfo.java b/src/main/java/com/sun/tools/xjc/addon/xew/ScopedElementInfo.java index ead0ce9..d9707fb 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/ScopedElementInfo.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/ScopedElementInfo.java @@ -1,6 +1,5 @@ package com.sun.tools.xjc.addon.xew; -import com.sun.codemodel.JExpression; import com.sun.codemodel.JType; import org.apache.commons.lang3.builder.ReflectionToStringBuilder; @@ -29,19 +28,19 @@ public final class ScopedElementInfo { /** * Element name ("post-office"). */ - public final JExpression name; + public final String name; /** * Element namespace ("http://foo.bar"). */ - public final JExpression namespace; + public final String namespace; /** * Element type ({@link String}). */ - public final JType type; + public final JType type; - public ScopedElementInfo(JExpression name, JExpression namespace, JType type) { + public ScopedElementInfo(String name, String namespace, JType type) { this.name = name; this.namespace = namespace; this.type = type; diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java b/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java index c29c345..46540ff 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java @@ -22,17 +22,17 @@ package com.sun.tools.xjc.addon.xew; import static com.sun.tools.xjc.addon.xew.CommonUtils.addAnnotation; +import static com.sun.tools.xjc.addon.xew.CommonUtils.copyAnnotationMemberValue; import static com.sun.tools.xjc.addon.xew.CommonUtils.copyFields; import static com.sun.tools.xjc.addon.xew.CommonUtils.generableToString; import static com.sun.tools.xjc.addon.xew.CommonUtils.getAnnotation; import static com.sun.tools.xjc.addon.xew.CommonUtils.getAnnotationMember; -import static com.sun.tools.xjc.addon.xew.CommonUtils.getAnnotationMemberExpression; +import static com.sun.tools.xjc.addon.xew.CommonUtils.getAnnotationMemberValue; import static com.sun.tools.xjc.addon.xew.CommonUtils.getPrivateField; import static com.sun.tools.xjc.addon.xew.CommonUtils.getXsdDeclaration; import static com.sun.tools.xjc.addon.xew.CommonUtils.hasPropertyNameCustomization; import static com.sun.tools.xjc.addon.xew.CommonUtils.isHiddenClass; import static com.sun.tools.xjc.addon.xew.CommonUtils.isListedAsParametrisation; -import static com.sun.tools.xjc.addon.xew.CommonUtils.removeAnnotation; import static com.sun.tools.xjc.addon.xew.CommonUtils.setPrivateField; import java.io.IOException; @@ -55,7 +55,6 @@ import com.sun.codemodel.JCodeModel; import com.sun.codemodel.JDefinedClass; import com.sun.codemodel.JExpr; -import com.sun.codemodel.JExpression; import com.sun.codemodel.JFieldVar; import com.sun.codemodel.JInvocation; import com.sun.codemodel.JJavaName; @@ -317,35 +316,16 @@ else if (isListedAsParametrisation(c.getClazz(), fieldType)) { JAnnotationUse xmlElementOriginalAnnotation = getAnnotation(originalImplField, xmlElementModelClass); // xmlElementOriginalAnnotation can be null: - JExpression wrapperXmlName = getAnnotationMemberExpression(xmlElementOriginalAnnotation, "name"); - if (wrapperXmlName != null) { - xmlElementWrapperAnnotation.param("name", wrapperXmlName); - } - else if (fieldConfiguration.isApplyPluralForm()) { - xmlElementWrapperAnnotation.param("name", getXsdDeclaration(fieldPropertyInfo).getName()); - } - - JExpression wrapperXmlRequired = getAnnotationMemberExpression(xmlElementOriginalAnnotation, - "required"); - if (wrapperXmlRequired != null) { - xmlElementWrapperAnnotation.param("required", wrapperXmlRequired); - } - - JExpression wrapperXmlNillable = getAnnotationMemberExpression(xmlElementOriginalAnnotation, - "nillable"); - if (wrapperXmlNillable != null) { - xmlElementWrapperAnnotation.param("nillable", wrapperXmlNillable); - } - - // Namespace of the wrapper element - JExpression wrapperXmlNamespace = getAnnotationMemberExpression(xmlElementOriginalAnnotation, - "namespace"); - if (wrapperXmlNamespace != null) { - xmlElementWrapperAnnotation.param("namespace", wrapperXmlNamespace); - } + copyAnnotationMemberValue(xmlElementOriginalAnnotation, "name", + fieldConfiguration.isApplyPluralForm() ? getXsdDeclaration(fieldPropertyInfo).getName() + : null, + xmlElementWrapperAnnotation); + copyAnnotationMemberValue(xmlElementOriginalAnnotation, "required", null, xmlElementWrapperAnnotation); + copyAnnotationMemberValue(xmlElementOriginalAnnotation, "nillable", null, xmlElementWrapperAnnotation); + copyAnnotationMemberValue(xmlElementOriginalAnnotation, "namespace", null, xmlElementWrapperAnnotation); if (xmlElementOriginalAnnotation != null) { - removeAnnotation(originalImplField, xmlElementOriginalAnnotation); + originalImplField.removeAnnotation(xmlElementOriginalAnnotation); } boolean xmlElementInfoWasTransferred = false; @@ -362,7 +342,7 @@ else if (fieldConfiguration.isApplyPluralForm()) { if (annotationArrayMember != null) { for (JAnnotationUse subAnnotation : annotationArrayMember.annotations()) { - if (getAnnotationMemberExpression(subAnnotation, "namespace") == null) { + if (getAnnotationMemberValue(subAnnotation, "namespace") == null) { subAnnotation.param("namespace", candidate.getFieldTargetNamespace()); } } @@ -383,38 +363,15 @@ else if (fieldConfiguration.isApplyPluralForm()) { JAnnotationUse xmlElementCandidateAnnotation = getAnnotation(candidate.getField(), xmlElementModelClass); - // xmlElementOriginalAnnotation can be null: - JExpression xmlName = getAnnotationMemberExpression(xmlElementCandidateAnnotation, "name"); - if (xmlName != null) { - xmlElementAnnotation.param("name", xmlName); - } - else { - xmlElementAnnotation.param("name", candidate.getFieldName()); - } - - JExpression xmlNamespace = getAnnotationMemberExpression(xmlElementCandidateAnnotation, - "namespace"); - if (xmlNamespace != null) { - xmlElementAnnotation.param("namespace", xmlNamespace); - } - else if (candidate.getFieldTargetNamespace() != null) { - xmlElementAnnotation.param("namespace", candidate.getFieldTargetNamespace()); - } - - JExpression type = getAnnotationMemberExpression(xmlElementCandidateAnnotation, "type"); - if (type != null) { - xmlElementAnnotation.param("type", type); - } - - JExpression required = getAnnotationMemberExpression(xmlElementCandidateAnnotation, "defaultValue"); - if (required != null) { - xmlElementAnnotation.param("defaultValue", required); - } - - JExpression nillable = getAnnotationMemberExpression(xmlElementCandidateAnnotation, "nillable"); - if (nillable != null) { - xmlElementAnnotation.param("nillable", nillable); - } + // xmlElementCandidateAnnotation can be null: + copyAnnotationMemberValue(xmlElementCandidateAnnotation, "name", candidate.getFieldName(), + xmlElementAnnotation); + copyAnnotationMemberValue(xmlElementCandidateAnnotation, "namespace", + candidate.getFieldTargetNamespace(), xmlElementAnnotation); + copyAnnotationMemberValue(xmlElementCandidateAnnotation, "type", null, xmlElementAnnotation); + copyAnnotationMemberValue(xmlElementCandidateAnnotation, "defaultValue", null, + xmlElementAnnotation); + copyAnnotationMemberValue(xmlElementCandidateAnnotation, "nillable", null, xmlElementAnnotation); } JAnnotationUse adapterAnnotation = getAnnotation(candidate.getField(), xmlJavaTypeAdapterModelClass); @@ -595,11 +552,10 @@ private int createScopedFactoryMethods(JCodeModel codeModel, JDefinedClass facto for (JMethod method : factoryClass.methods()) { JAnnotationUse xmlElementDeclAnnotation = getAnnotation(method, xmlElementDeclModelClass); - JExpression scope = getAnnotationMemberExpression(xmlElementDeclAnnotation, "scope"); - JExpression name = getAnnotationMemberExpression(xmlElementDeclAnnotation, "name"); + String scope = getAnnotationMemberValue(xmlElementDeclAnnotation, "scope"); + String name = getAnnotationMemberValue(xmlElementDeclAnnotation, "name"); - if (scope != null && dotClazz.equals(generableToString(scope)) - && generableToString(info.name).equals(generableToString(name))) { + if (scope != null && dotClazz.equals(scope) && info.name.equals(name)) { continue NEXT; } } @@ -623,7 +579,7 @@ && generableToString(info.name).equals(generableToString(name))) { } } - methodName.insert(0, "create").append(NameConverter.standard.toPropertyName(generableToString(info.name))); + methodName.insert(0, "create").append(NameConverter.standard.toPropertyName(info.name)); JClass jaxbElementType = jaxbElementModelClass.narrow(info.type); @@ -975,7 +931,7 @@ private void checkAnnotationReference(Map candidatesMap, JAnn continue; } - JExpression type = getAnnotationMemberExpression(annotation, "type"); + String type = getAnnotationMemberValue(annotation, "type"); if (type == null) { // Can be the case for @XmlElement(name = "publication-reference", namespace = "http://mycompany.org/exchange") @@ -983,7 +939,7 @@ private void checkAnnotationReference(Map candidatesMap, JAnn continue; } - Candidate candidate = candidatesMap.get(generableToString(type).replace(".class", "")); + Candidate candidate = candidatesMap.get(type.replace(".class", "")); if (candidate != null) { logger.debug("Candidate " + candidate.getClassName() diff --git a/src/test/generated_resources/different_namespaces/package-info.java b/src/test/generated_resources/different_namespaces/package-info.java new file mode 100644 index 0000000..cdc993d --- /dev/null +++ b/src/test/generated_resources/different_namespaces/package-info.java @@ -0,0 +1,2 @@ +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://example.com/entry", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) +package different_namespaces; diff --git a/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java b/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java index 1e4b409..40dd7d4 100644 --- a/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java +++ b/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java @@ -20,30 +20,12 @@ */ package com.sun.tools.xjc.addon.xew; -import com.sun.tools.xjc.BadCommandLineException; -import com.sun.tools.xjc.Driver; -import com.sun.tools.xjc.Options; -import com.sun.tools.xjc.reader.Const; -import com.sun.tools.xjc.reader.internalizer.DOMForest; -import com.sun.tools.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic; -import jakarta.xml.bind.JAXBContext; -import jakarta.xml.bind.JAXBException; -import jakarta.xml.bind.Marshaller; -import jakarta.xml.bind.Unmarshaller; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.assertj.core.api.SoftAssertions; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xmlunit.assertj3.XmlAssert; +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; -import javax.xml.XMLConstants; -import javax.xml.validation.SchemaFactory; import java.io.File; import java.io.PrintStream; import java.io.PrintWriter; @@ -56,7 +38,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; @@ -64,10 +45,32 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import static java.util.Collections.emptyList; -import static java.util.Collections.singletonList; -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; +import javax.xml.XMLConstants; +import javax.xml.validation.SchemaFactory; + +import com.sun.tools.xjc.BadCommandLineException; +import com.sun.tools.xjc.Driver; +import com.sun.tools.xjc.Options; +import com.sun.tools.xjc.reader.Const; +import com.sun.tools.xjc.reader.internalizer.DOMForest; +import com.sun.tools.xjc.reader.xmlschema.parser.XMLSchemaInternalizationLogic; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.assertj.core.api.SoftAssertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xmlunit.assertj3.XmlAssert; + +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Marshaller; +import jakarta.xml.bind.Unmarshaller; /** * Testcases for the XEW Plugin. @@ -118,27 +121,27 @@ public void testInvalidCustomization() { } @Test - @Disabled("This test works reliably on Java7 but produces different results from run to run on Java8.") + @Disabled("This test works reliably on Java7 but produces different results from run to run on Java8, see https://github.com/eclipse-ee4j/jaxb-ri/issues/1682") public void testDifferentNamespacesForWrapperAndElement() throws Exception { // Plural form in this case will have no impact as all properties are already in plural: - List extraXewOptions = Arrays.asList("-Xxew:collection", "java.util.LinkedList", "-Xxew:instantiate", + List extraXewOptions = asList("-debug", "-Xxew:collection", "java.util.LinkedList", "-Xxew:instantiate", "lazy", "-Xxew:plural"); - List classesToCheck = Arrays.asList("BaseContainer", "Container", "Entry"); + List classesToCheck = asList("BaseContainer", "Container", "Entry", "package-info"); runTest("different-namespaces", extraXewOptions, false, classesToCheck); } @Test public void testInnerElement() throws Exception { - List extraXewOptions = Arrays.asList("-verbose", "-Xxew:instantiate none", + List extraXewOptions = asList("-verbose", "-Xxew:instantiate none", "-Xxew:control " + getClass().getResource("inner-element-control.txt").getFile()); - List classesToCheck = Arrays.asList("Filesystem", "Volumes"); + List classesToCheck = asList("Filesystem", "Volumes"); runTest("inner-element", extraXewOptions, true, classesToCheck); } @Test public void testInnerElementWithValueObjects() throws Exception { - List classesToCheck = Arrays.asList("Article", "Articles", "ArticlesCollections", "Filesystem", - "Publisher", "Volume", "impl.ArticleImpl", "impl.ArticlesImpl", "impl.ArticlesCollectionsImpl", + List classesToCheck = asList("Article", "Articles", "ArticlesCollections", "Filesystem", "Publisher", + "Volume", "impl.ArticleImpl", "impl.ArticlesImpl", "impl.ArticlesCollectionsImpl", "impl.FilesystemImpl", "impl.PublisherImpl", "impl.VolumeImpl", "impl.ObjectFactory", "impl.JAXBContextFactory"); runTest("inner-element-value-objects", singletonList("-debug"), false, classesToCheck); @@ -149,27 +152,27 @@ public void testAnnotationReference() throws Exception { // "Markup.java" cannot be verified for content because the content is changing from // one compilation to other as order of @XmlElementRef/@XmlElement annotations is not pre-defined // (set is used as their container). - List extraXewOptions = Arrays.asList("-verbose", "-debug"); - List classesToCheck = Arrays.asList("ClassCommon", "ClassesEu", "ClassesUs", "ClassExt", "Markup", - "Para", "SearchEu", "SearchMulti"); + List extraXewOptions = asList("-verbose", "-debug"); + List classesToCheck = asList("ClassCommon", "ClassesEu", "ClassesUs", "ClassExt", "Markup", "Para", + "SearchEu", "SearchMulti"); runTest("annotation-reference", extraXewOptions, false, classesToCheck); } @Test public void testElementAsParametrisationPublisher() throws Exception { - final List extraXewOptions = Arrays.asList("-debug", "-Xxew:control " + final List extraXewOptions = asList("-debug", "-Xxew:control " + getClass().getResource("element-as-parametrisation-publisher-control.txt").getFile()); - List classesToCheck = Arrays.asList("Article", "Articles", "ArticlesCollections", "Publisher"); + List classesToCheck = asList("Article", "Articles", "ArticlesCollections", "Publisher"); runTest("element-as-parametrisation-publisher", extraXewOptions, false, classesToCheck); } @Test public void testElementAsParametrisationFamily() throws Exception { - List extraXewOptions = Arrays.asList("-debug", + List extraXewOptions = asList("-debug", "-Xxew:control " + getClass().getResource("element-as-parametrisation-family-control.txt").getFile(), "-Xxew:summary " + GENERATED_SOURCES_PREFIX + "summary.txt"); - List classesToCheck = Arrays.asList("Family", "FamilyMember"); + List classesToCheck = asList("Family", "FamilyMember"); runTest("element-as-parametrisation-family", extraXewOptions, false, classesToCheck); assertThat(Paths.get(GENERATED_SOURCES_PREFIX, "summary.txt")).content() @@ -180,13 +183,13 @@ public void testElementAsParametrisationFamily() throws Exception { @Test public void testElementWithParent() throws Exception { List extraXewOptions = singletonList("-debug"); - List classesToCheck = Arrays.asList("Alliance", "Group", "Organization"); + List classesToCheck = asList("Alliance", "Group", "Organization"); runTest("element-with-parent", extraXewOptions, false, classesToCheck); } @Test public void testElementAny() throws Exception { - List extraXewOptions = Arrays.asList("-quiet", "-Xxew:plural"); + List extraXewOptions = asList("-quiet", "-Xxew:plural"); List classesToCheck = singletonList("Message"); runTest("element-any", extraXewOptions, false, classesToCheck); } @@ -194,7 +197,7 @@ public void testElementAny() throws Exception { @Test public void testElementAnyType() throws Exception { List extraXewOptions = singletonList("-Xxew:plural"); - List classesToCheck = Arrays.asList("Conversion", "Entry"); + List classesToCheck = asList("Conversion", "Entry"); runTest("element-any-type", extraXewOptions, false, classesToCheck); } @@ -202,7 +205,7 @@ public void testElementAnyType() throws Exception { public void testElementMixed() throws Exception { // Most classes cannot be tested for content List extraXewOptions = singletonList("-debug"); - List classesToCheck = Arrays.asList("B", "Br", "I", "AnyText", "package-info"); + List classesToCheck = asList("B", "Br", "I", "AnyText", "package-info"); runTest("element-mixed", extraXewOptions, false, classesToCheck); } @@ -216,8 +219,8 @@ public void testElementListExtended() throws Exception { @Test public void testElementNameCollision() throws Exception { // Most classes cannot be tested for content - List extraXewOptions = Arrays.asList("-debug", "-Xxew:instantiate", "lazy"); - List classesToCheck = Arrays.asList("Root", "package-info"); + List extraXewOptions = asList("-debug", "-Xxew:instantiate", "lazy"); + List classesToCheck = asList("Root", "package-info"); runTest("element-name-collision", extraXewOptions, false, classesToCheck); } @@ -225,41 +228,41 @@ public void testElementNameCollision() throws Exception { public void testElementScoped() throws Exception { // Most classes cannot be tested for content List extraXewOptions = singletonList("-debug"); - List classesToCheck = Arrays.asList("Return", "SearchParameters", "package-info"); + List classesToCheck = asList("Return", "SearchParameters", "package-info"); runTest("element-scoped", extraXewOptions, false, classesToCheck); } @Test public void testElementWithAdapter() throws Exception { // Plural form in this case will have no impact as there is property customization: - List extraXewOptions = Arrays.asList("-Xxew:plural", "-Xxew:collectionInterface java.util.Collection"); - List classesToCheck = Arrays.asList("Calendar", "Adapter1"); + List extraXewOptions = asList("-Xxew:plural", "-Xxew:collectionInterface java.util.Collection"); + List classesToCheck = asList("Calendar", "Adapter1"); runTest("element-with-adapter", extraXewOptions, false, classesToCheck); } @Test public void testElementWithCustomization() throws Exception { // This run is additionally configured from XSD (): - List extraXewOptions = Arrays.asList("-debug", "-Xxew:plural"); - List classesToCheck = Arrays.asList("PostOffice", "Args"); + List extraXewOptions = asList("-debug", "-Xxew:plural"); + List classesToCheck = asList("PostOffice", "Args"); runTest("element-with-customization", extraXewOptions, false, classesToCheck); } @Test public void testElementReservedWord() throws Exception { - List classesToCheck = Arrays.asList("Class", "Method"); + List classesToCheck = asList("Class", "Method"); runTest("element-reserved-word", emptyList(), false, classesToCheck); } @Test public void testSubstitutionGroups() throws Exception { - List classesToCheck = Arrays.asList("Address", "ContactInfo", "Customer", "PhoneNumber"); + List classesToCheck = asList("Address", "ContactInfo", "Customer", "PhoneNumber"); runTest("substitution-groups", emptyList(), false, classesToCheck); } @Test public void testUnqualifiedSchema() throws Exception { - List classesToCheck = Arrays.asList("RootElement", "package-info"); + List classesToCheck = asList("RootElement", "package-info"); runTest("unqualified", emptyList(), false, classesToCheck); } @@ -293,13 +296,13 @@ static void runTest(String testName, List extraXewOptions, boolean gener new LoggingOutputStream(logger, LoggingOutputStream.LogLevel.INFO, "[XJC] ")); List opts = new ArrayList<>(extraXewOptions); - opts.addAll(Arrays.asList("-no-header", "-extension", "-Xxew", "-d", baseDir.toString(), xsdUrl.getFile())); + opts.addAll(asList("-no-header", "-extension", "-Xxew", "-d", baseDir.toString(), xsdUrl.getFile())); String episodeFile = baseDir.resolve("episode.xml").toString(); // Episode plugin should be triggered after Xew, see https://github.com/dmak/jaxb-xew-plugin/issues/6 if (generateEpisode) { - opts.addAll(Arrays.asList("-episode", episodeFile)); + opts.addAll(asList("-episode", episodeFile)); } assertThat(Driver.run(opts.toArray(new String[0]), loggingPrintStream, loggingPrintStream)) @@ -320,13 +323,14 @@ static void runTest(String testName, List extraXewOptions, boolean gener Path targetDir = baseDir.resolve(packageName); - Collection generatedJavaSources = new HashSet<>(); + Collection generatedJavaSources; // *.properties files are ignored: try (Stream stream = Files.walk(targetDir)) { - stream.filter(file -> Files.isRegularFile(file) && file.getFileName().toString().endsWith(".java")) + generatedJavaSources = stream + .filter(file -> Files.isRegularFile(file) && file.getFileName().toString().endsWith(".java")) .map(f -> f.toString().substring(targetDir.toString().length() + 1).replace('\\', '/')) - .forEach(generatedJavaSources::add); + .collect(Collectors.toSet()); } // This class is added and checked by default: From e575fa1bdab5cfd3da7f6c9ef48e1be4d4d72a45 Mon Sep 17 00:00:00 2001 From: Dmitry Katsubo Date: Fri, 20 Jan 2023 23:15:25 +0100 Subject: [PATCH 2/4] Correctly tracking the scoped methods of ObjectFactory (fixes #72). --- .../sun/tools/xjc/addon/xew/Candidate.java | 18 +-- ...ElementInfo.java => ScopedMethodInfo.java} | 4 +- .../addon/xew/XmlElementWrapperPlugin.java | 26 ++-- .../inner_scoped_element/Catalogue.java | 140 ++++++++++++++++++ .../inner_scoped_element/ObjectFactory.java | 63 ++++++++ .../xew/XmlElementWrapperPluginTest.java | 7 + .../xjc/addon/xew/inner-scoped-element.xml | 19 +++ .../xjc/addon/xew/inner-scoped-element.xsd | 42 ++++++ .../tools/xjc/addon/xew/publisher-shared.xsd | 3 +- 9 files changed, 297 insertions(+), 25 deletions(-) rename src/main/java/com/sun/tools/xjc/addon/xew/{ScopedElementInfo.java => ScopedMethodInfo.java} (91%) create mode 100644 src/test/generated_resources/inner_scoped_element/Catalogue.java create mode 100644 src/test/generated_resources/inner_scoped_element/ObjectFactory.java create mode 100644 src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xml create mode 100644 src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xsd diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java b/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java index 0dabbfc..a34c95d 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java @@ -7,7 +7,6 @@ import static com.sun.tools.xjc.addon.xew.XmlElementWrapperPlugin.FACTORY_CLASS_NAME; import java.util.Collection; -import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; @@ -43,7 +42,8 @@ public final class Candidate { private final boolean valueObjectDisabled; - private final Map scopedElementInfos = new HashMap<>(); + // Order matters as it affects the order of generated methods in Object Factory: + private final Map scopedFactoryMethods = new LinkedHashMap<>(); /** * By default the candidate is marked for removal unless something prevents it from being removed. @@ -65,7 +65,7 @@ public final class Candidate { this.fieldParametrisationImpl = fieldParametrisationImpl; this.valueObjectDisabled = addObjectFactoryForClass(candidateClass); this.fieldTargetNamespace = getTargetNamespace(candidateClassInfo, xmlSchemaModelClass); - collectScopedElementInfos(xmlElementDeclModelClass); + collectScopedFactoryMethods(xmlElementDeclModelClass); } private String getTargetNamespace(CClassInfo candidateClassInfo, JClass xmlSchemaModelClass) { @@ -90,7 +90,7 @@ private String getTargetNamespace(CClassInfo candidateClassInfo, JClass xmlSchem return null; } - private void collectScopedElementInfos(JClass xmlElementDeclModelClass) { + private void collectScopedFactoryMethods(JClass xmlElementDeclModelClass) { String dotClazz = candidateClass.fullName() + ".class"; // Only value Object Factory methods are inspected: @@ -102,8 +102,8 @@ private void collectScopedElementInfos(JClass xmlElementDeclModelClass) { continue; } - scopedElementInfos.put(method.name(), - new ScopedElementInfo(getAnnotationMemberValue(xmlElementDeclAnnotation, "name"), + scopedFactoryMethods.put(method, + new ScopedMethodInfo(getAnnotationMemberValue(xmlElementDeclAnnotation, "name"), getAnnotationMemberValue(xmlElementDeclAnnotation, "namespace"), method.params().get(0).type())); } @@ -176,12 +176,12 @@ public JDefinedClass getFieldParametrisationImpl() { } /** - * Return information about scoped elements, that have this candidate as a scope. + * Return information about scoped methods that have this candidate as a scope. * * @return object factory method name -to- element info map */ - public Map getScopedElementInfos() { - return scopedElementInfos; + public Map getScopedFactoryMethods() { + return scopedFactoryMethods; } /** diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/ScopedElementInfo.java b/src/main/java/com/sun/tools/xjc/addon/xew/ScopedMethodInfo.java similarity index 91% rename from src/main/java/com/sun/tools/xjc/addon/xew/ScopedElementInfo.java rename to src/main/java/com/sun/tools/xjc/addon/xew/ScopedMethodInfo.java index d9707fb..c8e385c 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/ScopedElementInfo.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/ScopedMethodInfo.java @@ -23,7 +23,7 @@ * } * */ -public final class ScopedElementInfo { +public final class ScopedMethodInfo { /** * Element name ("post-office"). @@ -40,7 +40,7 @@ public final class ScopedElementInfo { */ public final JType type; - public ScopedElementInfo(String name, String namespace, JType type) { + public ScopedMethodInfo(String name, String namespace, JType type) { this.name = name; this.namespace = namespace; this.type = type; diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java b/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java index 46540ff..57ef24c 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java @@ -463,7 +463,7 @@ else if (candidateFieldPropertyInfo instanceof CReferencePropertyInfo) { // Adapt factory class: for (JDefinedClass objectFactoryClass : candidate.getObjectFactoryClasses()) { modificationCount += createScopedFactoryMethods(codeModel, objectFactoryClass, - candidate.getScopedElementInfos().values(), targetClass, xmlElementDeclModelClass, + candidate.getScopedFactoryMethods().values(), targetClass, xmlElementDeclModelClass, jaxbElementModelClass, qNameModelClass); } @@ -492,7 +492,7 @@ else if (candidateFieldPropertyInfo instanceof CReferencePropertyInfo) { * {@code TypeClass (is a collection type) -> ContainerClass (marked for removal) -> ElementClass}
* we need to get
* {@code TypeClass -> ElementClass}.
- * Also this move should be reflected on factory method names. + * Also this move should be reflected on factory method names (and scope methods of other candidates as well). */ private boolean moveInnerClassToParent(Outline outline, Candidate candidate) { // Skip basic parametrisations like "List": @@ -509,18 +509,18 @@ private boolean moveInnerClassToParent(Outline outline, Candidate candidate) { JDefinedClass fieldParametrisationClass = candidate.getFieldParametrisationClass(); - String oldFactoryMethodName = fieldParametrisationClass.outer().name() + fieldParametrisationClass.name(); + String oldMethodName = fieldParametrisationClass.outer().name() + fieldParametrisationClass.name(); moveClassLevelUp(outline, fieldParametrisationImpl); - renameFactoryMethod(fieldParametrisationImpl._package()._getClass(FACTORY_CLASS_NAME), oldFactoryMethodName, + renameFactoryMethod(fieldParametrisationImpl._package()._getClass(FACTORY_CLASS_NAME), oldMethodName, fieldParametrisationClass.name()); if (candidate.isValueObjectDisabled()) { moveClassLevelUp(outline, fieldParametrisationClass); - renameFactoryMethod(fieldParametrisationClass._package()._getClass(FACTORY_CLASS_NAME), - oldFactoryMethodName, fieldParametrisationClass.name()); + renameFactoryMethod(fieldParametrisationClass._package()._getClass(FACTORY_CLASS_NAME), oldMethodName, + fieldParametrisationClass.name()); } return true; @@ -539,11 +539,11 @@ private boolean moveInnerClassToParent(Outline outline, Candidate candidate) { * @see com.sun.tools.xjc.generator.bean.ObjectFactoryGenerator */ private int createScopedFactoryMethods(JCodeModel codeModel, JDefinedClass factoryClass, - Collection scopedElementInfos, JDefinedClass targetClass, + Collection scopedFactoryMethodInfos, JDefinedClass targetClass, JClass xmlElementDeclModelClass, JClass jaxbElementModelClass, JClass qNameModelClass) { int createdMethods = 0; - NEXT: for (ScopedElementInfo info : scopedElementInfos) { + NEXT: for (ScopedMethodInfo info : scopedFactoryMethodInfos) { String dotClazz = targetClass.fullName() + ".class"; // First check that such factory method has not yet been created. It can be the case if target class @@ -758,15 +758,17 @@ private int deleteCandidates(Outline outline, Collection candidates) /** * Rename methods in factory class: {@code createABC() -> createAC()}. */ - private void renameFactoryMethod(JDefinedClass factoryClass, String oldMethodName, String newMethodName) { + private void renameFactoryMethod(JDefinedClass factoryClass, String oldMethodNameSuffix, String newMethodNameSuffix) { for (JMethod method : factoryClass.methods()) { String methodName = method.name(); - if (!methodName.contains(oldMethodName)) { + if (!methodName.contains(oldMethodNameSuffix)) { continue; } - method.name(methodName.replace(oldMethodName, newMethodName)); + method.name(methodName.replace(oldMethodNameSuffix, newMethodNameSuffix)); + + // Method renaming for scoped methods is automatically applied. writeSummary("\tRenamed " + methodName + " -> " + method.name() + " in " + factoryClass.fullName()); } @@ -791,7 +793,7 @@ private int deleteFactoryMethod(JDefinedClass factoryClass, Candidate candidate) if ((method.type() instanceof JDefinedClass && ((JDefinedClass) method.type()).isAssignableFrom(candidate.getClazz())) || isListedAsParametrisation(candidate.getClazz(), method.type()) - || candidate.getScopedElementInfos().containsKey(method.name())) { + || candidate.getScopedFactoryMethods().containsKey(method)) { writeSummary("\tRemoving factory method [" + method.type().fullName() + "#" + method.name() + "()] from " + factoryClass.fullName()); iter.remove(); diff --git a/src/test/generated_resources/inner_scoped_element/Catalogue.java b/src/test/generated_resources/inner_scoped_element/Catalogue.java new file mode 100644 index 0000000..da83bf3 --- /dev/null +++ b/src/test/generated_resources/inner_scoped_element/Catalogue.java @@ -0,0 +1,140 @@ + +package inner_scoped_element; + +import java.util.ArrayList; +import java.util.List; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlElementRef; +import jakarta.xml.bind.annotation.XmlElementRefs; +import jakarta.xml.bind.annotation.XmlElementWrapper; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="stockage_collection">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence minOccurs="0">
+ *                   <element name="stockage" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <all>
+ *                             <element name="collection" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence maxOccurs="unbounded" minOccurs="0">
+ *                                       <element name="effect" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                       <element name="term" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *                                     </sequence>
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </all>
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "stockageCollection" +}) +@XmlRootElement(name = "catalogue") +public class Catalogue { + + @XmlElementWrapper(name = "stockage_collection", required = true) + @XmlElement(name = "stockage") + protected List stockageCollection = new ArrayList(); + + public List getStockageCollection() { + return stockageCollection; + } + + public void setStockageCollection(List stockageCollection) { + this.stockageCollection = stockageCollection; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <all>
+     *         <element name="collection" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence maxOccurs="unbounded" minOccurs="0">
+     *                   <element name="effect" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                   <element name="term" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+     *                 </sequence>
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </all>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + + }) + public static class Stockage { + + @XmlElementWrapper + @XmlElementRefs({ + @XmlElementRef(name = "effect", type = JAXBElement.class, required = false), + @XmlElementRef(name = "term", type = JAXBElement.class, required = false) + }) + protected List> collection = new ArrayList>(); + + public List> getCollection() { + return collection; + } + + public void setCollection(List> collection) { + this.collection = collection; + } + + } + +} diff --git a/src/test/generated_resources/inner_scoped_element/ObjectFactory.java b/src/test/generated_resources/inner_scoped_element/ObjectFactory.java new file mode 100644 index 0000000..685a398 --- /dev/null +++ b/src/test/generated_resources/inner_scoped_element/ObjectFactory.java @@ -0,0 +1,63 @@ + +package inner_scoped_element; + +import javax.xml.namespace.QName; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.annotation.XmlElementDecl; +import jakarta.xml.bind.annotation.XmlRegistry; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the inner_scoped_element package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _CatalogueStockageCollectionStockageCollectionEffect_QNAME = new QName("", "effect"); + private final static QName _CatalogueStockageCollectionStockageCollectionTerm_QNAME = new QName("", "term"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: inner_scoped_element + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link Catalogue } + * + */ + public Catalogue createCatalogue() { + return new Catalogue(); + } + + /** + * Create an instance of {@link Catalogue.Stockage } + * + */ + public Catalogue.Stockage createCatalogueStockage() { + return new Catalogue.Stockage(); + } + + @XmlElementDecl(namespace = "", name = "effect", scope = Catalogue.Stockage.class) + public JAXBElement createCatalogueStockageEffect(String value) { + return new JAXBElement(new QName("", "effect"), String.class, Catalogue.Stockage.class, value); + } + + @XmlElementDecl(namespace = "", name = "term", scope = Catalogue.Stockage.class) + public JAXBElement createCatalogueStockageTerm(String value) { + return new JAXBElement(new QName("", "term"), String.class, Catalogue.Stockage.class, value); + } + +} diff --git a/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java b/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java index 40dd7d4..6ead2e3 100644 --- a/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java +++ b/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java @@ -138,6 +138,13 @@ public void testInnerElement() throws Exception { runTest("inner-element", extraXewOptions, true, classesToCheck); } + @Test + public void testInnerScopedElement() throws Exception { + List extraXewOptions = asList("-verbose", "-Xxew:instantiate early"); + List classesToCheck = asList("Catalogue"); + runTest("inner-scoped-element", extraXewOptions, false, classesToCheck); + } + @Test public void testInnerElementWithValueObjects() throws Exception { List classesToCheck = asList("Article", "Articles", "ArticlesCollections", "Filesystem", "Publisher", diff --git a/src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xml b/src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xml new file mode 100644 index 0000000..9d8d955 --- /dev/null +++ b/src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xml @@ -0,0 +1,19 @@ + + + + + + solar panels + system performance + energy efficiency + microinverter + + + + + shaded panel + maintenance costs + + + + diff --git a/src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xsd b/src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xsd new file mode 100644 index 0000000..7f2fac9 --- /dev/null +++ b/src/test/resources/com/sun/tools/xjc/addon/xew/inner-scoped-element.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/resources/com/sun/tools/xjc/addon/xew/publisher-shared.xsd b/src/test/resources/com/sun/tools/xjc/addon/xew/publisher-shared.xsd index 1902cea..1cdce5f 100644 --- a/src/test/resources/com/sun/tools/xjc/addon/xew/publisher-shared.xsd +++ b/src/test/resources/com/sun/tools/xjc/addon/xew/publisher-shared.xsd @@ -1,7 +1,7 @@ @@ -30,7 +30,6 @@ - From 5617b84fe7458f13870e62f28ec41314d4188a46 Mon Sep 17 00:00:00 2001 From: Dmitry Katsubo Date: Sat, 21 Jan 2023 02:05:12 +0100 Subject: [PATCH 3/4] Considering also types from @XmlElements annotation which are potential candidates to be moved one level up (fixes #62). --- .../sun/tools/xjc/addon/xew/Candidate.java | 48 ++++----- .../xjc/addon/xew/ParametrisationInfo.java | 26 +++++ .../addon/xew/XmlElementWrapperPlugin.java | 97 +++++++++++++------ .../element_mixed/AnyText.java | 2 +- .../generated_resources/element_mixed/Br.java | 28 ++++++ .../element_mixed/FormattedTextBr.java | 30 ++++++ .../element_mixed/ObjectFactory.java | 8 ++ .../xew/XmlElementWrapperPluginTest.java | 2 +- .../sun/tools/xjc/addon/xew/element-mixed.xsd | 17 ++-- .../xjc/addon/xew/element-name-collision.xml | 6 +- 10 files changed, 191 insertions(+), 73 deletions(-) create mode 100644 src/main/java/com/sun/tools/xjc/addon/xew/ParametrisationInfo.java create mode 100644 src/test/generated_resources/element_mixed/FormattedTextBr.java diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java b/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java index a34c95d..7a9961f 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/Candidate.java @@ -25,44 +25,41 @@ * of objects. */ public final class Candidate { - private final JDefinedClass candidateClass; + private final JDefinedClass candidateClass; - private final JFieldVar field; + private final JFieldVar field; - private final CPropertyInfo fieldPropertyInfo; + private final CPropertyInfo fieldPropertyInfo; - private final String fieldTargetNamespace; + private final String fieldTargetNamespace; - private final JDefinedClass fieldParametrisationClass; - - private final JDefinedClass fieldParametrisationImpl; + private final Collection parametrisationInfos; // Order matters (value Object Factory is first): - private final Map objectFactoryClasses = new LinkedHashMap<>(); + private final Map objectFactoryClasses = new LinkedHashMap<>(); - private final boolean valueObjectDisabled; + private final boolean valueObjectDisabled; // Order matters as it affects the order of generated methods in Object Factory: - private final Map scopedFactoryMethods = new LinkedHashMap<>(); + private final Map scopedFactoryMethods = new LinkedHashMap<>(); /** * By default the candidate is marked for removal unless something prevents it from being removed. */ - private boolean markedForRemoval = true; + private boolean markedForRemoval = true; /** * Number of times this candidate has been substituted in the model. */ - private int substitutionsCount; + private int substitutionsCount; Candidate(JDefinedClass candidateClass, CClassInfo candidateClassInfo, JFieldVar field, - JDefinedClass fieldParametrizationClass, JDefinedClass fieldParametrisationImpl, - JClass xmlElementDeclModelClass, JClass xmlSchemaModelClass) { + Collection parametrisationInfos, JClass xmlElementDeclModelClass, + JClass xmlSchemaModelClass) { this.candidateClass = candidateClass; this.field = field; this.fieldPropertyInfo = candidateClassInfo.getProperty(field.name()); - this.fieldParametrisationClass = fieldParametrizationClass; - this.fieldParametrisationImpl = fieldParametrisationImpl; + this.parametrisationInfos = parametrisationInfos; this.valueObjectDisabled = addObjectFactoryForClass(candidateClass); this.fieldTargetNamespace = getTargetNamespace(candidateClassInfo, xmlSchemaModelClass); collectScopedFactoryMethods(xmlElementDeclModelClass); @@ -138,7 +135,7 @@ public String getFieldName() { } /** - * The class of the only field in container class (collection interface or concrete implementation). + * The class of the only field in container class (collection interface or particular implementation). */ public JClass getFieldClass() { return (JClass) field.type(); @@ -159,20 +156,11 @@ public String getFieldTargetNamespace() { } /** - * The only parametrisation class of the field (collection type). In case of basic parametrisation like - * {@code List} this property is {@code null}. - */ - public JDefinedClass getFieldParametrisationClass() { - return fieldParametrisationClass; - } - - /** - * If {@link #getFieldParametrisationClass()} is an interface, then this holds the same value. Otherwise it holds - * the implementation (value object) of {@link #getFieldParametrisationClass()}. In case of basic parametrisation - * like {@code List} this property is {@code null}. + * The list of parametrisation classes of the field (collection types). In case of basic parametrisation like + * {@code List} this collection is empty. */ - public JDefinedClass getFieldParametrisationImpl() { - return fieldParametrisationImpl; + public Collection getParametrisationInfos() { + return parametrisationInfos; } /** diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/ParametrisationInfo.java b/src/main/java/com/sun/tools/xjc/addon/xew/ParametrisationInfo.java new file mode 100644 index 0000000..4a5ba29 --- /dev/null +++ b/src/main/java/com/sun/tools/xjc/addon/xew/ParametrisationInfo.java @@ -0,0 +1,26 @@ +package com.sun.tools.xjc.addon.xew; + +import com.sun.codemodel.JDefinedClass; + +import org.apache.commons.lang3.builder.ReflectionToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * Container for parametrisation class and corresponding implementation. If value objects are enabled, then class and + * implementation refer the same class for simplicity. + */ +public class ParametrisationInfo { + + public final JDefinedClass parametrisationClass; + + public JDefinedClass parametrisationImpl; + + public ParametrisationInfo(JDefinedClass parametrisationClass) { + this.parametrisationClass = parametrisationClass; + } + + @Override + public String toString() { + return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); + } +} diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java b/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java index 57ef24c..f8e9fcc 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPlugin.java @@ -34,6 +34,7 @@ import static com.sun.tools.xjc.addon.xew.CommonUtils.isHiddenClass; import static com.sun.tools.xjc.addon.xew.CommonUtils.isListedAsParametrisation; import static com.sun.tools.xjc.addon.xew.CommonUtils.setPrivateField; +import static java.util.Collections.singletonList; import java.io.IOException; import java.util.ArrayList; @@ -153,7 +154,7 @@ protected void runInternal(Outline outline) throws ClassNotFoundException, IOExc // Write information on candidate classes to summary file. writeSummary("Candidates:"); - for (Candidate candidate : findCandidateClasses(outline, xmlElementDeclModelClass)) { + for (Candidate candidate : findCandidateClasses(outline, xmlElementsModelClass, xmlElementDeclModelClass)) { if (globalConfiguration.isClassIncluded(candidate.getClassName())) { if (globalConfiguration.isClassUnmarkedForRemoval(candidate.getClassName())) { candidate.unmarkForRemoval(); @@ -496,34 +497,37 @@ else if (candidateFieldPropertyInfo instanceof CReferencePropertyInfo) { */ private boolean moveInnerClassToParent(Outline outline, Candidate candidate) { // Skip basic parametrisations like "List": - if (candidate.getFieldParametrisationClass() == null) { + if (candidate.getParametrisationInfos().isEmpty()) { return false; } - JDefinedClass fieldParametrisationImpl = candidate.getFieldParametrisationImpl(); + boolean wasAnyClassMoved = false; - if (candidate.getClazz() != fieldParametrisationImpl.parentContainer()) { - // Field parametrisation class is not inner class of the candidate: - return false; - } + for (ParametrisationInfo parametrisationInfo : candidate.getParametrisationInfos()) { + if (candidate.getClazz() != parametrisationInfo.parametrisationImpl.parentContainer()) { + // Field parametrisation class is not inner class of the candidate, hence skipped: + continue; + } - JDefinedClass fieldParametrisationClass = candidate.getFieldParametrisationClass(); + wasAnyClassMoved = true; - String oldMethodName = fieldParametrisationClass.outer().name() + fieldParametrisationClass.name(); + String oldMethodName = parametrisationInfo.parametrisationClass.outer().name() + + parametrisationInfo.parametrisationClass.name(); - moveClassLevelUp(outline, fieldParametrisationImpl); + moveClassLevelUp(outline, parametrisationInfo.parametrisationImpl); - renameFactoryMethod(fieldParametrisationImpl._package()._getClass(FACTORY_CLASS_NAME), oldMethodName, - fieldParametrisationClass.name()); + renameFactoryMethod(parametrisationInfo.parametrisationImpl._package()._getClass(FACTORY_CLASS_NAME), + oldMethodName, parametrisationInfo.parametrisationClass.name()); - if (candidate.isValueObjectDisabled()) { - moveClassLevelUp(outline, fieldParametrisationClass); + if (candidate.isValueObjectDisabled()) { + moveClassLevelUp(outline, parametrisationInfo.parametrisationClass); - renameFactoryMethod(fieldParametrisationClass._package()._getClass(FACTORY_CLASS_NAME), oldMethodName, - fieldParametrisationClass.name()); + renameFactoryMethod(parametrisationInfo.parametrisationClass._package()._getClass(FACTORY_CLASS_NAME), + oldMethodName, parametrisationInfo.parametrisationClass.name()); + } } - return true; + return wasAnyClassMoved; } /** @@ -609,14 +613,18 @@ private int createScopedFactoryMethods(JCodeModel codeModel, JDefinedClass facto /** * Locate the candidates classes for substitution/removal. * - * @return a map className -> Candidate + * @return list of potential candidates */ - private Collection findCandidateClasses(Outline outline, JClass xmlElementDeclModelClass) { + private Collection findCandidateClasses(Outline outline, JClass xmlElementsModelClass, + JClass xmlElementDeclModelClass) { + Map classes = new HashMap<>(); Map interfaceImplementations = new HashMap<>(); // Visit all classes to create a map "interfaceName -> ClassOutline". // This map is later used to resolve implementations from interfaces. for (ClassOutline classOutline : outline.getClasses()) { + classes.put(classOutline.implClass.fullName() + ".class", classOutline.implClass); + for (Iterator iter = classOutline.implClass._implements(); iter.hasNext();) { JClass interfaceClass = iter.next(); @@ -676,30 +684,55 @@ private Collection findCandidateClasses(Outline outline, JClass xmlEl // FIXME: All known collections have exactly one parametrisation type. assert fieldParametrisations.size() == 1; - JDefinedClass fieldParametrisationClass = null; - JDefinedClass fieldParametrisationImpl = null; + List parametrisationInfos = new ArrayList<>(); - // Parametrisations like "List" or "List" are not considered. - // They are substituted as is and do not require moving of classes. if (fieldParametrisations.get(0) instanceof JDefinedClass) { - fieldParametrisationClass = (JDefinedClass) fieldParametrisations.get(0); + parametrisationInfos = singletonList( + new ParametrisationInfo((JDefinedClass) fieldParametrisations.get(0))); + } + else { + parametrisationInfos = new ArrayList<>(); + + // Parametrisations like "List" or "List" require types in @XmlElements to be considered. + JAnnotationUse annotation = getAnnotation(field, xmlElementsModelClass); + + if (annotation != null) { + JAnnotationArrayMember annotationArrayMember = (JAnnotationArrayMember) getAnnotationMember( + annotation, "value"); + + if (annotationArrayMember != null) { + for (JAnnotationUse subAnnotation : annotationArrayMember.annotations()) { + String typeClassName = getAnnotationMemberValue(subAnnotation, "type"); + if (typeClassName != null) { + JDefinedClass typeClass = classes.get(typeClassName); + + if (typeClass != null) { + parametrisationInfos.add(new ParametrisationInfo(typeClass)); + } + } + } + } + } + } + for (ParametrisationInfo parametrisationInfo : parametrisationInfos) { ClassOutline fieldParametrisationClassOutline = interfaceImplementations - .get(fieldParametrisationClass.fullName()); + .get(parametrisationInfo.parametrisationClass.fullName()); if (fieldParametrisationClassOutline != null) { - assert fieldParametrisationClassOutline.ref == fieldParametrisationClass; + assert fieldParametrisationClassOutline.ref == parametrisationInfo.parametrisationClass; - fieldParametrisationImpl = fieldParametrisationClassOutline.implClass; + parametrisationInfo.parametrisationImpl = fieldParametrisationClassOutline.implClass; } else { - fieldParametrisationImpl = fieldParametrisationClass; + // Set to the same class for simplicity: + parametrisationInfo.parametrisationImpl = parametrisationInfo.parametrisationClass; } } // We have a candidate class: - Candidate candidate = new Candidate(candidateClass, classOutline.target, field, fieldParametrisationClass, - fieldParametrisationImpl, xmlElementDeclModelClass, xmlSchemaModelClass); + Candidate candidate = new Candidate(candidateClass, classOutline.target, field, parametrisationInfos, + xmlElementDeclModelClass, xmlSchemaModelClass); candidates.add(candidate); logger.debug("Found " + candidate); @@ -758,7 +791,8 @@ private int deleteCandidates(Outline outline, Collection candidates) /** * Rename methods in factory class: {@code createABC() -> createAC()}. */ - private void renameFactoryMethod(JDefinedClass factoryClass, String oldMethodNameSuffix, String newMethodNameSuffix) { + private void renameFactoryMethod(JDefinedClass factoryClass, String oldMethodNameSuffix, + String newMethodNameSuffix) { for (JMethod method : factoryClass.methods()) { String methodName = method.name(); @@ -834,6 +868,7 @@ private void moveClassLevelUp(Outline outline, JDefinedClass clazz) { // Modify the container so it now refers the class. Container can be a class or package. JDefinedClass parent = (JDefinedClass) clazz.parentContainer(); JClassContainer grandParent = parent.parentContainer(); + // Allows to track class name collisions: Map classes; // FIXME: Pending https://java.net/jira/browse/JAXB-957 diff --git a/src/test/generated_resources/element_mixed/AnyText.java b/src/test/generated_resources/element_mixed/AnyText.java index f86fe2f..675a4f2 100644 --- a/src/test/generated_resources/element_mixed/AnyText.java +++ b/src/test/generated_resources/element_mixed/AnyText.java @@ -51,7 +51,7 @@ public class AnyText { @XmlElements({ @XmlElement(name = "i", type = I.class, namespace = "http://foo.org/"), @XmlElement(name = "b", type = B.class, namespace = "http://foo.org/"), - @XmlElement(name = "br", type = Br.class, namespace = "http://foo.org/") + @XmlElement(name = "br", type = FormattedTextBr.class, namespace = "http://foo.org/") }) protected List formattedText = new ArrayList(); @XmlElementWrapper(name = "fixed-text", required = true) diff --git a/src/test/generated_resources/element_mixed/Br.java b/src/test/generated_resources/element_mixed/Br.java index f03b03f..91d4c8f 100644 --- a/src/test/generated_resources/element_mixed/Br.java +++ b/src/test/generated_resources/element_mixed/Br.java @@ -3,6 +3,7 @@ import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; import jakarta.xml.bind.annotation.XmlType; @@ -15,6 +16,7 @@ * <complexType name="br"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <attribute name="mode" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> * </complexType> @@ -26,5 +28,31 @@ @XmlType(name = "br") public class Br { + @XmlAttribute(name = "mode") + protected String mode; + + /** + * Gets the value of the mode property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMode() { + return mode; + } + + /** + * Sets the value of the mode property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMode(String value) { + this.mode = value; + } } diff --git a/src/test/generated_resources/element_mixed/FormattedTextBr.java b/src/test/generated_resources/element_mixed/FormattedTextBr.java new file mode 100644 index 0000000..cfd9033 --- /dev/null +++ b/src/test/generated_resources/element_mixed/FormattedTextBr.java @@ -0,0 +1,30 @@ + +package element_mixed; + +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlType; + + +/** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "") +public class FormattedTextBr { + + +} diff --git a/src/test/generated_resources/element_mixed/ObjectFactory.java b/src/test/generated_resources/element_mixed/ObjectFactory.java index f3820fb..f55ff5d 100644 --- a/src/test/generated_resources/element_mixed/ObjectFactory.java +++ b/src/test/generated_resources/element_mixed/ObjectFactory.java @@ -70,6 +70,14 @@ public Br createBr() { return new Br(); } + /** + * Create an instance of {@link FormattedTextBr } + * + */ + public FormattedTextBr createFormattedTextBr() { + return new FormattedTextBr(); + } + /** * Create an instance of {@link JAXBElement }{@code <}{@link B }{@code >} * diff --git a/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java b/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java index 6ead2e3..4c42593 100644 --- a/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java +++ b/src/test/java/com/sun/tools/xjc/addon/xew/XmlElementWrapperPluginTest.java @@ -212,7 +212,7 @@ public void testElementAnyType() throws Exception { public void testElementMixed() throws Exception { // Most classes cannot be tested for content List extraXewOptions = singletonList("-debug"); - List classesToCheck = asList("B", "Br", "I", "AnyText", "package-info"); + List classesToCheck = asList("B", "Br", "FormattedTextBr", "I", "AnyText", "package-info"); runTest("element-mixed", extraXewOptions, false, classesToCheck); } diff --git a/src/test/resources/com/sun/tools/xjc/addon/xew/element-mixed.xsd b/src/test/resources/com/sun/tools/xjc/addon/xew/element-mixed.xsd index 5a46972..df2ddb8 100644 --- a/src/test/resources/com/sun/tools/xjc/addon/xew/element-mixed.xsd +++ b/src/test/resources/com/sun/tools/xjc/addon/xew/element-mixed.xsd @@ -25,11 +25,9 @@ - - - + + + @@ -40,13 +38,18 @@ - + + + + diff --git a/src/test/resources/com/sun/tools/xjc/addon/xew/element-name-collision.xml b/src/test/resources/com/sun/tools/xjc/addon/xew/element-name-collision.xml index 4e9c1d1..0c673a7 100644 --- a/src/test/resources/com/sun/tools/xjc/addon/xew/element-name-collision.xml +++ b/src/test/resources/com/sun/tools/xjc/addon/xew/element-name-collision.xml @@ -8,11 +8,11 @@ - Mutant - SpiderMan + rebellion + Han Solo - Jedi + jedi Luke Skywalker From 69b4ac2deead1e160526824f720f653bd76ff587 Mon Sep 17 00:00:00 2001 From: Dmitry Katsubo Date: Tue, 10 Jan 2023 00:58:53 +0100 Subject: [PATCH 4/4] Integrated JAXB v4. --- pom.xml | 8 +- .../sun/tools/xjc/addon/xew/CommonUtils.java | 4 +- .../annotation_reference/ClassCommon.java | 22 +- .../annotation_reference/ClassExt.java | 24 +- .../annotation_reference/ClassesEu.java | 28 +- .../annotation_reference/ClassesUs.java | 28 +- .../annotation_reference/Markup.java | 32 +- .../annotation_reference/ObjectFactory.java | 20 +- .../annotation_reference/Para.java | 28 +- .../annotation_reference/SearchEu.java | 24 +- .../annotation_reference/SearchMulti.java | 46 +-- .../different_namespaces/BaseContainer.java | 18 +- .../different_namespaces/Container.java | 52 ++-- .../different_namespaces/Entry.java | 18 +- .../different_namespaces/ObjectFactory.java | 6 + .../element_any/Message.java | 24 +- .../element_any/ObjectFactory.java | 2 + .../element_any_type/Conversion.java | 28 +- .../element_any_type/Entry.java | 24 +- .../element_any_type/ObjectFactory.java | 8 +- .../Family.java | 30 +- .../FamilyMember.java | 74 ++--- .../ObjectFactory.java | 6 + .../Article.java | 24 +- .../Articles.java | 28 +- .../ArticlesCollections.java | 30 +- .../ObjectFactory.java | 8 + .../Publisher.java | 24 +- .../element_list_extended/Foo.java | 78 ++--- .../element_list_extended/ObjectFactory.java | 4 + .../element_mixed/AnyText.java | 32 +- .../generated_resources/element_mixed/B.java | 28 +- .../generated_resources/element_mixed/Br.java | 18 +- .../element_mixed/FormattedTextBr.java | 16 +- .../generated_resources/element_mixed/I.java | 28 +- .../element_mixed/ObjectFactory.java | 22 +- .../element_mixed/package-info.java | 4 +- .../element_name_collision/ObjectFactory.java | 8 + .../element_name_collision/Root.java | 288 +++++++++--------- .../element_reserved_word/Class.java | 32 +- .../element_reserved_word/Method.java | 24 +- .../element_reserved_word/ObjectFactory.java | 4 + .../element_scoped/ObjectFactory.java | 12 +- .../element_scoped/Return.java | 50 +-- .../element_scoped/SearchParameters.java | 24 +- .../element_with_adapter/Calendar.java | 46 +-- .../element_with_adapter/ObjectFactory.java | 2 + .../element_with_customization/Args.java | 28 +- .../ObjectFactory.java | 4 + .../PostOffice.java | 34 +-- .../element_with_parent/Alliance.java | 30 +- .../element_with_parent/Group.java | 74 ++--- .../element_with_parent/ObjectFactory.java | 8 + .../element_with_parent/Organization.java | 28 +- .../inner_element/Filesystem.java | 172 +++++------ .../inner_element/ObjectFactory.java | 10 + .../inner_element/Volumes.java | 74 ++--- .../inner_element_value_objects/Article.java | 24 +- .../inner_element_value_objects/Articles.java | 26 +- .../ArticlesCollections.java | 26 +- .../Filesystem.java | 122 ++++---- .../ObjectFactory.java | 14 + .../Publisher.java | 22 +- .../inner_element_value_objects/Volume.java | 24 +- .../impl/ArticlesCollectionsImpl.java | 4 +- .../impl/ArticlesImpl.java | 2 +- .../impl/FilesystemImpl.java | 6 +- .../impl/JAXBContextFactory.java | 23 +- .../impl/ObjectFactory.java | 14 + .../impl/PublisherImpl.java | 2 +- .../inner_scoped_element/Catalogue.java | 132 ++++---- .../inner_scoped_element/ObjectFactory.java | 8 +- .../substitution_groups/Address.java | 22 +- .../substitution_groups/ContactInfo.java | 16 +- .../substitution_groups/Customer.java | 44 +-- .../substitution_groups/ObjectFactory.java | 14 +- .../substitution_groups/PhoneNumber.java | 24 +- .../unqualified/ObjectFactory.java | 2 + .../unqualified/RootElement.java | 24 +- 79 files changed, 1310 insertions(+), 1135 deletions(-) diff --git a/pom.xml b/pom.xml index b0e1d5b..597ea7d 100644 --- a/pom.xml +++ b/pom.xml @@ -47,11 +47,11 @@ - 3.0.1 - 3.0.1 + 4.0.0 + 4.0.1 - 1.8 - 1.8 + 11 + 11 UTF-8 diff --git a/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java b/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java index 03ba540..eca1f53 100644 --- a/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java +++ b/src/main/java/com/sun/tools/xjc/addon/xew/CommonUtils.java @@ -134,9 +134,9 @@ public static void addAnnotation(JVar field, JAnnotationUse annotation) { } /** - * Check that given field property has name customization ({@code }). See also - * {@code org.glassfish.jaxb.core.api.impl.NameUtil}. + * Check that given field property has name customization ({@code }). * + * @see org.glassfish.jaxb.core.api.impl.NameUtil * @see com.sun.codemodel.JJavaName * @see com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty#getCustomization(XSComponent) */ diff --git a/src/test/generated_resources/annotation_reference/ClassCommon.java b/src/test/generated_resources/annotation_reference/ClassCommon.java index 034e599..9066448 100644 --- a/src/test/generated_resources/annotation_reference/ClassCommon.java +++ b/src/test/generated_resources/annotation_reference/ClassCommon.java @@ -12,17 +12,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="class-common">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="id" type="{http://www.w3.org/2001/XMLSchema}byte"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/annotation_reference/ClassExt.java b/src/test/generated_resources/annotation_reference/ClassExt.java index 89be332..5a02aa6 100644 --- a/src/test/generated_resources/annotation_reference/ClassExt.java +++ b/src/test/generated_resources/annotation_reference/ClassExt.java @@ -12,18 +12,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="class-ext">
- *   <complexContent>
- *     <extension base="{}class-common">
- *       <sequence>
- *         <element name="country" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="code" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/annotation_reference/ClassesEu.java b/src/test/generated_resources/annotation_reference/ClassesEu.java index b4ffa83..11f50ce 100644 --- a/src/test/generated_resources/annotation_reference/ClassesEu.java +++ b/src/test/generated_resources/annotation_reference/ClassesEu.java @@ -14,17 +14,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="classes-eu">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="class-eu" type="{}class-common" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -44,7 +44,7 @@ public class ClassesEu { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the classEu property. + * This is why there is not a {@code set} method for the classEu property. * *

* For example, to add a new item, do as follows: @@ -58,10 +58,12 @@ public class ClassesEu { * {@link ClassCommon } * * + * @return + * The value of the classEu property. */ public List getClassEu() { if (classEu == null) { - classEu = new ArrayList(); + classEu = new ArrayList<>(); } return this.classEu; } diff --git a/src/test/generated_resources/annotation_reference/ClassesUs.java b/src/test/generated_resources/annotation_reference/ClassesUs.java index 2b4b1aa..9e39620 100644 --- a/src/test/generated_resources/annotation_reference/ClassesUs.java +++ b/src/test/generated_resources/annotation_reference/ClassesUs.java @@ -14,17 +14,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="classes-us">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="class-us" type="{}class-ext" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -44,7 +44,7 @@ public class ClassesUs { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the classUs property. + * This is why there is not a {@code set} method for the classUs property. * *

* For example, to add a new item, do as follows: @@ -58,10 +58,12 @@ public class ClassesUs { * {@link ClassExt } * * + * @return + * The value of the classUs property. */ public List getClassUs() { if (classUs == null) { - classUs = new ArrayList(); + classUs = new ArrayList<>(); } return this.classUs; } diff --git a/src/test/generated_resources/annotation_reference/Markup.java b/src/test/generated_resources/annotation_reference/Markup.java index a79acfa..df190a0 100644 --- a/src/test/generated_resources/annotation_reference/Markup.java +++ b/src/test/generated_resources/annotation_reference/Markup.java @@ -16,19 +16,19 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="markup">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice maxOccurs="unbounded" minOccurs="0">
- *         <element ref="{}br"/>
- *         <element ref="{}page"/>
- *         <element ref="{}para"/>
- *       </choice>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -52,7 +52,7 @@ public class Markup { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the brOrPageOrPara property. + * This is why there is not a {@code set} method for the brOrPageOrPara property. * *

* For example, to add a new item, do as follows: @@ -68,10 +68,12 @@ public class Markup { * {@link JAXBElement }{@code <}{@link Object }{@code >} * * + * @return + * The value of the brOrPageOrPara property. */ public List getBrOrPageOrPara() { if (brOrPageOrPara == null) { - brOrPageOrPara = new ArrayList(); + brOrPageOrPara = new ArrayList<>(); } return this.brOrPageOrPara; } diff --git a/src/test/generated_resources/annotation_reference/ObjectFactory.java b/src/test/generated_resources/annotation_reference/ObjectFactory.java index baebb94..3e49cb3 100644 --- a/src/test/generated_resources/annotation_reference/ObjectFactory.java +++ b/src/test/generated_resources/annotation_reference/ObjectFactory.java @@ -37,6 +37,8 @@ public ObjectFactory() { /** * Create an instance of {@link Para } * + * @return + * the new instance of {@link Para } */ public Para createPara() { return new Para(); @@ -45,6 +47,8 @@ public Para createPara() { /** * Create an instance of {@link Markup } * + * @return + * the new instance of {@link Markup } */ public Markup createMarkup() { return new Markup(); @@ -53,6 +57,8 @@ public Markup createMarkup() { /** * Create an instance of {@link SearchEu } * + * @return + * the new instance of {@link SearchEu } */ public SearchEu createSearchEu() { return new SearchEu(); @@ -61,6 +67,8 @@ public SearchEu createSearchEu() { /** * Create an instance of {@link SearchMulti } * + * @return + * the new instance of {@link SearchMulti } */ public SearchMulti createSearchMulti() { return new SearchMulti(); @@ -69,6 +77,8 @@ public SearchMulti createSearchMulti() { /** * Create an instance of {@link ClassCommon } * + * @return + * the new instance of {@link ClassCommon } */ public ClassCommon createClassCommon() { return new ClassCommon(); @@ -77,6 +87,8 @@ public ClassCommon createClassCommon() { /** * Create an instance of {@link ClassExt } * + * @return + * the new instance of {@link ClassExt } */ public ClassExt createClassExt() { return new ClassExt(); @@ -85,6 +97,8 @@ public ClassExt createClassExt() { /** * Create an instance of {@link ClassesEu } * + * @return + * the new instance of {@link ClassesEu } */ public ClassesEu createClassesEu() { return new ClassesEu(); @@ -93,6 +107,8 @@ public ClassesEu createClassesEu() { /** * Create an instance of {@link ClassesUs } * + * @return + * the new instance of {@link ClassesUs } */ public ClassesUs createClassesUs() { return new ClassesUs(); @@ -108,7 +124,7 @@ public ClassesUs createClassesUs() { */ @XmlElementDecl(namespace = "", name = "br") public JAXBElement createBr(Object value) { - return new JAXBElement(_Br_QNAME, Object.class, null, value); + return new JAXBElement<>(_Br_QNAME, Object.class, null, value); } /** @@ -121,7 +137,7 @@ public JAXBElement createBr(Object value) { */ @XmlElementDecl(namespace = "", name = "page") public JAXBElement createPage(Object value) { - return new JAXBElement(_Page_QNAME, Object.class, null, value); + return new JAXBElement<>(_Page_QNAME, Object.class, null, value); } } diff --git a/src/test/generated_resources/annotation_reference/Para.java b/src/test/generated_resources/annotation_reference/Para.java index 8aa1dc4..8aed8e2 100644 --- a/src/test/generated_resources/annotation_reference/Para.java +++ b/src/test/generated_resources/annotation_reference/Para.java @@ -15,17 +15,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="sub" type="{}markup" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -46,7 +46,7 @@ public class Para { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the sub property. + * This is why there is not a {@code set} method for the sub property. * *

* For example, to add a new item, do as follows: @@ -60,10 +60,12 @@ public class Para { * {@link Markup } * * + * @return + * The value of the sub property. */ public List getSub() { if (sub == null) { - sub = new ArrayList(); + sub = new ArrayList<>(); } return this.sub; } diff --git a/src/test/generated_resources/annotation_reference/SearchEu.java b/src/test/generated_resources/annotation_reference/SearchEu.java index baaa6df..b7f3299 100644 --- a/src/test/generated_resources/annotation_reference/SearchEu.java +++ b/src/test/generated_resources/annotation_reference/SearchEu.java @@ -15,17 +15,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="search-eu">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="classes-eu" type="{}classes-eu"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -37,7 +37,7 @@ public class SearchEu { @XmlElementWrapper(name = "classes-eu", required = true, nillable = true) @XmlElement(name = "class-eu") - protected List classesEu = new ArrayList(); + protected List classesEu = new ArrayList<>(); public List getClassesEu() { return classesEu; diff --git a/src/test/generated_resources/annotation_reference/SearchMulti.java b/src/test/generated_resources/annotation_reference/SearchMulti.java index ec90da7..92f468e 100644 --- a/src/test/generated_resources/annotation_reference/SearchMulti.java +++ b/src/test/generated_resources/annotation_reference/SearchMulti.java @@ -16,26 +16,26 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="search-multi">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice maxOccurs="unbounded">
- *         <element name="classes-eu" type="{}classes-eu"/>
- *         <element name="classes-us" type="{}classes-us"/>
- *       </choice>
- *       <attribute name="mode" use="required" fixed="OTH">
- *         <simpleType>
- *           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *             <minLength value="3"/>
- *             <maxLength value="3"/>
- *           </restriction>
- *         </simpleType>
- *       </attribute>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *       
+ *         
+ *           
+ *             
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -64,7 +64,7 @@ public class SearchMulti { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the classesEuOrClassesUs property. + * This is why there is not a {@code set} method for the classesEuOrClassesUs property. * *

* For example, to add a new item, do as follows: @@ -79,10 +79,12 @@ public class SearchMulti { * {@link ClassesUs } * * + * @return + * The value of the classesEuOrClassesUs property. */ public List getClassesEuOrClassesUs() { if (classesEuOrClassesUs == null) { - classesEuOrClassesUs = new ArrayList(); + classesEuOrClassesUs = new ArrayList<>(); } return this.classesEuOrClassesUs; } diff --git a/src/test/generated_resources/different_namespaces/BaseContainer.java b/src/test/generated_resources/different_namespaces/BaseContainer.java index 39d4d64..510a838 100644 --- a/src/test/generated_resources/different_namespaces/BaseContainer.java +++ b/src/test/generated_resources/different_namespaces/BaseContainer.java @@ -14,15 +14,15 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="base_container">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/different_namespaces/Container.java b/src/test/generated_resources/different_namespaces/Container.java index b53b2ed..b27df8a 100644 --- a/src/test/generated_resources/different_namespaces/Container.java +++ b/src/test/generated_resources/different_namespaces/Container.java @@ -16,29 +16,29 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <extension base="{http://example.com/container}base_container">
- *       <sequence>
- *         <element ref="{http://example.com/entries}entries" minOccurs="0"/>
- *         <element ref="{http://example.com/items}items"/>
- *         <element name="tests" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="test" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -65,7 +65,7 @@ public class Container public List getEntries() { if (entries == null) { - entries = new LinkedList(); + entries = new LinkedList<>(); } return entries; } @@ -76,7 +76,7 @@ public void setEntries(List entries) { public List getItems() { if (items == null) { - items = new LinkedList(); + items = new LinkedList<>(); } return items; } @@ -87,7 +87,7 @@ public void setItems(List items) { public List getTests() { if (tests == null) { - tests = new LinkedList(); + tests = new LinkedList<>(); } return tests; } diff --git a/src/test/generated_resources/different_namespaces/Entry.java b/src/test/generated_resources/different_namespaces/Entry.java index 2bf1781..9fb36e0 100644 --- a/src/test/generated_resources/different_namespaces/Entry.java +++ b/src/test/generated_resources/different_namespaces/Entry.java @@ -14,15 +14,15 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/different_namespaces/ObjectFactory.java b/src/test/generated_resources/different_namespaces/ObjectFactory.java index d6c5559..bf3cfd1 100644 --- a/src/test/generated_resources/different_namespaces/ObjectFactory.java +++ b/src/test/generated_resources/different_namespaces/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Container } * + * @return + * the new instance of {@link Container } */ public Container createContainer() { return new Container(); @@ -40,6 +42,8 @@ public Container createContainer() { /** * Create an instance of {@link BaseContainer } * + * @return + * the new instance of {@link BaseContainer } */ public BaseContainer createBaseContainer() { return new BaseContainer(); @@ -48,6 +52,8 @@ public BaseContainer createBaseContainer() { /** * Create an instance of {@link Entry } * + * @return + * the new instance of {@link Entry } */ public Entry createEntry() { return new Entry(); diff --git a/src/test/generated_resources/element_any/Message.java b/src/test/generated_resources/element_any/Message.java index b92ee6b..04379ed 100644 --- a/src/test/generated_resources/element_any/Message.java +++ b/src/test/generated_resources/element_any/Message.java @@ -16,17 +16,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}item"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -39,7 +39,7 @@ public class Message { @XmlElementWrapper(name = "item", required = true) @XmlAnyElement(lax = true) - protected List items = new ArrayList(); + protected List items = new ArrayList<>(); public List getItems() { return items; diff --git a/src/test/generated_resources/element_any/ObjectFactory.java b/src/test/generated_resources/element_any/ObjectFactory.java index da82b45..773c335 100644 --- a/src/test/generated_resources/element_any/ObjectFactory.java +++ b/src/test/generated_resources/element_any/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Message } * + * @return + * the new instance of {@link Message } */ public Message createMessage() { return new Message(); diff --git a/src/test/generated_resources/element_any_type/Conversion.java b/src/test/generated_resources/element_any_type/Conversion.java index 0c566bd..ed4f1bb 100644 --- a/src/test/generated_resources/element_any_type/Conversion.java +++ b/src/test/generated_resources/element_any_type/Conversion.java @@ -16,18 +16,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="accept" type="{}List"/>
- *         <element name="return" type="{}Map"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -41,10 +41,10 @@ public class Conversion { @XmlElementWrapper(name = "accept", required = true) @XmlElement(name = "elements", nillable = true) - protected List accepts = new ArrayList(); + protected List accepts = new ArrayList<>(); @XmlElementWrapper(name = "return", required = true) @XmlElement(name = "entry", nillable = true) - protected List returns = new ArrayList(); + protected List returns = new ArrayList<>(); public List getAccepts() { return accepts; diff --git a/src/test/generated_resources/element_any_type/Entry.java b/src/test/generated_resources/element_any_type/Entry.java index 4d1fe14..67557b0 100644 --- a/src/test/generated_resources/element_any_type/Entry.java +++ b/src/test/generated_resources/element_any_type/Entry.java @@ -13,18 +13,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="Entry">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/>
- *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}anyType" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/element_any_type/ObjectFactory.java b/src/test/generated_resources/element_any_type/ObjectFactory.java index 6c2c56d..8ca6d9a 100644 --- a/src/test/generated_resources/element_any_type/ObjectFactory.java +++ b/src/test/generated_resources/element_any_type/ObjectFactory.java @@ -37,6 +37,8 @@ public ObjectFactory() { /** * Create an instance of {@link Conversion } * + * @return + * the new instance of {@link Conversion } */ public Conversion createConversion() { return new Conversion(); @@ -45,6 +47,8 @@ public Conversion createConversion() { /** * Create an instance of {@link Entry } * + * @return + * the new instance of {@link Entry } */ public Entry createEntry() { return new Entry(); @@ -60,7 +64,7 @@ public Entry createEntry() { */ @XmlElementDecl(namespace = "", name = "key", scope = Entry.class) public JAXBElement createEntryKey(Object value) { - return new JAXBElement(_EntryKey_QNAME, Object.class, Entry.class, value); + return new JAXBElement<>(_EntryKey_QNAME, Object.class, Entry.class, value); } /** @@ -73,7 +77,7 @@ public JAXBElement createEntryKey(Object value) { */ @XmlElementDecl(namespace = "", name = "value", scope = Entry.class) public JAXBElement createEntryValue(Object value) { - return new JAXBElement(_EntryValue_QNAME, Object.class, Entry.class, value); + return new JAXBElement<>(_EntryValue_QNAME, Object.class, Entry.class, value); } } diff --git a/src/test/generated_resources/element_as_parametrisation_family/Family.java b/src/test/generated_resources/element_as_parametrisation_family/Family.java index e7f337c..84c4522 100644 --- a/src/test/generated_resources/element_as_parametrisation_family/Family.java +++ b/src/test/generated_resources/element_as_parametrisation_family/Family.java @@ -14,18 +14,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="family">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice>
- *         <element name="family-member" type="{}family-member" maxOccurs="unbounded"/>
- *         <element name="parent" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
- *       </choice>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -47,7 +47,7 @@ public class Family { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the familyMember property. + * This is why there is not a {@code set} method for the familyMember property. * *

* For example, to add a new item, do as follows: @@ -61,10 +61,12 @@ public class Family { * {@link FamilyMember } * * + * @return + * The value of the familyMember property. */ public List getFamilyMember() { if (familyMember == null) { - familyMember = new ArrayList(); + familyMember = new ArrayList<>(); } return this.familyMember; } diff --git a/src/test/generated_resources/element_as_parametrisation_family/FamilyMember.java b/src/test/generated_resources/element_as_parametrisation_family/FamilyMember.java index d30f6a5..15ab683 100644 --- a/src/test/generated_resources/element_as_parametrisation_family/FamilyMember.java +++ b/src/test/generated_resources/element_as_parametrisation_family/FamilyMember.java @@ -14,28 +14,28 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="family-member">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="id" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="number" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
- *                   <element name="type" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -55,7 +55,7 @@ public class FamilyMember { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the id property. + * This is why there is not a {@code set} method for the id property. * *

* For example, to add a new item, do as follows: @@ -69,10 +69,12 @@ public class FamilyMember { * {@link FamilyMember.Id } * * + * @return + * The value of the id property. */ public List getId() { if (id == null) { - id = new ArrayList(); + id = new ArrayList<>(); } return this.id; } @@ -83,18 +85,18 @@ public List getId() { * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="number" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
-     *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *         
+     *         
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ diff --git a/src/test/generated_resources/element_as_parametrisation_family/ObjectFactory.java b/src/test/generated_resources/element_as_parametrisation_family/ObjectFactory.java index 30ff6e9..b776ad0 100644 --- a/src/test/generated_resources/element_as_parametrisation_family/ObjectFactory.java +++ b/src/test/generated_resources/element_as_parametrisation_family/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link FamilyMember } * + * @return + * the new instance of {@link FamilyMember } */ public FamilyMember createFamilyMember() { return new FamilyMember(); @@ -40,6 +42,8 @@ public FamilyMember createFamilyMember() { /** * Create an instance of {@link Family } * + * @return + * the new instance of {@link Family } */ public Family createFamily() { return new Family(); @@ -48,6 +52,8 @@ public Family createFamily() { /** * Create an instance of {@link FamilyMember.Id } * + * @return + * the new instance of {@link FamilyMember.Id } */ public FamilyMember.Id createFamilyMemberId() { return new FamilyMember.Id(); diff --git a/src/test/generated_resources/element_as_parametrisation_publisher/Article.java b/src/test/generated_resources/element_as_parametrisation_publisher/Article.java index d6837c8..90da809 100644 --- a/src/test/generated_resources/element_as_parametrisation_publisher/Article.java +++ b/src/test/generated_resources/element_as_parametrisation_publisher/Article.java @@ -12,18 +12,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="article">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="author" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/element_as_parametrisation_publisher/Articles.java b/src/test/generated_resources/element_as_parametrisation_publisher/Articles.java index c990ffd..ffec855 100644 --- a/src/test/generated_resources/element_as_parametrisation_publisher/Articles.java +++ b/src/test/generated_resources/element_as_parametrisation_publisher/Articles.java @@ -14,17 +14,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="articles">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="article" type="{}article" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -44,7 +44,7 @@ public class Articles { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the article property. + * This is why there is not a {@code set} method for the article property. * *

* For example, to add a new item, do as follows: @@ -58,10 +58,12 @@ public class Articles { * {@link Article } * * + * @return + * The value of the article property. */ public List

getArticle() { if (article == null) { - article = new ArrayList
(); + article = new ArrayList<>(); } return this.article; } diff --git a/src/test/generated_resources/element_as_parametrisation_publisher/ArticlesCollections.java b/src/test/generated_resources/element_as_parametrisation_publisher/ArticlesCollections.java index 14126dc..ef486db 100644 --- a/src/test/generated_resources/element_as_parametrisation_publisher/ArticlesCollections.java +++ b/src/test/generated_resources/element_as_parametrisation_publisher/ArticlesCollections.java @@ -14,17 +14,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="articles-collections">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="articles" type="{}articles" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -35,7 +35,7 @@ public class ArticlesCollections { @XmlElement(required = true) - protected List articles = new Vector(); + protected List articles = new Vector<>(); /** * Gets the value of the articles property. @@ -44,7 +44,7 @@ public class ArticlesCollections { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the articles property. + * This is why there is not a {@code set} method for the articles property. * *

* For example, to add a new item, do as follows: @@ -58,10 +58,12 @@ public class ArticlesCollections { * {@link Articles } * * + * @return + * The value of the articles property. */ public List getArticles() { if (articles == null) { - articles = new Vector(); + articles = new Vector<>(); } return this.articles; } diff --git a/src/test/generated_resources/element_as_parametrisation_publisher/ObjectFactory.java b/src/test/generated_resources/element_as_parametrisation_publisher/ObjectFactory.java index 2153333..6cb68a3 100644 --- a/src/test/generated_resources/element_as_parametrisation_publisher/ObjectFactory.java +++ b/src/test/generated_resources/element_as_parametrisation_publisher/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Article } * + * @return + * the new instance of {@link Article } */ public Article createArticle() { return new Article(); @@ -40,6 +42,8 @@ public Article createArticle() { /** * Create an instance of {@link Articles } * + * @return + * the new instance of {@link Articles } */ public Articles createArticles() { return new Articles(); @@ -48,6 +52,8 @@ public Articles createArticles() { /** * Create an instance of {@link ArticlesCollections } * + * @return + * the new instance of {@link ArticlesCollections } */ public ArticlesCollections createArticlesCollections() { return new ArticlesCollections(); @@ -56,6 +62,8 @@ public ArticlesCollections createArticlesCollections() { /** * Create an instance of {@link Publisher } * + * @return + * the new instance of {@link Publisher } */ public Publisher createPublisher() { return new Publisher(); diff --git a/src/test/generated_resources/element_as_parametrisation_publisher/Publisher.java b/src/test/generated_resources/element_as_parametrisation_publisher/Publisher.java index fefc97a..f8c30ee 100644 --- a/src/test/generated_resources/element_as_parametrisation_publisher/Publisher.java +++ b/src/test/generated_resources/element_as_parametrisation_publisher/Publisher.java @@ -15,17 +15,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="publisher">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="articles" type="{}articles"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -37,7 +37,7 @@ public class Publisher { @XmlElementWrapper(required = true) @XmlElement(name = "article") - protected List
articles = new ArrayList
(); + protected List
articles = new ArrayList<>(); public List
getArticles() { return articles; diff --git a/src/test/generated_resources/element_list_extended/Foo.java b/src/test/generated_resources/element_list_extended/Foo.java index 4af7355..e39989d 100644 --- a/src/test/generated_resources/element_list_extended/Foo.java +++ b/src/test/generated_resources/element_list_extended/Foo.java @@ -17,35 +17,35 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="bar">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="e" maxOccurs="unbounded" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                     
+ *                       
+ *                         
+ *                           
+ *                         
+ *                       
+ *                     
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -58,7 +58,7 @@ public class Foo { @XmlElementWrapper(name = "bar", required = true) @XmlElement(name = "e") - protected Set bars = new HashSet(); + protected Set bars = new HashSet<>(); public Set getBars() { return bars; @@ -74,15 +74,15 @@ public void setBars(Set bars) { * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ diff --git a/src/test/generated_resources/element_list_extended/ObjectFactory.java b/src/test/generated_resources/element_list_extended/ObjectFactory.java index 46ba9c9..f4a7487 100644 --- a/src/test/generated_resources/element_list_extended/ObjectFactory.java +++ b/src/test/generated_resources/element_list_extended/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Foo } * + * @return + * the new instance of {@link Foo } */ public Foo createFoo() { return new Foo(); @@ -40,6 +42,8 @@ public Foo createFoo() { /** * Create an instance of {@link Foo.E } * + * @return + * the new instance of {@link Foo.E } */ public Foo.E createFooE() { return new Foo.E(); diff --git a/src/test/generated_resources/element_mixed/AnyText.java b/src/test/generated_resources/element_mixed/AnyText.java index 675a4f2..071201e 100644 --- a/src/test/generated_resources/element_mixed/AnyText.java +++ b/src/test/generated_resources/element_mixed/AnyText.java @@ -22,19 +22,19 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="formatted-text" type="{http://foo.org/}formatted-text"/>
- *         <element name="fixed-text" type="{http://foo.org/}fixed-text"/>
- *         <element name="prefixed-text" type="{http://foo.org/}prefixed-text"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -53,21 +53,21 @@ public class AnyText { @XmlElement(name = "b", type = B.class, namespace = "http://foo.org/"), @XmlElement(name = "br", type = FormattedTextBr.class, namespace = "http://foo.org/") }) - protected List formattedText = new ArrayList(); + protected List formattedText = new ArrayList<>(); @XmlElementWrapper(name = "fixed-text", required = true) @XmlMixed @XmlElementRefs({ @XmlElementRef(name = "title", namespace = "http://foo.org/", type = JAXBElement.class, required = false), @XmlElementRef(name = "year", namespace = "http://foo.org/", type = JAXBElement.class, required = false) }) - protected List fixedText = new ArrayList(); + protected List fixedText = new ArrayList<>(); @XmlElementWrapper(name = "prefixed-text", required = true) @XmlElementRefs({ @XmlElementRef(name = "prefix", namespace = "http://foo.org/", type = JAXBElement.class, required = false), @XmlElementRef(name = "title", namespace = "http://foo.org/", type = JAXBElement.class, required = false), @XmlElementRef(name = "suffix", namespace = "http://foo.org/", type = JAXBElement.class, required = false) }) - protected List> prefixedText = new ArrayList>(); + protected List> prefixedText = new ArrayList<>(); public List getFormattedText() { return formattedText; diff --git a/src/test/generated_resources/element_mixed/B.java b/src/test/generated_resources/element_mixed/B.java index f447e55..c5c0c03 100644 --- a/src/test/generated_resources/element_mixed/B.java +++ b/src/test/generated_resources/element_mixed/B.java @@ -17,17 +17,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="b">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence minOccurs="0">
- *         <element name="i" type="{http://foo.org/}i"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -48,7 +48,7 @@ public class B { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the content property. + * This is why there is not a {@code set} method for the content property. * *

* For example, to add a new item, do as follows: @@ -63,10 +63,12 @@ public class B { * {@link String } * * + * @return + * The value of the content property. */ public List getContent() { if (content == null) { - content = new ArrayList(); + content = new ArrayList<>(); } return this.content; } diff --git a/src/test/generated_resources/element_mixed/Br.java b/src/test/generated_resources/element_mixed/Br.java index 91d4c8f..3aa3964 100644 --- a/src/test/generated_resources/element_mixed/Br.java +++ b/src/test/generated_resources/element_mixed/Br.java @@ -12,15 +12,15 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="br">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <attribute name="mode" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/element_mixed/FormattedTextBr.java b/src/test/generated_resources/element_mixed/FormattedTextBr.java index cfd9033..c0cdbff 100644 --- a/src/test/generated_resources/element_mixed/FormattedTextBr.java +++ b/src/test/generated_resources/element_mixed/FormattedTextBr.java @@ -11,14 +11,14 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/element_mixed/I.java b/src/test/generated_resources/element_mixed/I.java index e6e9dda..2c5dbfe 100644 --- a/src/test/generated_resources/element_mixed/I.java +++ b/src/test/generated_resources/element_mixed/I.java @@ -17,17 +17,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="i">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence minOccurs="0">
- *         <element name="b" type="{http://foo.org/}b"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -48,7 +48,7 @@ public class I { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the content property. + * This is why there is not a {@code set} method for the content property. * *

* For example, to add a new item, do as follows: @@ -63,10 +63,12 @@ public class I { * {@link String } * * + * @return + * The value of the content property. */ public List getContent() { if (content == null) { - content = new ArrayList(); + content = new ArrayList<>(); } return this.content; } diff --git a/src/test/generated_resources/element_mixed/ObjectFactory.java b/src/test/generated_resources/element_mixed/ObjectFactory.java index f55ff5d..4d7d2e7 100644 --- a/src/test/generated_resources/element_mixed/ObjectFactory.java +++ b/src/test/generated_resources/element_mixed/ObjectFactory.java @@ -41,6 +41,8 @@ public ObjectFactory() { /** * Create an instance of {@link AnyText } * + * @return + * the new instance of {@link AnyText } */ public AnyText createAnyText() { return new AnyText(); @@ -49,6 +51,8 @@ public AnyText createAnyText() { /** * Create an instance of {@link B } * + * @return + * the new instance of {@link B } */ public B createB() { return new B(); @@ -57,6 +61,8 @@ public B createB() { /** * Create an instance of {@link I } * + * @return + * the new instance of {@link I } */ public I createI() { return new I(); @@ -65,6 +71,8 @@ public I createI() { /** * Create an instance of {@link Br } * + * @return + * the new instance of {@link Br } */ public Br createBr() { return new Br(); @@ -73,6 +81,8 @@ public Br createBr() { /** * Create an instance of {@link FormattedTextBr } * + * @return + * the new instance of {@link FormattedTextBr } */ public FormattedTextBr createFormattedTextBr() { return new FormattedTextBr(); @@ -88,7 +98,7 @@ public FormattedTextBr createFormattedTextBr() { */ @XmlElementDecl(namespace = "http://foo.org/", name = "b", scope = I.class) public JAXBElement createIB(B value) { - return new JAXBElement(_IB_QNAME, B.class, I.class, value); + return new JAXBElement<>(_IB_QNAME, B.class, I.class, value); } /** @@ -101,27 +111,27 @@ public JAXBElement createIB(B value) { */ @XmlElementDecl(namespace = "http://foo.org/", name = "i", scope = B.class) public JAXBElement createBI(I value) { - return new JAXBElement(_BI_QNAME, I.class, B.class, value); + return new JAXBElement<>(_BI_QNAME, I.class, B.class, value); } @XmlElementDecl(namespace = "http://foo.org/", name = "title", scope = AnyText.class) public JAXBElement createAnyTextTitle(String value) { - return new JAXBElement(new QName("http://foo.org/", "title"), String.class, AnyText.class, value); + return new JAXBElement<>(new QName("http://foo.org/", "title"), String.class, AnyText.class, value); } @XmlElementDecl(namespace = "http://foo.org/", name = "year", scope = AnyText.class) public JAXBElement createAnyTextYear(Integer value) { - return new JAXBElement(new QName("http://foo.org/", "year"), Integer.class, AnyText.class, value); + return new JAXBElement<>(new QName("http://foo.org/", "year"), Integer.class, AnyText.class, value); } @XmlElementDecl(namespace = "http://foo.org/", name = "prefix", scope = AnyText.class) public JAXBElement createAnyTextPrefix(String value) { - return new JAXBElement(new QName("http://foo.org/", "prefix"), String.class, AnyText.class, value); + return new JAXBElement<>(new QName("http://foo.org/", "prefix"), String.class, AnyText.class, value); } @XmlElementDecl(namespace = "http://foo.org/", name = "suffix", scope = AnyText.class) public JAXBElement createAnyTextSuffix(String value) { - return new JAXBElement(new QName("http://foo.org/", "suffix"), String.class, AnyText.class, value); + return new JAXBElement<>(new QName("http://foo.org/", "suffix"), String.class, AnyText.class, value); } } diff --git a/src/test/generated_resources/element_mixed/package-info.java b/src/test/generated_resources/element_mixed/package-info.java index 9ecb253..efd55a9 100644 --- a/src/test/generated_resources/element_mixed/package-info.java +++ b/src/test/generated_resources/element_mixed/package-info.java @@ -1,2 +1,2 @@ -@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://foo.org/", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) -package element_mixed; +@jakarta.xml.bind.annotation.XmlSchema(namespace = "http://foo.org/", elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED) +package element_mixed; diff --git a/src/test/generated_resources/element_name_collision/ObjectFactory.java b/src/test/generated_resources/element_name_collision/ObjectFactory.java index 03def9e..f894a02 100644 --- a/src/test/generated_resources/element_name_collision/ObjectFactory.java +++ b/src/test/generated_resources/element_name_collision/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Root } * + * @return + * the new instance of {@link Root } */ public Root createRoot() { return new Root(); @@ -40,6 +42,8 @@ public Root createRoot() { /** * Create an instance of {@link Root.Action } * + * @return + * the new instance of {@link Root.Action } */ public Root.Action createRootAction() { return new Root.Action(); @@ -48,6 +52,8 @@ public Root.Action createRootAction() { /** * Create an instance of {@link Root.Action.AddItem } * + * @return + * the new instance of {@link Root.Action.AddItem } */ public Root.Action.AddItem createRootActionAddItem() { return new Root.Action.AddItem(); @@ -56,6 +62,8 @@ public Root.Action.AddItem createRootActionAddItem() { /** * Create an instance of {@link Root.Action.Item } * + * @return + * the new instance of {@link Root.Action.Item } */ public Root.Action.Item createRootActionItem() { return new Root.Action.Item(); diff --git a/src/test/generated_resources/element_name_collision/Root.java b/src/test/generated_resources/element_name_collision/Root.java index 74ced9c..e80ff64 100644 --- a/src/test/generated_resources/element_name_collision/Root.java +++ b/src/test/generated_resources/element_name_collision/Root.java @@ -16,70 +16,70 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="action">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <choice>
- *                   <element name="update">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="item" maxOccurs="unbounded" minOccurs="0">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <all>
- *                                       <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                                       <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                                     </all>
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                   <element name="add">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <sequence>
- *                             <element name="item" maxOccurs="unbounded" minOccurs="0">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <all>
- *                                       <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                                       <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                                     </all>
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </sequence>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </choice>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                     
+ *                       
+ *                         
+ *                           
+ *                             
+ *                               
+ *                                 
+ *                                   
+ *                                     
+ *                                       
+ *                                       
+ *                                     
+ *                                   
+ *                                 
+ *                               
+ *                             
+ *                           
+ *                         
+ *                       
+ *                     
+ *                   
+ *                   
+ *                     
+ *                       
+ *                         
+ *                           
+ *                             
+ *                               
+ *                                 
+ *                                   
+ *                                     
+ *                                       
+ *                                       
+ *                                     
+ *                                   
+ *                                 
+ *                               
+ *                             
+ *                           
+ *                         
+ *                       
+ *                     
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -123,60 +123,60 @@ public void setAction(Root.Action value) { * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <choice>
-     *         <element name="update">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <sequence>
-     *                   <element name="item" maxOccurs="unbounded" minOccurs="0">
-     *                     <complexType>
-     *                       <complexContent>
-     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                           <all>
-     *                             <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *                             <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *                           </all>
-     *                         </restriction>
-     *                       </complexContent>
-     *                     </complexType>
-     *                   </element>
-     *                 </sequence>
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *         <element name="add">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <sequence>
-     *                   <element name="item" maxOccurs="unbounded" minOccurs="0">
-     *                     <complexType>
-     *                       <complexContent>
-     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                           <all>
-     *                             <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *                             <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *                           </all>
-     *                         </restriction>
-     *                       </complexContent>
-     *                     </complexType>
-     *                   </element>
-     *                 </sequence>
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </choice>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *         
+     *           
+     *             
+     *               
+     *                 
+     *                   
+     *                     
+     *                       
+     *                         
+     *                           
+     *                             
+     *                             
+     *                           
+     *                         
+     *                       
+     *                     
+     *                   
+     *                 
+     *               
+     *             
+     *           
+     *         
+     *         
+     *           
+     *             
+     *               
+     *                 
+     *                   
+     *                     
+     *                       
+     *                         
+     *                           
+     *                             
+     *                             
+     *                           
+     *                         
+     *                       
+     *                     
+     *                   
+     *                 
+     *               
+     *             
+     *           
+     *         
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ @@ -196,7 +196,7 @@ public static class Action { public List getUpdate() { if (update == null) { - update = new ArrayList(); + update = new ArrayList<>(); } return update; } @@ -207,7 +207,7 @@ public void setUpdate(List update) { public List getAdd() { if (add == null) { - add = new ArrayList(); + add = new ArrayList<>(); } return add; } @@ -222,18 +222,18 @@ public void setAdd(List add) { * *

The following schema fragment specifies the expected content contained within this class. * - *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <all>
-         *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
-         *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
-         *       </all>
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
+ *
{@code
+         * 
+         *   
+         *     
+         *       
+         *         
+         *         
+         *       
+         *     
+         *   
+         * 
+         * }
* * */ @@ -304,18 +304,18 @@ public void setValue(String value) { * *

The following schema fragment specifies the expected content contained within this class. * - *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <all>
-         *         <element name="key" type="{http://www.w3.org/2001/XMLSchema}string"/>
-         *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
-         *       </all>
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
+ *
{@code
+         * 
+         *   
+         *     
+         *       
+         *         
+         *         
+         *       
+         *     
+         *   
+         * 
+         * }
* * */ diff --git a/src/test/generated_resources/element_reserved_word/Class.java b/src/test/generated_resources/element_reserved_word/Class.java index 97a20a5..e3ab627 100644 --- a/src/test/generated_resources/element_reserved_word/Class.java +++ b/src/test/generated_resources/element_reserved_word/Class.java @@ -17,19 +17,19 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="class">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="extends" type="{}types"/>
- *         <element name="implements" type="{}types"/>
- *         <element name="methods" type="{}methods"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -46,16 +46,16 @@ public class Class { @XmlElement(name = "type", type = String.class), @XmlElement(name = "primitive", type = Byte.class) }) - protected List _extends = new ArrayList(); + protected List _extends = new ArrayList<>(); @XmlElementWrapper(name = "implements", required = true) @XmlElements({ @XmlElement(name = "type", type = String.class), @XmlElement(name = "primitive", type = Byte.class) }) - protected List _implements = new ArrayList(); + protected List _implements = new ArrayList<>(); @XmlElementWrapper(required = true) @XmlElement(name = "method") - protected List methods = new ArrayList(); + protected List methods = new ArrayList<>(); public List getExtends() { return _extends; diff --git a/src/test/generated_resources/element_reserved_word/Method.java b/src/test/generated_resources/element_reserved_word/Method.java index 075b6dc..f877202 100644 --- a/src/test/generated_resources/element_reserved_word/Method.java +++ b/src/test/generated_resources/element_reserved_word/Method.java @@ -17,17 +17,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="return" type="{}types"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -42,7 +42,7 @@ public class Method { @XmlElement(name = "type", type = String.class), @XmlElement(name = "primitive", type = Byte.class) }) - protected List _return = new ArrayList(); + protected List _return = new ArrayList<>(); public List getReturn() { return _return; diff --git a/src/test/generated_resources/element_reserved_word/ObjectFactory.java b/src/test/generated_resources/element_reserved_word/ObjectFactory.java index 3803d89..56e89c7 100644 --- a/src/test/generated_resources/element_reserved_word/ObjectFactory.java +++ b/src/test/generated_resources/element_reserved_word/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Class } * + * @return + * the new instance of {@link Class } */ public Class createClass() { return new Class(); @@ -40,6 +42,8 @@ public Class createClass() { /** * Create an instance of {@link Method } * + * @return + * the new instance of {@link Method } */ public Method createMethod() { return new Method(); diff --git a/src/test/generated_resources/element_scoped/ObjectFactory.java b/src/test/generated_resources/element_scoped/ObjectFactory.java index 77b2222..c513f4c 100644 --- a/src/test/generated_resources/element_scoped/ObjectFactory.java +++ b/src/test/generated_resources/element_scoped/ObjectFactory.java @@ -40,6 +40,8 @@ public ObjectFactory() { /** * Create an instance of {@link Return } * + * @return + * the new instance of {@link Return } */ public Return createReturn() { return new Return(); @@ -48,6 +50,8 @@ public Return createReturn() { /** * Create an instance of {@link SearchParameters } * + * @return + * the new instance of {@link SearchParameters } */ public SearchParameters createSearchParameters() { return new SearchParameters(); @@ -63,22 +67,22 @@ public SearchParameters createSearchParameters() { */ @XmlElementDecl(namespace = "http://example.com/extra", name = "age") public JAXBElement createAge(String value) { - return new JAXBElement(_Age_QNAME, String.class, null, value); + return new JAXBElement<>(_Age_QNAME, String.class, null, value); } @XmlElementDecl(namespace = "http://example.com/scope", name = "name", scope = Return.class) public JAXBElement createReturnName(String value) { - return new JAXBElement(new QName("http://example.com/scope", "name"), String.class, Return.class, value); + return new JAXBElement<>(new QName("http://example.com/scope", "name"), String.class, Return.class, value); } @XmlElementDecl(namespace = "http://example.com/scope", name = "age", scope = Return.class) public JAXBElement createReturnAge(String value) { - return new JAXBElement(new QName("http://example.com/scope", "age"), String.class, Return.class, value); + return new JAXBElement<>(new QName("http://example.com/scope", "age"), String.class, Return.class, value); } @XmlElementDecl(namespace = "http://example.com/scope", name = "id", scope = SearchParameters.class) public JAXBElement> createSearchParametersId(List value) { - return new JAXBElement>(new QName("http://example.com/scope", "id"), ((Class) List.class), SearchParameters.class, value); + return new JAXBElement<>(new QName("http://example.com/scope", "id"), ((Class) List.class), SearchParameters.class, value); } } diff --git a/src/test/generated_resources/element_scoped/Return.java b/src/test/generated_resources/element_scoped/Return.java index f9d2a17..4c37925 100644 --- a/src/test/generated_resources/element_scoped/Return.java +++ b/src/test/generated_resources/element_scoped/Return.java @@ -19,30 +19,30 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence minOccurs="0">
- *         <element name="users">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence maxOccurs="unbounded">
- *                   <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element name="age" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element ref="{http://example.com/extra}age"/>
- *         <element name="search-parameters" type="{http://example.com/scope}search-parameters"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -60,7 +60,7 @@ public class Return { @XmlElementRef(name = "name", namespace = "http://example.com/scope", type = JAXBElement.class), @XmlElementRef(name = "age", namespace = "http://example.com/scope", type = JAXBElement.class) }) - protected List> users = new ArrayList>(); + protected List> users = new ArrayList<>(); @XmlElement(namespace = "http://example.com/extra") protected String age; @XmlElement(name = "search-parameters") diff --git a/src/test/generated_resources/element_scoped/SearchParameters.java b/src/test/generated_resources/element_scoped/SearchParameters.java index ff143e3..8cffea8 100644 --- a/src/test/generated_resources/element_scoped/SearchParameters.java +++ b/src/test/generated_resources/element_scoped/SearchParameters.java @@ -16,17 +16,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="search-parameters">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="provider-ids" type="{http://example.com/scope}id-list" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -38,7 +38,7 @@ public class SearchParameters { @XmlElementWrapper(name = "provider-ids") @XmlElementRef(name = "id", namespace = "http://example.com/scope", type = JAXBElement.class) - protected List>> providerIds = new ArrayList>>(); + protected List>> providerIds = new ArrayList<>(); public List>> getProviderIds() { return providerIds; diff --git a/src/test/generated_resources/element_with_adapter/Calendar.java b/src/test/generated_resources/element_with_adapter/Calendar.java index 1fd125e..a540a63 100644 --- a/src/test/generated_resources/element_with_adapter/Calendar.java +++ b/src/test/generated_resources/element_with_adapter/Calendar.java @@ -18,28 +18,28 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="calendar">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="url" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
- *         <element name="appointments" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="appointment" type="{http://www.w3.org/2001/XMLSchema}dateTime" maxOccurs="unbounded"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -56,7 +56,7 @@ public class Calendar { @XmlElementWrapper(name = "appointments") @XmlElement(name = "appointment", type = String.class) @XmlJavaTypeAdapter(Adapter1 .class) - protected Collection itemsAppointed = new ArrayList(); + protected Collection itemsAppointed = new ArrayList<>(); /** * Gets the value of the url property. diff --git a/src/test/generated_resources/element_with_adapter/ObjectFactory.java b/src/test/generated_resources/element_with_adapter/ObjectFactory.java index 400d108..265591d 100644 --- a/src/test/generated_resources/element_with_adapter/ObjectFactory.java +++ b/src/test/generated_resources/element_with_adapter/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Calendar } * + * @return + * the new instance of {@link Calendar } */ public Calendar createCalendar() { return new Calendar(); diff --git a/src/test/generated_resources/element_with_customization/Args.java b/src/test/generated_resources/element_with_customization/Args.java index 25e5de5..f9f6c54 100644 --- a/src/test/generated_resources/element_with_customization/Args.java +++ b/src/test/generated_resources/element_with_customization/Args.java @@ -15,17 +15,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="arg" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -46,7 +46,7 @@ public class Args { * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the arg property. + * This is why there is not a {@code set} method for the arg property. * *

* For example, to add a new item, do as follows: @@ -60,10 +60,12 @@ public class Args { * {@link String } * * + * @return + * The value of the arg property. */ public List getArg() { if (arg == null) { - arg = new ArrayList(); + arg = new ArrayList<>(); } return this.arg; } diff --git a/src/test/generated_resources/element_with_customization/ObjectFactory.java b/src/test/generated_resources/element_with_customization/ObjectFactory.java index f0bde97..75c1535 100644 --- a/src/test/generated_resources/element_with_customization/ObjectFactory.java +++ b/src/test/generated_resources/element_with_customization/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link PostOffice } * + * @return + * the new instance of {@link PostOffice } */ public PostOffice createPostOffice() { return new PostOffice(); @@ -40,6 +42,8 @@ public PostOffice createPostOffice() { /** * Create an instance of {@link Args } * + * @return + * the new instance of {@link Args } */ public Args createArgs() { return new Args(); diff --git a/src/test/generated_resources/element_with_customization/PostOffice.java b/src/test/generated_resources/element_with_customization/PostOffice.java index dd761a2..0f02394 100644 --- a/src/test/generated_resources/element_with_customization/PostOffice.java +++ b/src/test/generated_resources/element_with_customization/PostOffice.java @@ -18,20 +18,20 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element ref="{}type-of-message"/>
- *         <element ref="{}args"/>
- *         <element ref="{}class"/>
- *         <element ref="{}misc" minOccurs="0"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -49,13 +49,13 @@ public class PostOffice { protected Args args; @XmlElementWrapper(name = "class", required = true) @XmlElement(name = "name") - protected Collection classes = new Vector(); + protected Collection classes = new Vector<>(); @XmlElementWrapper(name = "misc") @XmlAnyElement(lax = true) - protected Collection misc = new LinkedList(); + protected Collection misc = new LinkedList<>(); @XmlElementWrapper(name = "type-of-message", required = true) @XmlElement(name = "type") - protected Collection typeOfMessages = new LinkedList(); + protected Collection typeOfMessages = new LinkedList<>(); /** * Gets the value of the args property. diff --git a/src/test/generated_resources/element_with_parent/Alliance.java b/src/test/generated_resources/element_with_parent/Alliance.java index 1839492..4ebe143 100644 --- a/src/test/generated_resources/element_with_parent/Alliance.java +++ b/src/test/generated_resources/element_with_parent/Alliance.java @@ -18,18 +18,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <choice maxOccurs="unbounded">
- *         <element name="organization" type="{}organization"/>
- *         <element name="group" type="{}group"/>
- *       </choice>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -57,7 +57,7 @@ public class Alliance * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the organizationOrGroup property. + * This is why there is not a {@code set} method for the organizationOrGroup property. * *

* For example, to add a new item, do as follows: @@ -72,10 +72,12 @@ public class Alliance * {@link Organization } * * + * @return + * The value of the organizationOrGroup property. */ public List getOrganizationOrGroup() { if (organizationOrGroup == null) { - organizationOrGroup = new ArrayList(); + organizationOrGroup = new ArrayList<>(); } return this.organizationOrGroup; } diff --git a/src/test/generated_resources/element_with_parent/Group.java b/src/test/generated_resources/element_with_parent/Group.java index 22c1719..94d3602 100644 --- a/src/test/generated_resources/element_with_parent/Group.java +++ b/src/test/generated_resources/element_with_parent/Group.java @@ -17,28 +17,28 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="group">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="person" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <all>
- *                   <element name="first-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element name="second-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                 </all>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -65,7 +65,7 @@ public class Group * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the person property. + * This is why there is not a {@code set} method for the person property. * *

* For example, to add a new item, do as follows: @@ -79,10 +79,12 @@ public class Group * {@link Group.Person } * * + * @return + * The value of the person property. */ public List getPerson() { if (person == null) { - person = new ArrayList(); + person = new ArrayList<>(); } return this.person; } @@ -93,18 +95,18 @@ public List getPerson() { * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <all>
-     *         <element name="first-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *         <element name="second-name" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *       </all>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *         
+     *         
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ diff --git a/src/test/generated_resources/element_with_parent/ObjectFactory.java b/src/test/generated_resources/element_with_parent/ObjectFactory.java index 7b28c5a..4f43abe 100644 --- a/src/test/generated_resources/element_with_parent/ObjectFactory.java +++ b/src/test/generated_resources/element_with_parent/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Group } * + * @return + * the new instance of {@link Group } */ public Group createGroup() { return new Group(); @@ -40,6 +42,8 @@ public Group createGroup() { /** * Create an instance of {@link Alliance } * + * @return + * the new instance of {@link Alliance } */ public Alliance createAlliance() { return new Alliance(); @@ -48,6 +52,8 @@ public Alliance createAlliance() { /** * Create an instance of {@link Organization } * + * @return + * the new instance of {@link Organization } */ public Organization createOrganization() { return new Organization(); @@ -56,6 +62,8 @@ public Organization createOrganization() { /** * Create an instance of {@link Group.Person } * + * @return + * the new instance of {@link Group.Person } */ public Group.Person createGroupPerson() { return new Group.Person(); diff --git a/src/test/generated_resources/element_with_parent/Organization.java b/src/test/generated_resources/element_with_parent/Organization.java index b77936c..2a1fed3 100644 --- a/src/test/generated_resources/element_with_parent/Organization.java +++ b/src/test/generated_resources/element_with_parent/Organization.java @@ -15,17 +15,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="organization">
- *   <complexContent>
- *     <extension base="{}group">
- *       <sequence>
- *         <element name="address" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
- *       </sequence>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -49,7 +49,7 @@ public class Organization * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the address property. + * This is why there is not a {@code set} method for the address property. * *

* For example, to add a new item, do as follows: @@ -63,10 +63,12 @@ public class Organization * {@link String } * * + * @return + * The value of the address property. */ public List getAddress() { if (address == null) { - address = new ArrayList(); + address = new ArrayList<>(); } return this.address; } diff --git a/src/test/generated_resources/inner_element/Filesystem.java b/src/test/generated_resources/inner_element/Filesystem.java index 490274b..e4bd07f 100644 --- a/src/test/generated_resources/inner_element/Filesystem.java +++ b/src/test/generated_resources/inner_element/Filesystem.java @@ -17,55 +17,55 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="file-listing">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="file-item" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <all>
- *                             <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                             <element name="size" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *                           </all>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="directory-listing">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="directory-item" maxOccurs="unbounded">
- *                     <simpleType>
- *                       <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *                       </restriction>
- *                     </simpleType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="volumes" type="{}volumes"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                     
+ *                       
+ *                         
+ *                           
+ *                             
+ *                             
+ *                           
+ *                         
+ *                       
+ *                     
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                     
+ *                       
+ *                       
+ *                     
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -151,28 +151,28 @@ public void setDirectoryListing(List directoryListing) { * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <sequence>
-     *         <element name="file-item" maxOccurs="unbounded">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <all>
-     *                   <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *                   <element name="size" type="{http://www.w3.org/2001/XMLSchema}int"/>
-     *                 </all>
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </sequence>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *         
+     *           
+     *             
+     *               
+     *                 
+     *                   
+     *                   
+     *                 
+     *               
+     *             
+     *           
+     *         
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ @@ -195,7 +195,7 @@ public static class FileListing * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the fileItem property. + * This is why there is not a {@code set} method for the fileItem property. * *

* For example, to add a new item, do as follows: @@ -209,10 +209,12 @@ public static class FileListing * {@link Filesystem.FileListing.FileItem } * * + * @return + * The value of the fileItem property. */ public List getFileItem() { if (fileItem == null) { - fileItem = new ArrayList(); + fileItem = new ArrayList<>(); } return this.fileItem; } @@ -223,18 +225,18 @@ public List getFileItem() { * *

The following schema fragment specifies the expected content contained within this class. * - *

-         * <complexType>
-         *   <complexContent>
-         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-         *       <all>
-         *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
-         *         <element name="size" type="{http://www.w3.org/2001/XMLSchema}int"/>
-         *       </all>
-         *     </restriction>
-         *   </complexContent>
-         * </complexType>
-         * 
+ *
{@code
+         * 
+         *   
+         *     
+         *       
+         *         
+         *         
+         *       
+         *     
+         *   
+         * 
+         * }
* * */ diff --git a/src/test/generated_resources/inner_element/ObjectFactory.java b/src/test/generated_resources/inner_element/ObjectFactory.java index 6c53010..bdcac91 100644 --- a/src/test/generated_resources/inner_element/ObjectFactory.java +++ b/src/test/generated_resources/inner_element/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link Filesystem } * + * @return + * the new instance of {@link Filesystem } */ public Filesystem createFilesystem() { return new Filesystem(); @@ -40,6 +42,8 @@ public Filesystem createFilesystem() { /** * Create an instance of {@link Volumes } * + * @return + * the new instance of {@link Volumes } */ public Volumes createVolumes() { return new Volumes(); @@ -48,6 +52,8 @@ public Volumes createVolumes() { /** * Create an instance of {@link Filesystem.FileListing } * + * @return + * the new instance of {@link Filesystem.FileListing } */ public Filesystem.FileListing createFilesystemFileListing() { return new Filesystem.FileListing(); @@ -56,6 +62,8 @@ public Filesystem.FileListing createFilesystemFileListing() { /** * Create an instance of {@link Volumes.Volume } * + * @return + * the new instance of {@link Volumes.Volume } */ public Volumes.Volume createVolumesVolume() { return new Volumes.Volume(); @@ -64,6 +72,8 @@ public Volumes.Volume createVolumesVolume() { /** * Create an instance of {@link Filesystem.FileListing.FileItem } * + * @return + * the new instance of {@link Filesystem.FileListing.FileItem } */ public Filesystem.FileListing.FileItem createFilesystemFileListingFileItem() { return new Filesystem.FileListing.FileItem(); diff --git a/src/test/generated_resources/inner_element/Volumes.java b/src/test/generated_resources/inner_element/Volumes.java index e4db53b..9b9c805 100644 --- a/src/test/generated_resources/inner_element/Volumes.java +++ b/src/test/generated_resources/inner_element/Volumes.java @@ -15,28 +15,28 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="volumes">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="volume" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <all>
- *                   <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                   <element name="capacity" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *                 </all>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -59,7 +59,7 @@ public class Volumes * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the volume property. + * This is why there is not a {@code set} method for the volume property. * *

* For example, to add a new item, do as follows: @@ -73,10 +73,12 @@ public class Volumes * {@link Volumes.Volume } * * + * @return + * The value of the volume property. */ public List getVolume() { if (volume == null) { - volume = new ArrayList(); + volume = new ArrayList<>(); } return this.volume; } @@ -87,18 +89,18 @@ public List getVolume() { * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <all>
-     *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *         <element name="capacity" type="{http://www.w3.org/2001/XMLSchema}int"/>
-     *       </all>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *         
+     *         
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ diff --git a/src/test/generated_resources/inner_element_value_objects/Article.java b/src/test/generated_resources/inner_element_value_objects/Article.java index ed156b2..d172415 100644 --- a/src/test/generated_resources/inner_element_value_objects/Article.java +++ b/src/test/generated_resources/inner_element_value_objects/Article.java @@ -9,18 +9,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="article">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="author" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/inner_element_value_objects/Articles.java b/src/test/generated_resources/inner_element_value_objects/Articles.java index 48e6b67..580e67a 100644 --- a/src/test/generated_resources/inner_element_value_objects/Articles.java +++ b/src/test/generated_resources/inner_element_value_objects/Articles.java @@ -10,17 +10,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="articles">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="article" type="{}article" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -35,7 +35,7 @@ public interface Articles extends Serializable * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the article property. + * This is why there is not a {@code set} method for the article property. * *

* For example, to add a new item, do as follows: @@ -49,6 +49,8 @@ public interface Articles extends Serializable * {@link Article } * * + * @return + * The value of the article property. */ List

getArticle(); diff --git a/src/test/generated_resources/inner_element_value_objects/ArticlesCollections.java b/src/test/generated_resources/inner_element_value_objects/ArticlesCollections.java index ff4d78b..b187bf0 100644 --- a/src/test/generated_resources/inner_element_value_objects/ArticlesCollections.java +++ b/src/test/generated_resources/inner_element_value_objects/ArticlesCollections.java @@ -10,17 +10,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="articles-collections">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="articles" type="{}articles" maxOccurs="unbounded"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -35,7 +35,7 @@ public interface ArticlesCollections extends Serializable * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the Jakarta XML Binding object. - * This is why there is not a set method for the articles property. + * This is why there is not a {@code set} method for the articles property. * *

* For example, to add a new item, do as follows: @@ -49,6 +49,8 @@ public interface ArticlesCollections extends Serializable * {@link Articles } * * + * @return + * The value of the articles property. */ List getArticles(); diff --git a/src/test/generated_resources/inner_element_value_objects/Filesystem.java b/src/test/generated_resources/inner_element_value_objects/Filesystem.java index 839bfdf..87f8006 100644 --- a/src/test/generated_resources/inner_element_value_objects/Filesystem.java +++ b/src/test/generated_resources/inner_element_value_objects/Filesystem.java @@ -10,55 +10,55 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="file-listing">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="file-item" maxOccurs="unbounded">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <all>
- *                             <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *                             <element name="size" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *                           </all>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="directory-listing">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element name="directory-item" maxOccurs="unbounded">
- *                     <simpleType>
- *                       <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *                       </restriction>
- *                     </simpleType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *         <element name="volumes" type="{}volumes"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                     
+ *                       
+ *                         
+ *                           
+ *                             
+ *                             
+ *                           
+ *                         
+ *                       
+ *                     
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                     
+ *                       
+ *                       
+ *                     
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -85,18 +85,18 @@ public interface Filesystem * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <all>
-     *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
-     *         <element name="size" type="{http://www.w3.org/2001/XMLSchema}int"/>
-     *       </all>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *         
+     *         
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ diff --git a/src/test/generated_resources/inner_element_value_objects/ObjectFactory.java b/src/test/generated_resources/inner_element_value_objects/ObjectFactory.java index ba90990..cac63fb 100644 --- a/src/test/generated_resources/inner_element_value_objects/ObjectFactory.java +++ b/src/test/generated_resources/inner_element_value_objects/ObjectFactory.java @@ -39,6 +39,8 @@ public ObjectFactory() { /** * Create an instance of {@link Filesystem } * + * @return + * the new instance of {@link Filesystem } */ public Filesystem createFilesystem() { return new FilesystemImpl(); @@ -47,6 +49,8 @@ public Filesystem createFilesystem() { /** * Create an instance of {@link Article } * + * @return + * the new instance of {@link Article } */ public Article createArticle() { return new ArticleImpl(); @@ -55,6 +59,8 @@ public Article createArticle() { /** * Create an instance of {@link Articles } * + * @return + * the new instance of {@link Articles } */ public Articles createArticles() { return new ArticlesImpl(); @@ -63,6 +69,8 @@ public Articles createArticles() { /** * Create an instance of {@link ArticlesCollections } * + * @return + * the new instance of {@link ArticlesCollections } */ public ArticlesCollections createArticlesCollections() { return new ArticlesCollectionsImpl(); @@ -71,6 +79,8 @@ public ArticlesCollections createArticlesCollections() { /** * Create an instance of {@link Publisher } * + * @return + * the new instance of {@link Publisher } */ public Publisher createPublisher() { return new PublisherImpl(); @@ -79,6 +89,8 @@ public Publisher createPublisher() { /** * Create an instance of {@link Volume } * + * @return + * the new instance of {@link Volume } */ public Volume createVolume() { return new VolumeImpl(); @@ -87,6 +99,8 @@ public Volume createVolume() { /** * Create an instance of {@link Filesystem.FileItem } * + * @return + * the new instance of {@link Filesystem.FileItem } */ public Filesystem.FileItem createFilesystemFileItem() { return new FilesystemImpl.FileItemImpl(); diff --git a/src/test/generated_resources/inner_element_value_objects/Publisher.java b/src/test/generated_resources/inner_element_value_objects/Publisher.java index cf9e5d1..a2bfef0 100644 --- a/src/test/generated_resources/inner_element_value_objects/Publisher.java +++ b/src/test/generated_resources/inner_element_value_objects/Publisher.java @@ -10,17 +10,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="publisher">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="articles" type="{}articles"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/inner_element_value_objects/Volume.java b/src/test/generated_resources/inner_element_value_objects/Volume.java index 19147c4..e0d38cc 100644 --- a/src/test/generated_resources/inner_element_value_objects/Volume.java +++ b/src/test/generated_resources/inner_element_value_objects/Volume.java @@ -9,18 +9,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <all>
- *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="capacity" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *       </all>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/inner_element_value_objects/impl/ArticlesCollectionsImpl.java b/src/test/generated_resources/inner_element_value_objects/impl/ArticlesCollectionsImpl.java index 51b22d5..a55e72e 100644 --- a/src/test/generated_resources/inner_element_value_objects/impl/ArticlesCollectionsImpl.java +++ b/src/test/generated_resources/inner_element_value_objects/impl/ArticlesCollectionsImpl.java @@ -18,11 +18,11 @@ public class ArticlesCollectionsImpl implements ArticlesCollections { @XmlElement(required = true, type = ArticlesImpl.class) - protected List articles = new Vector(); + protected List articles = new Vector<>(); public List getArticles() { if (articles == null) { - articles = new Vector(); + articles = new Vector<>(); } return this.articles; } diff --git a/src/test/generated_resources/inner_element_value_objects/impl/ArticlesImpl.java b/src/test/generated_resources/inner_element_value_objects/impl/ArticlesImpl.java index 90f3183..945613a 100644 --- a/src/test/generated_resources/inner_element_value_objects/impl/ArticlesImpl.java +++ b/src/test/generated_resources/inner_element_value_objects/impl/ArticlesImpl.java @@ -22,7 +22,7 @@ public class ArticlesImpl implements Articles public List
getArticle() { if (article == null) { - article = new ArrayList
(); + article = new ArrayList<>(); } return this.article; } diff --git a/src/test/generated_resources/inner_element_value_objects/impl/FilesystemImpl.java b/src/test/generated_resources/inner_element_value_objects/impl/FilesystemImpl.java index 17267ac..483f26b 100644 --- a/src/test/generated_resources/inner_element_value_objects/impl/FilesystemImpl.java +++ b/src/test/generated_resources/inner_element_value_objects/impl/FilesystemImpl.java @@ -24,13 +24,13 @@ public class FilesystemImpl implements Filesystem @XmlElementWrapper(name = "file-listing", required = true) @XmlElement(name = "file-item", type = FilesystemImpl.FileItemImpl.class) - protected List fileListing = new ArrayList(); + protected List fileListing = new ArrayList<>(); @XmlElementWrapper(name = "directory-listing", required = true) @XmlElement(name = "directory-item", defaultValue = "SPAM") - protected List directoryListing = new ArrayList(); + protected List directoryListing = new ArrayList<>(); @XmlElementWrapper(required = true) @XmlElement(name = "volume", type = VolumeImpl.class) - protected List volumes = new ArrayList(); + protected List volumes = new ArrayList<>(); public List getFileListing() { return fileListing; diff --git a/src/test/generated_resources/inner_element_value_objects/impl/JAXBContextFactory.java b/src/test/generated_resources/inner_element_value_objects/impl/JAXBContextFactory.java index c8f3885..1049c95 100644 --- a/src/test/generated_resources/inner_element_value_objects/impl/JAXBContextFactory.java +++ b/src/test/generated_resources/inner_element_value_objects/impl/JAXBContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at @@ -63,14 +63,14 @@ public class JAXBContextFactory { /** * The JAXB API will invoke this method via reflection */ - public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException { - Class[] r = new Class[classes.length]; + public static JAXBContext createContext( Class[] classes, Map properties ) throws JAXBException { + Class[] r = new Class[classes.length]; boolean modified = false; // find any reference to our 'public' ObjectFactory and // replace that to our 'private' ObjectFactory. for( int i=0; i c = classes[i]; String name = c.getName(); if(name.endsWith(DOT_OBJECT_FACTORY) && !name.endsWith(IMPL_DOT_OBJECT_FACTORY)) { @@ -117,9 +117,9 @@ public static JAXBContext createContext( Class[] classes, Map properties ) throw * The JAXB API will invoke this method via reflection */ public static JAXBContext createContext( String contextPath, - ClassLoader classLoader, Map properties ) throws JAXBException { + ClassLoader classLoader, Map properties ) throws JAXBException { - List classes = new ArrayList(); + List> classes = new ArrayList<>(); StringTokenizer tokens = new StringTokenizer(contextPath,":"); // each package should be pointing to a JAXB RI generated @@ -136,16 +136,17 @@ public static JAXBContext createContext( String contextPath, } // delegate to the JAXB provider in the system - return JAXBContext.newInstance(classes.toArray(new Class[classes.size()]),properties); + return JAXBContext.newInstance(classes.toArray(new Class[0]),properties); } - private static ClassLoader getClassClassLoader(final Class c) { + private static ClassLoader getClassClassLoader(final Class c) { if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<>() { + @Override + public ClassLoader run() { return c.getClassLoader(); } }); diff --git a/src/test/generated_resources/inner_element_value_objects/impl/ObjectFactory.java b/src/test/generated_resources/inner_element_value_objects/impl/ObjectFactory.java index 85804fb..c37f556 100644 --- a/src/test/generated_resources/inner_element_value_objects/impl/ObjectFactory.java +++ b/src/test/generated_resources/inner_element_value_objects/impl/ObjectFactory.java @@ -38,6 +38,8 @@ public ObjectFactory() { /** * Create an instance of {@link Filesystem } * + * @return + * the new instance of {@link Filesystem } */ public FilesystemImpl createFilesystem() { return new FilesystemImpl(); @@ -46,6 +48,8 @@ public FilesystemImpl createFilesystem() { /** * Create an instance of {@link Article } * + * @return + * the new instance of {@link Article } */ public ArticleImpl createArticle() { return new ArticleImpl(); @@ -54,6 +58,8 @@ public ArticleImpl createArticle() { /** * Create an instance of {@link Articles } * + * @return + * the new instance of {@link Articles } */ public ArticlesImpl createArticles() { return new ArticlesImpl(); @@ -62,6 +68,8 @@ public ArticlesImpl createArticles() { /** * Create an instance of {@link ArticlesCollections } * + * @return + * the new instance of {@link ArticlesCollections } */ public ArticlesCollectionsImpl createArticlesCollections() { return new ArticlesCollectionsImpl(); @@ -70,6 +78,8 @@ public ArticlesCollectionsImpl createArticlesCollections() { /** * Create an instance of {@link Publisher } * + * @return + * the new instance of {@link Publisher } */ public PublisherImpl createPublisher() { return new PublisherImpl(); @@ -78,6 +88,8 @@ public PublisherImpl createPublisher() { /** * Create an instance of {@link Volume } * + * @return + * the new instance of {@link Volume } */ public VolumeImpl createVolume() { return new VolumeImpl(); @@ -86,6 +98,8 @@ public VolumeImpl createVolume() { /** * Create an instance of {@link Filesystem.FileItem } * + * @return + * the new instance of {@link Filesystem.FileItem } */ public FilesystemImpl.FileItemImpl createFilesystemFileItem() { return new FilesystemImpl.FileItemImpl(); diff --git a/src/test/generated_resources/inner_element_value_objects/impl/PublisherImpl.java b/src/test/generated_resources/inner_element_value_objects/impl/PublisherImpl.java index 6bb4d66..5f5a0e0 100644 --- a/src/test/generated_resources/inner_element_value_objects/impl/PublisherImpl.java +++ b/src/test/generated_resources/inner_element_value_objects/impl/PublisherImpl.java @@ -20,7 +20,7 @@ public class PublisherImpl implements Publisher @XmlElementWrapper(required = true) @XmlElement(name = "article", type = ArticleImpl.class) - protected List
articles = new ArrayList
(); + protected List
articles = new ArrayList<>(); public List
getArticles() { return articles; diff --git a/src/test/generated_resources/inner_scoped_element/Catalogue.java b/src/test/generated_resources/inner_scoped_element/Catalogue.java index da83bf3..c2d42a3 100644 --- a/src/test/generated_resources/inner_scoped_element/Catalogue.java +++ b/src/test/generated_resources/inner_scoped_element/Catalogue.java @@ -19,48 +19,48 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="stockage_collection">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence minOccurs="0">
- *                   <element name="stockage" maxOccurs="unbounded" minOccurs="0">
- *                     <complexType>
- *                       <complexContent>
- *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                           <all>
- *                             <element name="collection" minOccurs="0">
- *                               <complexType>
- *                                 <complexContent>
- *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                                     <sequence maxOccurs="unbounded" minOccurs="0">
- *                                       <element name="effect" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                                       <element name="term" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *                                     </sequence>
- *                                   </restriction>
- *                                 </complexContent>
- *                               </complexType>
- *                             </element>
- *                           </all>
- *                         </restriction>
- *                       </complexContent>
- *                     </complexType>
- *                   </element>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                     
+ *                       
+ *                         
+ *                           
+ *                             
+ *                               
+ *                                 
+ *                                   
+ *                                     
+ *                                       
+ *                                       
+ *                                     
+ *                                   
+ *                                 
+ *                               
+ *                             
+ *                           
+ *                         
+ *                       
+ *                     
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -73,7 +73,7 @@ public class Catalogue { @XmlElementWrapper(name = "stockage_collection", required = true) @XmlElement(name = "stockage") - protected List stockageCollection = new ArrayList(); + protected List stockageCollection = new ArrayList<>(); public List getStockageCollection() { return stockageCollection; @@ -89,28 +89,28 @@ public void setStockageCollection(List stockageCollection) { * *

The following schema fragment specifies the expected content contained within this class. * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <all>
-     *         <element name="collection" minOccurs="0">
-     *           <complexType>
-     *             <complexContent>
-     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *                 <sequence maxOccurs="unbounded" minOccurs="0">
-     *                   <element name="effect" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
-     *                   <element name="term" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
-     *                 </sequence>
-     *               </restriction>
-     *             </complexContent>
-     *           </complexType>
-     *         </element>
-     *       </all>
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
+ *
{@code
+     * 
+     *   
+     *     
+     *       
+     *         
+     *           
+     *             
+     *               
+     *                 
+     *                   
+     *                   
+     *                 
+     *               
+     *             
+     *           
+     *         
+     *       
+     *     
+     *   
+     * 
+     * }
* * */ @@ -125,7 +125,7 @@ public static class Stockage { @XmlElementRef(name = "effect", type = JAXBElement.class, required = false), @XmlElementRef(name = "term", type = JAXBElement.class, required = false) }) - protected List> collection = new ArrayList>(); + protected List> collection = new ArrayList<>(); public List> getCollection() { return collection; diff --git a/src/test/generated_resources/inner_scoped_element/ObjectFactory.java b/src/test/generated_resources/inner_scoped_element/ObjectFactory.java index 685a398..c79cb2e 100644 --- a/src/test/generated_resources/inner_scoped_element/ObjectFactory.java +++ b/src/test/generated_resources/inner_scoped_element/ObjectFactory.java @@ -37,6 +37,8 @@ public ObjectFactory() { /** * Create an instance of {@link Catalogue } * + * @return + * the new instance of {@link Catalogue } */ public Catalogue createCatalogue() { return new Catalogue(); @@ -45,6 +47,8 @@ public Catalogue createCatalogue() { /** * Create an instance of {@link Catalogue.Stockage } * + * @return + * the new instance of {@link Catalogue.Stockage } */ public Catalogue.Stockage createCatalogueStockage() { return new Catalogue.Stockage(); @@ -52,12 +56,12 @@ public Catalogue.Stockage createCatalogueStockage() { @XmlElementDecl(namespace = "", name = "effect", scope = Catalogue.Stockage.class) public JAXBElement createCatalogueStockageEffect(String value) { - return new JAXBElement(new QName("", "effect"), String.class, Catalogue.Stockage.class, value); + return new JAXBElement<>(new QName("", "effect"), String.class, Catalogue.Stockage.class, value); } @XmlElementDecl(namespace = "", name = "term", scope = Catalogue.Stockage.class) public JAXBElement createCatalogueStockageTerm(String value) { - return new JAXBElement(new QName("", "term"), String.class, Catalogue.Stockage.class, value); + return new JAXBElement<>(new QName("", "term"), String.class, Catalogue.Stockage.class, value); } } diff --git a/src/test/generated_resources/substitution_groups/Address.java b/src/test/generated_resources/substitution_groups/Address.java index 5afaa2e..eff015e 100644 --- a/src/test/generated_resources/substitution_groups/Address.java +++ b/src/test/generated_resources/substitution_groups/Address.java @@ -12,17 +12,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="addressType">
- *   <complexContent>
- *     <extension base="{}contactInfoType">
- *       <sequence>
- *         <element name="street" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/substitution_groups/ContactInfo.java b/src/test/generated_resources/substitution_groups/ContactInfo.java index 3e40f03..f386fd6 100644 --- a/src/test/generated_resources/substitution_groups/ContactInfo.java +++ b/src/test/generated_resources/substitution_groups/ContactInfo.java @@ -12,14 +12,14 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="contactInfoType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/substitution_groups/Customer.java b/src/test/generated_resources/substitution_groups/Customer.java index 587386c..c5be18c 100644 --- a/src/test/generated_resources/substitution_groups/Customer.java +++ b/src/test/generated_resources/substitution_groups/Customer.java @@ -16,27 +16,27 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="customerType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="contact-infos" minOccurs="0">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <sequence>
- *                   <element ref="{}contact-info" maxOccurs="unbounded" minOccurs="0"/>
- *                 </sequence>
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *           
+ *             
+ *               
+ *                 
+ *                   
+ *                 
+ *               
+ *             
+ *           
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -48,7 +48,7 @@ public class Customer { @XmlElementWrapper(name = "contact-infos") @XmlElementRef(name = "contact-info", type = JAXBElement.class, required = false) - protected List> contactInfos = new ArrayList>(); + protected List> contactInfos = new ArrayList<>(); public List> getContactInfos() { return contactInfos; diff --git a/src/test/generated_resources/substitution_groups/ObjectFactory.java b/src/test/generated_resources/substitution_groups/ObjectFactory.java index 6f6781a..9f1eff4 100644 --- a/src/test/generated_resources/substitution_groups/ObjectFactory.java +++ b/src/test/generated_resources/substitution_groups/ObjectFactory.java @@ -39,6 +39,8 @@ public ObjectFactory() { /** * Create an instance of {@link Customer } * + * @return + * the new instance of {@link Customer } */ public Customer createCustomer() { return new Customer(); @@ -47,6 +49,8 @@ public Customer createCustomer() { /** * Create an instance of {@link Address } * + * @return + * the new instance of {@link Address } */ public Address createAddress() { return new Address(); @@ -55,6 +59,8 @@ public Address createAddress() { /** * Create an instance of {@link PhoneNumber } * + * @return + * the new instance of {@link PhoneNumber } */ public PhoneNumber createPhoneNumber() { return new PhoneNumber(); @@ -70,7 +76,7 @@ public PhoneNumber createPhoneNumber() { */ @XmlElementDecl(namespace = "", name = "customer") public JAXBElement createCustomer(Customer value) { - return new JAXBElement(_Customer_QNAME, Customer.class, null, value); + return new JAXBElement<>(_Customer_QNAME, Customer.class, null, value); } /** @@ -83,7 +89,7 @@ public JAXBElement createCustomer(Customer value) { */ @XmlElementDecl(namespace = "", name = "contact-info") public JAXBElement createContactInfo(ContactInfo value) { - return new JAXBElement(_ContactInfo_QNAME, ContactInfo.class, null, value); + return new JAXBElement<>(_ContactInfo_QNAME, ContactInfo.class, null, value); } /** @@ -96,7 +102,7 @@ public JAXBElement createContactInfo(ContactInfo value) { */ @XmlElementDecl(namespace = "", name = "address", substitutionHeadNamespace = "", substitutionHeadName = "contact-info") public JAXBElement
createAddress(Address value) { - return new JAXBElement
(_Address_QNAME, Address.class, null, value); + return new JAXBElement<>(_Address_QNAME, Address.class, null, value); } /** @@ -109,7 +115,7 @@ public JAXBElement
createAddress(Address value) { */ @XmlElementDecl(namespace = "", name = "phone-number", substitutionHeadNamespace = "", substitutionHeadName = "contact-info") public JAXBElement createPhoneNumber(PhoneNumber value) { - return new JAXBElement(_PhoneNumber_QNAME, PhoneNumber.class, null, value); + return new JAXBElement<>(_PhoneNumber_QNAME, PhoneNumber.class, null, value); } } diff --git a/src/test/generated_resources/substitution_groups/PhoneNumber.java b/src/test/generated_resources/substitution_groups/PhoneNumber.java index 67ec011..4a81569 100644 --- a/src/test/generated_resources/substitution_groups/PhoneNumber.java +++ b/src/test/generated_resources/substitution_groups/PhoneNumber.java @@ -12,18 +12,18 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType name="phoneNumberType">
- *   <complexContent>
- *     <extension base="{}contactInfoType">
- *       <sequence>
- *         <element name="area-number" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *         <element name="phone-number" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </extension>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ diff --git a/src/test/generated_resources/unqualified/ObjectFactory.java b/src/test/generated_resources/unqualified/ObjectFactory.java index 978ba1c..efd34c5 100644 --- a/src/test/generated_resources/unqualified/ObjectFactory.java +++ b/src/test/generated_resources/unqualified/ObjectFactory.java @@ -32,6 +32,8 @@ public ObjectFactory() { /** * Create an instance of {@link RootElement } * + * @return + * the new instance of {@link RootElement } */ public RootElement createRootElement() { return new RootElement(); diff --git a/src/test/generated_resources/unqualified/RootElement.java b/src/test/generated_resources/unqualified/RootElement.java index 96e11dd..e608219 100644 --- a/src/test/generated_resources/unqualified/RootElement.java +++ b/src/test/generated_resources/unqualified/RootElement.java @@ -16,17 +16,17 @@ * *

The following schema fragment specifies the expected content contained within this class. * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="stringList" type="{testNamespace}StringListType"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
+ *
{@code
+ * 
+ *   
+ *     
+ *       
+ *         
+ *       
+ *     
+ *   
+ * 
+ * }
* * */ @@ -39,7 +39,7 @@ public class RootElement { @XmlElementWrapper(required = true) @XmlElement(name = "listItem") - protected List stringList = new ArrayList(); + protected List stringList = new ArrayList<>(); public List getStringList() { return stringList;