├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── full-build-9.bat
├── plugin
├── .gitignore
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── jvnet
│ │ │ └── jaxb2_commons
│ │ │ └── plugin
│ │ │ ├── AnnotationTarget.java
│ │ │ ├── annotate
│ │ │ ├── AnnotatePlugin.java
│ │ │ ├── AnnotatingArrayValueVisitor.java
│ │ │ ├── AnnotatingSingleValueVisitor.java
│ │ │ ├── AnnotatingVisitor.java
│ │ │ └── Annotator.java
│ │ │ └── removeannotation
│ │ │ └── RemoveAnnotationPlugin.java
│ └── resources
│ │ └── META-INF
│ │ └── services
│ │ └── com.sun.tools.xjc.Plugin
│ └── test
│ ├── java
│ └── org
│ │ └── jvnet
│ │ └── jaxb2_commons
│ │ └── plugin
│ │ └── annotate
│ │ └── tests
│ │ ├── A.java
│ │ ├── B.java
│ │ ├── D.java
│ │ ├── E.java
│ │ └── F.java
│ └── resources
│ └── schema.xsd
├── pom.xml
├── qrelease.bat
├── samples
├── .gitignore
├── annotate
│ ├── .gitignore
│ ├── pom.xml
│ ├── project-build.xml
│ ├── project-pom.xml
│ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── .placeholder
│ │ └── resources
│ │ │ ├── bindings.xjb
│ │ │ └── schema.xsd
│ │ └── test
│ │ ├── java
│ │ └── .placeholder
│ │ └── resources
│ │ └── .placeholder
├── pom.xml
└── src
│ └── main
│ └── assembly
│ ├── ant-src.xml
│ └── maven-src.xml
└── tests
├── .gitignore
├── annotate
├── .gitignore
├── pom.xml
└── src
│ ├── main
│ └── resources
│ │ ├── bindings.xjb
│ │ └── schema.xsd
│ └── test
│ └── java
│ └── org
│ └── jvnet
│ └── jaxb2_commons
│ └── tests
│ └── annotate
│ └── RunAnnotatePlugin.java
├── annotations
├── .gitignore
├── pom.xml
└── src
│ └── main
│ └── java
│ └── org
│ └── jvnet
│ └── jaxb2_commons
│ └── plugin
│ └── annotate
│ └── tests
│ └── annotations
│ ├── A.java
│ ├── Alpha.java
│ ├── B.java
│ ├── D.java
│ ├── Digits.java
│ ├── E.java
│ ├── F.java
│ └── Marked.java
├── annox
├── .gitignore
├── pom.xml
└── src
│ └── main
│ └── resources
│ ├── binding.xjb
│ └── schema.xsd
├── issues
├── .gitignore
├── pom.xml
└── src
│ ├── main
│ └── resources
│ │ ├── binding.xjb
│ │ ├── class-annotate-target-package.xsd
│ │ ├── class-annotatePackage.xsd
│ │ ├── class.xsd
│ │ ├── element-annotate-target-package.xsd
│ │ ├── element-annotatePackage.xsd
│ │ ├── element.xsd
│ │ ├── enum-annotate-target-enum-fromValue-method.xsd
│ │ ├── enum-annotate-target-enum-value-method.xsd
│ │ ├── enum-annotate-target-package.xsd
│ │ ├── enum-annotateFromValueMethod.xsd
│ │ ├── enum-annotatePackage.xsd
│ │ ├── enum-annotateValueMethod.xsd
│ │ ├── enum-constant-annotate-target-package.xsd
│ │ ├── enum-constant-annotatePackage.xsd
│ │ ├── enum-constant.xsd
│ │ ├── enum.xsd
│ │ ├── field-annotate-target-package.xsd
│ │ ├── field-annotatePackage.xsd
│ │ ├── field.xsd
│ │ ├── org
│ │ └── jvnet
│ │ │ └── jaxb2_commons
│ │ │ └── tests
│ │ │ └── issues
│ │ │ └── Gh24Type.value.xml
│ │ └── schema.xsd
│ └── test
│ ├── java
│ └── org
│ │ └── jvnet
│ │ └── jaxb2_commons
│ │ └── tests
│ │ └── issues
│ │ ├── Gh26Test.java
│ │ ├── Gh36Test.java
│ │ ├── _enum
│ │ ├── annotate
│ │ │ └── target
│ │ │ │ ├── enum_fromValue_method
│ │ │ │ └── IssueGH11AnnotateTargetEnumFromValueMethodTest.java
│ │ │ │ └── enum_value_method
│ │ │ │ └── IssueGH11AnnotateTargetEnumValueMethodTest.java
│ │ ├── annotateEnumFromValueMethod
│ │ │ └── IssueGH11AnnotateEnumFromValueMethodTypeTest.java
│ │ └── annotateEnumValueMethod
│ │ │ └── IssueGH11AnnotateEnumValueMethodTypeTest.java
│ │ └── tests
│ │ ├── Issue1Test.java
│ │ ├── RunIssuesPlugin.java
│ │ └── RunPlugins.java
│ ├── resources
│ └── org
│ │ └── jvnet
│ │ └── jaxb2_commons
│ │ └── tests
│ │ └── issues
│ │ ├── issueJIIB44_0.xml
│ │ ├── issueJIIB44_1.xml
│ │ └── issueJIIB44_2.xml
│ └── samples
│ └── issue16[0].xml
├── one
├── .gitignore
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── jvnet
│ │ │ └── jaxb2_commons
│ │ │ └── tests
│ │ │ └── one
│ │ │ └── CustomBooleanAdapter.java
│ └── resources
│ │ ├── binding.xjb
│ │ └── schema.xsd
│ └── test
│ ├── java
│ └── org
│ │ └── jvnet
│ │ └── jaxb2_commons
│ │ └── tests
│ │ └── one
│ │ ├── JavaTypeExampleTest.java
│ │ └── RunOnePlugin.java
│ └── resources
│ └── log4j.properties
└── pom.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
5 | std
6 | err
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - oraclejdk8
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/highsource/jaxb2-annotate-plugin/1e16849a0ee89f9d921f0164058bbf0a7217d3b2/LICENSE
--------------------------------------------------------------------------------
/full-build-9.bat:
--------------------------------------------------------------------------------
1 | setlocal
2 | echo Setting JAVA_HOME to %JAVA9_HOME%.
3 | set JAVA_HOME=%JAVA9_HOME%
4 | call mvn clean install --fail-at-end -DperformRelease -Pall,sonatype-oss-release
5 | endlocal
--------------------------------------------------------------------------------
/plugin/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .classpath
3 | .project
4 | .settings
5 |
--------------------------------------------------------------------------------
/plugin/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 | org.jvnet.jaxb2_commons
36 | jaxb2-basics-annotate
37 | jar
38 | JAXB2 Annotate Plugin
39 |
40 | org.jvnet.jaxb2_commons
41 | jaxb2-annotate-plugin-project
42 | 1.1.1-SNAPSHOT
43 | ../pom.xml
44 |
45 |
46 |
47 | org.jvnet.jaxb2_commons
48 | jaxb2-basics-tools
49 |
50 |
51 | org.apache.commons
52 | commons-lang3
53 |
54 |
55 | org.jvnet.jaxb2_commons
56 | jaxb2-basics-runtime
57 |
58 |
59 |
60 |
61 | org.glassfish.jaxb
62 | jaxb-xjc
63 | provided
64 |
65 |
66 |
67 | org.jvnet.annox
68 | annox
69 |
70 |
71 |
72 | install
73 |
74 |
75 |
--------------------------------------------------------------------------------
/plugin/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/AnnotatingVisitor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate;
30 |
31 | import org.jvnet.annox.model.XAnnotationFieldVisitor;
32 | import org.jvnet.annox.model.annotation.field.XArrayAnnotationField;
33 | import org.jvnet.annox.model.annotation.field.XSingleAnnotationField;
34 | import org.jvnet.annox.model.annotation.value.XAnnotationValue;
35 |
36 | import com.sun.codemodel.JAnnotationArrayMember;
37 | import com.sun.codemodel.JAnnotationUse;
38 | import com.sun.codemodel.JCodeModel;
39 |
40 | public class AnnotatingVisitor implements
41 | XAnnotationFieldVisitor {
42 |
43 | private final JCodeModel codeModel;
44 | private final JAnnotationUse annotationUse;
45 |
46 | public AnnotatingVisitor(JCodeModel codeModel, JAnnotationUse annotationUse) {
47 | this.codeModel = codeModel;
48 | this.annotationUse = annotationUse;
49 | }
50 |
51 | public JAnnotationUse visitSingleAnnotationField(
52 | XSingleAnnotationField> field) {
53 | final XAnnotationValue> annotationValue = field.getAnnotationValue();
54 | annotationValue.accept(new AnnotatingSingleValueVisitor(this.codeModel,
55 | field.getName(), this.annotationUse));
56 | return this.annotationUse;
57 | }
58 |
59 | public JAnnotationUse visitArrayAnnotationField(
60 | XArrayAnnotationField> field) {
61 |
62 | String fieldName = field.getName();
63 | final JAnnotationArrayMember annotationArrayMember = this.annotationUse
64 | .paramArray(fieldName);
65 |
66 | for (final XAnnotationValue> annotationValue : field
67 | .getAnnotationValues()) {
68 | annotationValue.accept(new AnnotatingArrayValueVisitor(
69 | this.codeModel, annotationArrayMember));
70 | }
71 | return this.annotationUse;
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/plugin/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/Annotator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate;
30 |
31 | import java.util.Collection;
32 |
33 | import org.jvnet.annox.model.XAnnotation;
34 | import org.jvnet.annox.model.XAnnotationFieldVisitor;
35 | import org.jvnet.annox.model.annotation.field.XAnnotationField;
36 |
37 | import com.sun.codemodel.JAnnotatable;
38 | import com.sun.codemodel.JAnnotationUse;
39 | import com.sun.codemodel.JClass;
40 | import com.sun.codemodel.JCodeModel;
41 |
42 | public class Annotator {
43 |
44 | public static final Annotator INSTANCE = new Annotator();
45 |
46 | public void annotate(JCodeModel codeModel, JAnnotatable annotatable,
47 | Collection> xannotations) {
48 | for (final XAnnotation> xannotation : xannotations) {
49 | if (xannotation != null) {
50 | annotate(codeModel, annotatable, xannotation);
51 | }
52 | }
53 | }
54 |
55 | public void annotate(JCodeModel codeModel, JAnnotatable annotatable,
56 | XAnnotation> xannotation) {
57 | final JClass annotationClass = codeModel.ref(xannotation
58 | .getAnnotationClass());
59 | JAnnotationUse annotationUse = null;
60 | for (JAnnotationUse annotation : annotatable.annotations()) {
61 | if (annotationClass.equals(annotation.getAnnotationClass())) {
62 | annotationUse = annotation;
63 | }
64 | }
65 | if (annotationUse == null) {
66 | annotationUse = annotatable.annotate(annotationClass);
67 | }
68 | final XAnnotationFieldVisitor> visitor = createAnnotationFieldVisitor(
69 | codeModel, annotationUse);
70 | for (XAnnotationField> field : xannotation.getFieldsList()) {
71 | field.accept(visitor);
72 | }
73 | }
74 |
75 | protected XAnnotationFieldVisitor> createAnnotationFieldVisitor(
76 | JCodeModel codeModel, final JAnnotationUse annotationUse) {
77 | final XAnnotationFieldVisitor> visitor = new AnnotatingVisitor(
78 | codeModel, annotationUse);
79 | return visitor;
80 | }
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/plugin/src/main/resources/META-INF/services/com.sun.tools.xjc.Plugin:
--------------------------------------------------------------------------------
1 | org.jvnet.jaxb2_commons.plugin.annotate.AnnotatePlugin
2 | org.jvnet.jaxb2_commons.plugin.removeannotation.RemoveAnnotationPlugin
--------------------------------------------------------------------------------
/plugin/src/test/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/A.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | /**
30 | *
31 | */
32 | package org.jvnet.jaxb2_commons.plugin.annotate.tests;
33 |
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 |
37 | @Retention(RetentionPolicy.RUNTIME)
38 | public @interface A {
39 | long longField();
40 |
41 | int intField();
42 |
43 | short shortField();
44 |
45 | char charField();
46 |
47 | byte byteField();
48 |
49 | double doubleField();
50 |
51 | float floatField();
52 |
53 | boolean booleanField();
54 |
55 | String stringField();
56 |
57 | E enumField();
58 |
59 | Class> classField();
60 |
61 | Class> anotherClassField() default String.class;
62 |
63 | B annotationField();
64 | }
--------------------------------------------------------------------------------
/plugin/src/test/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/B.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | /**
30 | *
31 | */
32 | package org.jvnet.jaxb2_commons.plugin.annotate.tests;
33 |
34 | import java.lang.annotation.Retention;
35 | import java.lang.annotation.RetentionPolicy;
36 |
37 | @Retention(RetentionPolicy.RUNTIME)
38 | public @interface B {
39 |
40 | long[] longArrayField();
41 |
42 | int[] intArrayField();
43 |
44 | short[] shortArrayField();
45 |
46 | char[] charArrayField();
47 |
48 | byte[] byteArrayField();
49 |
50 | double[] doubleArrayField();
51 |
52 | float[] floatArrayField();
53 |
54 | boolean[] booleanArrayField();
55 |
56 | String[] stringArrayField();
57 |
58 | E[] enumArrayField();
59 |
60 | Class>[] classArrayField();
61 |
62 | Class>[] anotherClassArrayField() default { String.class, Boolean.class };
63 |
64 | B.C[] annotationArrayField();
65 |
66 | @Retention(RetentionPolicy.RUNTIME)
67 | public static @interface C {
68 | }
69 | }
--------------------------------------------------------------------------------
/plugin/src/test/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/D.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface D {
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/plugin/src/test/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/E.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | /**
30 | *
31 | */
32 | package org.jvnet.jaxb2_commons.plugin.annotate.tests;
33 |
34 | public enum E {
35 |
36 | ONE, TWO, THREE, FOUR;
37 |
38 | }
--------------------------------------------------------------------------------
/plugin/src/test/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/F.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface F {
36 | String value();
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/qrelease.bat:
--------------------------------------------------------------------------------
1 | @REM
2 | @REM Copyright © 2005-2015, Alexey Valikov
3 | @REM All rights reserved.
4 | @REM
5 | @REM Redistribution and use in source and binary forms, with or without
6 | @REM modification, are permitted provided that the following conditions are met:
7 | @REM
8 | @REM 1. Redistributions of source code must retain the above copyright notice, this
9 | @REM list of conditions and the following disclaimer.
10 | @REM 2. Redistributions in binary form must reproduce the above copyright notice,
11 | @REM this list of conditions and the following disclaimer in the documentation
12 | @REM and/or other materials provided with the distribution.
13 | @REM
14 | @REM THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | @REM ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | @REM WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | @REM DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | @REM ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | @REM (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | @REM LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | @REM ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | @REM (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | @REM SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | @REM
25 | @REM The views and conclusions contained in the software and documentation are those
26 | @REM of the authors and should not be interpreted as representing official policies,
27 | @REM either expressed or implied, of the FreeBSD Project.
28 | @REM
29 |
30 | setlocal
31 | echo Setting JAVA_HOME to %JAVA9_HOME%.
32 | set JAVA_HOME=%JAVA9_HOME%
33 |
34 | echo Performing a full clean build.
35 | rem pause
36 | call mvn clean install -Pall,sonatype-oss-release -DperformRelease
37 | echo Full clean build completed.
38 | rem pause
39 |
40 | echo Setting new version to %1.
41 | rem pause
42 | call mvn versions:set -Pall -DnewVersion=%1
43 | echo Version was set to %1.
44 | rem pause
45 | call mvn versions:commit -Pall
46 | echo Version %1 committed.
47 | rem pause
48 |
49 | echo Performing a full clean build.
50 | rem pause
51 | call mvn clean install -Pall,sonatype-oss-release -DperformRelease
52 | echo Full clean build completed.
53 | rem pause
54 |
55 | echo Checking in version %1.
56 | rem pause
57 | git commit -a -m "Version %1"
58 | echo Version %1 was checked in.
59 | rem pause
60 |
61 | echo Tagging version %1.
62 | rem pause
63 | git tag -a %1 -m "Version %1"
64 | echo Version %1 was tagged.
65 | rem pause
66 |
67 | echo Pushing version %1.
68 | rem pause
69 | git push origin master
70 | git push --tags origin master
71 | echo Version %1 was pushed.
72 | rem pause
73 |
74 | echo Performing full clean deploy.
75 | rem pause
76 | call mvn -DperformRelease -Pall,sonatype-oss-release clean deploy
77 | echo Full clean deploy done.
78 | rem pause
79 |
80 | echo Setting new version to %2.
81 | rem pause
82 | call mvn versions:set -Pall -DnewVersion=%2
83 | echo Version was set to %2.
84 | rem pause
85 | call mvn versions:commit -Pall
86 | echo Version %2 was committed.
87 | rem pause
88 |
89 | echo Performing a full clean build.
90 | rem pause
91 | call mvn clean install -DperformRelease -Pall,sonatype-oss-release
92 | echo Full clean build completed.
93 | rem pause
94 |
95 | echo Checking in version %2.
96 | rem pause
97 | git commit -a -m "Version %2"
98 | echo Version %2 was checked in.
99 | rem pause
100 |
101 | echo Pushing version %2.
102 | rem pause
103 | git push origin master
104 | git push --tags origin master
105 | echo Version %2 was pushed.
106 | rem pause
107 |
108 | endlocal
--------------------------------------------------------------------------------
/samples/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .classpath
3 | .project
4 | .settings
5 |
--------------------------------------------------------------------------------
/samples/annotate/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
5 |
--------------------------------------------------------------------------------
/samples/annotate/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 | org.jvnet.jaxb2_commons
36 | jaxb2-annotate-plugin-sample-annotate
37 | pom
38 | JAXB2 Annotate Plugin - Sample [annotate]
39 |
40 | org.jvnet.jaxb2_commons
41 | jaxb2-annotate-plugin-samples
42 | 1.1.1-SNAPSHOT
43 | ../pom.xml
44 |
45 |
46 |
47 | org.glassfish.jaxb
48 | jaxb-xjc
49 |
50 |
51 | org.jvnet.jaxb2_commons
52 | jaxb2-basics-annotate
53 |
54 |
55 | commons-logging
56 | commons-logging
57 |
58 |
59 | org.jvnet.jaxb2_commons
60 | jaxb2-basics-ant
61 |
62 |
63 | org.apache.logging.log4j
64 | log4j-jcl
65 |
66 |
67 |
68 | org.glassfish.jaxb
69 | jaxb-runtime
70 |
71 |
72 | com.sun.activation
73 | jakarta.activation
74 |
75 |
76 |
77 | org.hibernate
78 | hibernate-search
79 | 4.1.1.Final
80 |
81 |
82 | junit
83 | junit
84 |
85 |
86 |
87 | install
88 |
89 |
90 | maven-assembly-plugin
91 |
92 |
93 | maven-assembly
94 | package
95 |
96 |
97 | ant-assembly
98 | package
99 |
100 |
101 |
102 |
103 | maven-antrun-plugin
104 |
105 |
106 | maven-unpack
107 | pre-integration-test
108 |
109 |
110 | ant-unpack
111 | pre-integration-test
112 |
113 |
114 | ant-integration-test
115 | integration-test
116 |
117 |
118 |
119 |
120 | maven-invoker-plugin
121 |
122 |
123 | maven-integration-test
124 | integration-test
125 |
126 |
127 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/samples/annotate/project-pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 | org.jvnet.jaxb2_commons
36 | jaxb2-annotate-plugin-sample-annotate-maven
37 | ${project.version}
38 | jar
39 | JAXB2 Annotate Plugin - Sample [annotate-maven]
40 |
41 |
42 | org.glassfish.jaxb
43 | jaxb-runtime
44 | ${jaxb.version}
45 | provided
46 |
47 |
48 | org.hibernate
49 | hibernate-search
50 | 4.1.1.Final
51 | provided
52 |
53 |
54 |
55 | test
56 |
57 |
58 | org.jvnet.jaxb2.maven2
59 | maven-jaxb2-plugin
60 | ${maven-jaxb2-plugin.version}
61 |
62 |
63 |
64 | generate
65 |
66 |
67 |
68 |
69 | true
70 |
71 | -Xannotate
72 |
73 |
74 |
75 | org.jvnet.jaxb2_commons
76 | jaxb2-basics-annotate
77 | ${project.version}
78 |
79 |
80 |
81 |
82 |
83 | org.hibernate
84 | hibernate-search
85 | 4.1.1.Final
86 |
87 |
88 |
89 |
90 | true
91 | maven-compiler-plugin
92 |
93 | 1.6
94 | 1.6
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/samples/annotate/src/main/java/.placeholder:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/highsource/jaxb2-annotate-plugin/1e16849a0ee89f9d921f0164058bbf0a7217d3b2/samples/annotate/src/main/java/.placeholder
--------------------------------------------------------------------------------
/samples/annotate/src/main/resources/bindings.xjb:
--------------------------------------------------------------------------------
1 |
2 |
32 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | @org.hibernate.search.annotations.Field(store=org.hibernate.search.annotations.Store.COMPRESS)
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/samples/annotate/src/main/resources/schema.xsd:
--------------------------------------------------------------------------------
1 |
31 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/samples/annotate/src/test/java/.placeholder:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/highsource/jaxb2-annotate-plugin/1e16849a0ee89f9d921f0164058bbf0a7217d3b2/samples/annotate/src/test/java/.placeholder
--------------------------------------------------------------------------------
/samples/annotate/src/test/resources/.placeholder:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/highsource/jaxb2-annotate-plugin/1e16849a0ee89f9d921f0164058bbf0a7217d3b2/samples/annotate/src/test/resources/.placeholder
--------------------------------------------------------------------------------
/samples/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 | org.jvnet.jaxb2_commons
36 | jaxb2-annotate-plugin-samples
37 | pom
38 | JAXB2 Annotate Plugin - Samples
39 |
40 | org.jvnet.jaxb2_commons
41 | jaxb2-annotate-plugin-project
42 | 1.1.1-SNAPSHOT
43 | ../pom.xml
44 |
45 |
46 | annotate
47 |
48 |
49 | install
50 |
51 |
52 | maven-assembly-plugin
53 |
54 |
55 | maven-assembly
56 |
57 | none
58 |
59 | single
60 |
61 |
62 |
63 | ../src/main/assembly/maven-src.xml
64 |
65 | \
66 |
67 |
68 |
69 | ant-assembly
70 |
71 | none
72 |
73 | single
74 |
75 |
76 |
77 | ../src/main/assembly/ant-src.xml
78 |
79 | \
80 |
81 |
82 |
83 |
84 |
85 | maven-antrun-plugin
86 |
87 |
88 | maven-unpack
89 |
90 | none
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | run
99 |
100 |
101 |
102 | ant-unpack
103 |
104 | none
105 |
106 |
107 |
108 |
109 |
110 |
111 | run
112 |
113 |
114 |
115 | ant-integration-test
116 |
117 | none
118 |
119 |
120 |
121 |
122 |
123 |
124 | run
125 |
126 |
127 |
128 |
129 |
130 | maven-invoker-plugin
131 |
132 |
133 | maven-integration-test
134 |
135 | none
136 |
137 | run
138 |
139 |
140 | true
141 | ${basedir}/target/test-maven-assembly
142 |
143 |
144 |
145 |
146 |
147 |
148 | org.apache.maven.plugins
149 | maven-deploy-plugin
150 |
151 | true
152 |
153 |
154 |
155 |
156 |
--------------------------------------------------------------------------------
/samples/src/main/assembly/ant-src.xml:
--------------------------------------------------------------------------------
1 |
31 |
32 | ant-src
33 |
34 | zip
35 |
36 |
37 |
38 |
39 | README*
40 | LICENSE*
41 | NOTICE*
42 | build.xml
43 |
44 |
45 |
46 | src
47 |
48 |
49 |
50 |
51 | lib
52 |
53 |
54 |
55 |
56 | ${basedir}/project-build.xml
57 | build.xml
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/samples/src/main/assembly/maven-src.xml:
--------------------------------------------------------------------------------
1 |
31 |
32 | maven-src
33 |
34 | zip
35 |
36 |
37 |
38 |
39 | README*
40 | LICENSE*
41 | NOTICE*
42 |
43 |
44 |
45 | src
46 |
47 |
48 | a
49 |
50 |
51 | b
52 |
53 |
54 |
55 |
56 | ${basedir}/project-pom.xml
57 | pom.xml
58 | true
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/tests/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
--------------------------------------------------------------------------------
/tests/annotate/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
--------------------------------------------------------------------------------
/tests/annotate/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 |
36 | org.jvnet.jaxb2_commons
37 | jaxb2-annotate-plugin-tests
38 | 1.1.1-SNAPSHOT
39 | ../pom.xml
40 |
41 | jaxb2-annotate-plugin-test-annotate
42 | jar
43 | JAXB2 Annotate Plugin - Test [annotate]
44 |
45 |
46 | org.jvnet.jaxb2.maven2
47 | maven-jaxb2-plugin-testing
48 | test
49 |
50 |
51 | org.jvnet.jaxb2_commons
52 | jaxb2-basics-annotate
53 |
54 |
55 |
56 | test
57 |
58 |
59 | org.jvnet.jaxb2.maven2
60 | maven-jaxb2-plugin
61 |
62 | true
63 |
64 | -Xannotate
65 | -Xannotate-defaultFieldTarget=setter
66 |
67 |
68 |
69 | org.jvnet.jaxb2_commons
70 | jaxb2-basics-annotate
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/tests/annotate/src/main/resources/bindings.xjb:
--------------------------------------------------------------------------------
1 |
2 |
32 |
40 |
41 |
42 |
43 |
44 | @javax.xml.bind.annotation.XmlRootElement(name="IssueJIIB39CType")
45 |
46 |
47 | @javax.xml.bind.annotation.XmlAttribute(required=false, name="test")
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/tests/annotate/src/main/resources/schema.xsd:
--------------------------------------------------------------------------------
1 |
31 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @java.lang.SuppressWarnings({"unchecked","rawtypes"})
54 |
55 | @javax.xml.bind.annotation.XmlSchema(
56 | elementFormDefault = javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED,
57 | xmlns = {
58 | @javax.xml.bind.annotation.XmlNs(prefix = "a", namespaceURI = "")
59 | })
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | @java.lang.SuppressWarnings({"unchecked","rawtypes"})
69 | @java.lang.Deprecated
70 | @java.lang.Deprecated
71 | @java.lang.Deprecated
72 | @java.lang.Deprecated
73 | @java.lang.Deprecated
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/tests/annotate/src/test/java/org/jvnet/jaxb2_commons/tests/annotate/RunAnnotatePlugin.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.annotate;
30 |
31 | import java.util.ArrayList;
32 | import java.util.List;
33 |
34 | import org.jvnet.jaxb2.maven2.AbstractXJC2Mojo;
35 | import org.jvnet.jaxb2.maven2.test.RunXJC2Mojo;
36 |
37 | public class RunAnnotatePlugin extends RunXJC2Mojo {
38 |
39 | @Override
40 | protected void configureMojo(AbstractXJC2Mojo mojo) {
41 | super.configureMojo(mojo);
42 | mojo.setExtension(true);
43 | mojo.setForceRegenerate(true);
44 | }
45 |
46 | @Override
47 | public List getArgs() {
48 | final List args = new ArrayList(super.getArgs());
49 | args.add("-Xannotate");
50 | return args;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/tests/annotations/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
--------------------------------------------------------------------------------
/tests/annotations/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 |
36 | org.jvnet.jaxb2_commons
37 | jaxb2-annotate-plugin-tests
38 | 1.1.1-SNAPSHOT
39 | ../pom.xml
40 |
41 | jaxb2-annotate-plugin-test-annotations
42 | jar
43 | JAXB2 Annotate Plugin - Test [annotations]
44 |
45 |
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/A.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface A {
36 | long longField();
37 |
38 | int intField();
39 |
40 | short shortField();
41 |
42 | char charField();
43 |
44 | byte byteField();
45 |
46 | double doubleField();
47 |
48 | float floatField();
49 |
50 | boolean booleanField();
51 |
52 | String stringField();
53 |
54 | E enumField();
55 |
56 | Class> classField();
57 |
58 | Class> anotherClassField() default String.class;
59 |
60 | B annotationField();
61 | }
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/Alpha.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface Alpha {
36 | long longField() default 1;
37 |
38 | int intField() default 2;
39 |
40 | short shortField() default 3;
41 |
42 | char charField() default 'f';
43 |
44 | byte byteField() default 5;
45 |
46 | double doubleField() default 6.0;
47 |
48 | float floatField() default 7.0f;
49 |
50 | boolean booleanField() default true;
51 |
52 | Digits enumField() default Digits.EIGHT;
53 |
54 | String stringField() default "nine";
55 |
56 | @SuppressWarnings("unchecked")
57 | Class classField() default String.class;
58 |
59 | // B annotationField();
60 | }
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/B.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface B {
36 |
37 | long[] longArrayField();
38 |
39 | int[] intArrayField();
40 |
41 | short[] shortArrayField();
42 |
43 | char[] charArrayField();
44 |
45 | byte[] byteArrayField();
46 |
47 | double[] doubleArrayField();
48 |
49 | float[] floatArrayField();
50 |
51 | boolean[] booleanArrayField();
52 |
53 | String[] stringArrayField();
54 |
55 | E[] enumArrayField();
56 |
57 | Class>[] classArrayField();
58 |
59 | Class>[] anotherClassArrayField() default { String.class, Boolean.class };
60 |
61 | B.C[] annotationArrayField();
62 |
63 | @Retention(RetentionPolicy.RUNTIME)
64 | public static @interface C {
65 | }
66 | }
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/D.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface D {
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/Digits.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | public enum Digits {
32 |
33 | ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE;
34 |
35 | }
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/E.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | public enum E {
32 |
33 | ONE, TWO, THREE, FOUR;
34 |
35 | }
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/F.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface F {
36 | String value();
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/tests/annotations/src/main/java/org/jvnet/jaxb2_commons/plugin/annotate/tests/annotations/Marked.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations;
30 |
31 | import java.lang.annotation.Retention;
32 | import java.lang.annotation.RetentionPolicy;
33 |
34 | @Retention(RetentionPolicy.RUNTIME)
35 | public @interface Marked {
36 | String value();
37 | }
38 |
--------------------------------------------------------------------------------
/tests/annox/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
--------------------------------------------------------------------------------
/tests/annox/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 |
36 | org.jvnet.jaxb2_commons
37 | jaxb2-annotate-plugin-tests
38 | 1.1.1-SNAPSHOT
39 | ../pom.xml
40 |
41 | jaxb2-annotate-plugin-test-annox
42 | jar
43 | JAXB2 Annotate Plugin - Test [annox]
44 |
45 |
46 | org.jvnet.jaxb2_commons
47 | jaxb2-annotate-plugin-test-annotations
48 | ${project.version}
49 |
50 |
51 |
52 | test
53 |
54 |
55 | org.jvnet.jaxb2.maven2
56 | maven-jaxb2-plugin
57 |
58 | true
59 |
60 | -Xannotate
61 |
62 |
63 |
64 | org.jvnet.jaxb2_commons
65 | jaxb2-basics-annotate
66 |
67 |
68 | org.jvnet.jaxb2_commons
69 | jaxb2-annotate-plugin-test-annotations
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/tests/annox/src/main/resources/binding.xjb:
--------------------------------------------------------------------------------
1 |
31 |
37 |
38 | jaxb:extensionBindingPrefixes="annox"
39 |
40 |
41 |
42 |
43 |
44 | 0
45 | 3
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/tests/issues/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
--------------------------------------------------------------------------------
/tests/issues/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 |
36 | org.jvnet.jaxb2_commons
37 | jaxb2-annotate-plugin-tests
38 | 1.1.1-SNAPSHOT
39 | ../pom.xml
40 |
41 | jaxb2-annotate-plugin-test-issues
42 | jar
43 | JAXB2 Annotate Plugin - Test [issues]
44 |
45 | 1.0.0
46 |
47 |
48 |
49 | org.jvnet.jaxb2.maven2
50 | maven-jaxb2-plugin-testing
51 | test
52 |
53 |
54 | org.jvnet.jaxb2_commons
55 | jaxb2-basics-annotate
56 |
57 |
58 | org.jvnet.jaxb2_commons
59 | jaxb2-annotate-plugin-test-annotations
60 | ${project.version}
61 |
62 |
63 | com.fasterxml.jackson.core
64 | jackson-annotations
65 | 2.8.6
66 |
67 |
68 |
69 | test
70 |
71 |
72 | org.jvnet.jaxb2.maven2
73 | maven-jaxb2-plugin
74 |
75 | true
76 |
77 | -Xcustomizations
78 | -Xcustomizations-directory=${basedir}/src/main/resources
79 | -Xcustomizations-verbose=true
80 | -Xannotate
81 | -XremoveAnnotation
82 |
83 |
84 |
85 | org.jvnet.jaxb2_commons
86 | jaxb2-basics
87 |
88 |
89 | org.jvnet.jaxb2_commons
90 | jaxb2-basics-annotate
91 |
92 |
93 | com.fasterxml.jackson.core
94 | jackson-annotations
95 |
96 |
97 | org.jvnet.jaxb2_commons
98 | jaxb2-annotate-plugin-test-annotations
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/binding.xjb:
--------------------------------------------------------------------------------
1 |
31 |
38 |
39 |
40 |
41 | @javax.xml.bind.annotation.XmlRootElement("someElement")
42 | @javax.xml.bind.annotation.XmlSchema(elementFormDefault=javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
43 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("XJC")
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | @com.fasterxml.jackson.annotation.JsonView(java.lang.Object.class)
56 |
57 |
58 |
59 |
60 |
61 | @javax.xml.bind.annotation.XmlType(name="gh51TypeNew")
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/class-annotate-target-package.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("class.annotate.target.package")
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/class-annotatePackage.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("class.annotatePackage")
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/class.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate")
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateClass")
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.class")
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.class")
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateClass")
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateProperty.target.class")
107 |
108 |
109 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/element-annotate-target-package.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("element.annotate.target.package")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/element-annotatePackage.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("element.annotatePackage")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/element.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.element")
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateElement")
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-annotate-target-enum-fromValue-method.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.enum-fromValue-method")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-annotate-target-enum-value-method.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.enum-value-method")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-annotate-target-package.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("enum.annotate.target.package")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-annotateFromValueMethod.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateEnumFromValueMethod")
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-annotatePackage.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("enum.annotatePackage")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-annotateValueMethod.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateEnumValueMethod")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-constant-annotate-target-package.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("enumConstant.annotate.target.package")
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-constant-annotatePackage.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("enumConstant.annotatePackage")
56 |
57 |
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum-constant.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate")
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.enumConstant")
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateEnumConstant")
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/enum.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate")
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.enum")
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateEnum")
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotate.target.enum")
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("annotateEnum")
104 |
105 |
106 |
107 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/field-annotate-target-package.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("field.annotate.target.package")
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/field-annotatePackage.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("field.annotatePackage")
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/org/jvnet/jaxb2_commons/tests/issues/Gh24Type.value.xml:
--------------------------------------------------------------------------------
1 |
31 | @org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked("jaxb2-annotate-plugin")
32 |
--------------------------------------------------------------------------------
/tests/issues/src/main/resources/schema.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
35 |
36 |
37 |
38 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/Gh26Test.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues;
30 |
31 | import static org.hamcrest.CoreMatchers.is;
32 | import static org.hamcrest.CoreMatchers.nullValue;
33 | import static org.junit.Assert.assertThat;
34 |
35 | import java.lang.reflect.Field;
36 |
37 | import javax.xml.bind.annotation.XmlElement;
38 |
39 | import org.junit.Test;
40 |
41 | public class Gh26Test {
42 |
43 | @Test
44 | public void fiedlYIsNotAnnotated() throws Exception {
45 |
46 | Field yField = Gh26Type.class.getDeclaredField("y");
47 | assertThat(yField.getAnnotation(XmlElement.class), is(nullValue()));
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/Gh36Test.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues;
30 |
31 | import static org.hamcrest.CoreMatchers.equalTo;
32 | import static org.hamcrest.CoreMatchers.is;
33 | import static org.hamcrest.CoreMatchers.notNullValue;
34 | import static org.junit.Assert.assertThat;
35 |
36 | import java.lang.reflect.Method;
37 |
38 | import org.junit.Test;
39 |
40 | import com.fasterxml.jackson.annotation.JsonView;
41 |
42 | public class Gh36Test {
43 |
44 | @Test
45 | public void getAttrMethodIsCorrectlyAnnotated() throws Exception {
46 |
47 | Method getAttrMethod = Gh36Type.class.getDeclaredMethod("getAttr");
48 | JsonView actualAnnotation = getAttrMethod.getAnnotation(JsonView.class);
49 |
50 | assertThat(actualAnnotation, is(notNullValue()));
51 | assertThat(actualAnnotation.value(), is(equalTo(new Class[]{Object.class})));
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/_enum/annotate/target/enum_fromValue_method/IssueGH11AnnotateTargetEnumFromValueMethodTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues._enum.annotate.target.enum_fromValue_method;
30 |
31 | import static org.hamcrest.CoreMatchers.equalTo;
32 | import static org.hamcrest.CoreMatchers.is;
33 | import static org.hamcrest.CoreMatchers.notNullValue;
34 | import static org.junit.Assert.assertThat;
35 |
36 | import java.lang.reflect.Method;
37 |
38 | import org.junit.Test;
39 | import org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked;
40 |
41 | public class IssueGH11AnnotateTargetEnumFromValueMethodTest {
42 |
43 | @Test
44 | public void fromValueMethodShouldBeAnnotated() throws Exception {
45 | String expectedValue = "annotate.target.enum-fromValue-method";
46 |
47 | Method fromValueMethod = IssueGH11AnnotateTargetEnumFromValueMethodType.class.getDeclaredMethod("fromValue", String.class);
48 | Marked actualAnnotation = fromValueMethod.getAnnotation(Marked.class);
49 |
50 | assertThat(actualAnnotation, is(notNullValue()));
51 | assertThat(actualAnnotation.value(), is(equalTo(expectedValue)));
52 | }
53 | }
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/_enum/annotate/target/enum_value_method/IssueGH11AnnotateTargetEnumValueMethodTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues._enum.annotate.target.enum_value_method;
30 |
31 | import static org.hamcrest.CoreMatchers.equalTo;
32 | import static org.hamcrest.CoreMatchers.is;
33 | import static org.hamcrest.CoreMatchers.notNullValue;
34 | import static org.junit.Assert.assertThat;
35 |
36 | import java.lang.reflect.Method;
37 |
38 | import org.junit.Test;
39 | import org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked;
40 |
41 | public class IssueGH11AnnotateTargetEnumValueMethodTest {
42 |
43 | @Test
44 | public void valueMethodShouldBeAnnotated() throws Exception {
45 | String expectedValue = "annotate.target.enum-value-method";
46 |
47 | Method valueMethod = IssueGH11AnnotateTargetEnumValueMethodType.class.getDeclaredMethod("value");
48 | Marked actualAnnotation = valueMethod.getAnnotation(Marked.class);
49 |
50 | assertThat(actualAnnotation, is(notNullValue()));
51 | assertThat(actualAnnotation.value(), is(equalTo(expectedValue)));
52 | }
53 | }
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/_enum/annotateEnumFromValueMethod/IssueGH11AnnotateEnumFromValueMethodTypeTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues._enum.annotateEnumFromValueMethod;
30 |
31 | import static org.hamcrest.CoreMatchers.equalTo;
32 | import static org.hamcrest.CoreMatchers.is;
33 | import static org.hamcrest.CoreMatchers.notNullValue;
34 | import static org.junit.Assert.assertThat;
35 |
36 | import java.lang.reflect.Method;
37 |
38 | import org.junit.Test;
39 | import org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked;
40 |
41 | public class IssueGH11AnnotateEnumFromValueMethodTypeTest {
42 |
43 | @Test
44 | public void fromValueMethodShouldBeAnnotated() throws Exception {
45 | String expectedValue = "annotateEnumFromValueMethod";
46 |
47 | Method fromValueMethod = IssueGH11AnnotateEnumFromValueMethodType.class.getDeclaredMethod("fromValue", String.class);
48 | Marked actualAnnotation = fromValueMethod.getAnnotation(Marked.class);
49 |
50 | assertThat(actualAnnotation, is(notNullValue()));
51 | assertThat(actualAnnotation.value(), is(equalTo(expectedValue)));
52 | }
53 | }
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/_enum/annotateEnumValueMethod/IssueGH11AnnotateEnumValueMethodTypeTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues._enum.annotateEnumValueMethod;
30 |
31 | import static org.hamcrest.CoreMatchers.equalTo;
32 | import static org.hamcrest.CoreMatchers.is;
33 | import static org.hamcrest.CoreMatchers.notNullValue;
34 | import static org.junit.Assert.assertThat;
35 |
36 | import java.lang.reflect.Method;
37 |
38 | import org.junit.Test;
39 | import org.jvnet.jaxb2_commons.plugin.annotate.tests.annotations.Marked;
40 |
41 | public class IssueGH11AnnotateEnumValueMethodTypeTest {
42 |
43 | @Test
44 | public void valueMethodShouldBeAnnotated() throws Exception {
45 | String expectedValue = "annotateEnumValueMethod";
46 |
47 | Method valueMethod = IssueGH11AnnotateEnumValueMethodType.class.getDeclaredMethod("value");
48 | Marked actualAnnotation = valueMethod.getAnnotation(Marked.class);
49 |
50 | assertThat(actualAnnotation, is(notNullValue()));
51 | assertThat(actualAnnotation.value(), is(equalTo(expectedValue)));
52 | }
53 | }
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/tests/Issue1Test.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues.tests;
30 |
31 | import javax.xml.bind.annotation.XmlNsForm;
32 | import javax.xml.bind.annotation.XmlSchema;
33 |
34 | import org.junit.Assert;
35 | import org.junit.Test;
36 | import org.jvnet.jaxb2_commons.tests.issues.ObjectFactory;
37 |
38 | public class Issue1Test {
39 |
40 | @Test
41 | public void testPackageInfoIsAnnotated() {
42 | final XmlSchema xmlSchema = ObjectFactory.class.getPackage()
43 | .getAnnotation(XmlSchema.class);
44 | Assert.assertEquals(XmlNsForm.QUALIFIED, xmlSchema.elementFormDefault());
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/tests/RunIssuesPlugin.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues.tests;
30 |
31 | import java.util.ArrayList;
32 | import java.util.List;
33 |
34 | import org.jvnet.jaxb2.maven2.AbstractXJC2Mojo;
35 | import org.jvnet.jaxb2.maven2.test.RunXJC2Mojo;
36 |
37 | public class RunIssuesPlugin extends RunXJC2Mojo {
38 |
39 | @Override
40 | protected void configureMojo(AbstractXJC2Mojo mojo) {
41 | super.configureMojo(mojo);
42 | mojo.setExtension(true);
43 | mojo.setForceRegenerate(true);
44 | }
45 |
46 | @Override
47 | public List getArgs() {
48 | final List args = new ArrayList(super.getArgs());
49 | args.add("-Xannotate");
50 | return args;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/tests/issues/src/test/java/org/jvnet/jaxb2_commons/tests/issues/tests/RunPlugins.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.issues.tests;
30 |
31 | import java.io.File;
32 |
33 | import org.junit.Before;
34 | import org.junit.Test;
35 |
36 | import com.sun.codemodel.JCodeModel;
37 | import com.sun.tools.xjc.ConsoleErrorReporter;
38 | import com.sun.tools.xjc.ModelLoader;
39 | import com.sun.tools.xjc.Options;
40 | import com.sun.tools.xjc.model.Model;
41 |
42 | public class RunPlugins {
43 |
44 | @Before
45 | public void setUp() {
46 | System.setProperty("javax.xml.accessExternalSchema", "all");
47 | }
48 |
49 | @Test
50 | public void compilesSchema() throws Exception {
51 |
52 | new File("target/generated-sources/xjc").mkdirs();
53 |
54 | String schemaDirectory = new File(getClass().getResource("/schema.xsd")
55 | .toURI()).getParentFile().getAbsolutePath();
56 | String bindingDirectory = new File(getClass().getResource(
57 | "/binding.xjb").toURI()).getParentFile().getAbsolutePath();
58 | final String[] arguments = new String[] { "-xmlschema",
59 | schemaDirectory, "-b", bindingDirectory, "-d",
60 | "target/generated-sources/xjc", "-extension", "-Xannotate"
61 |
62 | };
63 |
64 | Options options = new Options();
65 | options.parseArguments(arguments);
66 | ConsoleErrorReporter receiver = new ConsoleErrorReporter();
67 | Model model = ModelLoader.load(options, new JCodeModel(), receiver);
68 | model.generateCode(options, receiver);
69 | com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
70 | model.codeModel.build(cw);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/tests/issues/src/test/resources/org/jvnet/jaxb2_commons/tests/issues/issueJIIB44_0.xml:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/tests/issues/src/test/resources/org/jvnet/jaxb2_commons/tests/issues/issueJIIB44_1.xml:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/tests/issues/src/test/resources/org/jvnet/jaxb2_commons/tests/issues/issueJIIB44_2.xml:
--------------------------------------------------------------------------------
1 |
31 |
32 | a
33 | b
34 | 0
35 | c
36 | 1
37 | 2
38 |
--------------------------------------------------------------------------------
/tests/issues/src/test/samples/issue16[0].xml:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tests/one/.gitignore:
--------------------------------------------------------------------------------
1 | /target
2 | .settings
3 | .project
4 | .classpath
--------------------------------------------------------------------------------
/tests/one/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 |
36 | org.jvnet.jaxb2_commons
37 | jaxb2-annotate-plugin-tests
38 | 1.1.1-SNAPSHOT
39 |
40 | jaxb2-annotate-plugin-test-one
41 | jar
42 | JAXB2 Annotate Plugin - Test [one]
43 |
44 |
45 | org.jvnet.jaxb2.maven2
46 | maven-jaxb2-plugin-testing
47 | test
48 |
49 |
50 | org.jvnet.jaxb2_commons
51 | jaxb2-basics-annotate
52 |
53 |
54 |
55 | test
56 |
57 |
58 | org.jvnet.jaxb2.maven2
59 | maven-jaxb2-plugin
60 |
61 | true
62 |
63 | -Xannotate
64 |
65 |
66 |
67 | org.jvnet.jaxb2_commons
68 | jaxb2-basics-annotate
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/tests/one/src/main/java/org/jvnet/jaxb2_commons/tests/one/CustomBooleanAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.one;
30 |
31 | import javax.xml.bind.annotation.adapters.XmlAdapter;
32 |
33 | public class CustomBooleanAdapter extends XmlAdapter {
34 | @Override
35 | public Boolean unmarshal(String s) {
36 | if("true".equals(s) || "false".equals(s)){
37 | return Boolean.valueOf(s);
38 | }
39 | return null;
40 |
41 | }
42 |
43 | @Override
44 | public String marshal(Boolean c) {
45 | return c == null ? null : c.toString();
46 | }
47 | }
--------------------------------------------------------------------------------
/tests/one/src/main/resources/binding.xjb:
--------------------------------------------------------------------------------
1 |
2 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
48 |
49 |
50 |
51 |
52 |
53 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/tests/one/src/main/resources/schema.xsd:
--------------------------------------------------------------------------------
1 |
2 |
32 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | @javax.xml.bind.annotation.XmlElement(type=java.lang.Boolean.class)
63 | @javax.xml.bind.annotation.XmlSchemaType(name="boolean")
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/tests/one/src/test/java/org/jvnet/jaxb2_commons/tests/one/JavaTypeExampleTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.one;
30 |
31 | import java.io.StringWriter;
32 |
33 | import javax.xml.bind.JAXBContext;
34 | import javax.xml.bind.JAXBElement;
35 | import javax.xml.bind.JAXBException;
36 | import javax.xml.namespace.QName;
37 |
38 | import org.junit.Assert;
39 | import org.junit.Test;
40 |
41 | public class JavaTypeExampleTest {
42 |
43 | @Test
44 | public void rountripsBoolean() throws JAXBException {
45 | final JAXBContext context = JAXBContext
46 | .newInstance(JavaTypeExample.class);
47 |
48 | final JavaTypeExample value = new JavaTypeExample();
49 | value.setCustomBooleanProperty(true);
50 | final StringWriter sw = new StringWriter();
51 | context.createMarshaller().marshal(
52 | new JAXBElement(new QName("test"),
53 | JavaTypeExample.class, value), sw);
54 | Assert.assertTrue(sw.toString().contains(">true<"));
55 | // System.out.println(sw.toString());
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/tests/one/src/test/java/org/jvnet/jaxb2_commons/tests/one/RunOnePlugin.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2005-2015, Alexey Valikov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice, this
9 | * list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright notice,
11 | * this list of conditions and the following disclaimer in the documentation
12 | * and/or other materials provided with the distribution.
13 | *
14 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | *
25 | * The views and conclusions contained in the software and documentation are those
26 | * of the authors and should not be interpreted as representing official policies,
27 | * either expressed or implied, of the FreeBSD Project.
28 | */
29 | package org.jvnet.jaxb2_commons.tests.one;
30 |
31 | import java.util.ArrayList;
32 | import java.util.List;
33 |
34 | import org.jvnet.jaxb2.maven2.AbstractXJC2Mojo;
35 | import org.jvnet.jaxb2.maven2.test.RunXJC2Mojo;
36 |
37 | public class RunOnePlugin extends RunXJC2Mojo {
38 |
39 | @Override
40 | protected void configureMojo(AbstractXJC2Mojo mojo) {
41 | super.configureMojo(mojo);
42 | mojo.setExtension(true);
43 | mojo.setForceRegenerate(true);
44 | mojo.setDebug(false);
45 | }
46 |
47 | @Override
48 | public List getArgs() {
49 | final List args = new ArrayList(super.getArgs());
50 | args.add("-XtoString");
51 | args.add("-Xequals");
52 | args.add("-XhashCode");
53 | args.add("-Xcopyable");
54 | args.add("-Xmergeable");
55 | args.add("-Xinheritance");
56 | args.add("-Xsetters");
57 | args.add("-Xwildcard");
58 | return args;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/tests/one/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright © 2005-2015, Alexey Valikov
3 | # All rights reserved.
4 | #
5 | # Redistribution and use in source and binary forms, with or without
6 | # modification, are permitted provided that the following conditions are met:
7 | #
8 | # 1. Redistributions of source code must retain the above copyright notice, this
9 | # list of conditions and the following disclaimer.
10 | # 2. Redistributions in binary form must reproduce the above copyright notice,
11 | # this list of conditions and the following disclaimer in the documentation
12 | # and/or other materials provided with the distribution.
13 | #
14 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 | #
25 | # The views and conclusions contained in the software and documentation are those
26 | # of the authors and should not be interpreted as representing official policies,
27 | # either expressed or implied, of the FreeBSD Project.
28 | #
29 |
30 | log4j.rootCategory=DEBUG, stdout
31 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
32 | log4j.appender.stdout.target=system.out
33 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
34 | log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
--------------------------------------------------------------------------------
/tests/pom.xml:
--------------------------------------------------------------------------------
1 |
31 |
34 | 4.0.0
35 | org.jvnet.jaxb2_commons
36 | jaxb2-annotate-plugin-tests
37 | pom
38 | JAXB2 Annotate Plugin - Tests
39 |
40 | org.jvnet.jaxb2_commons
41 | jaxb2-annotate-plugin-project
42 | 1.1.1-SNAPSHOT
43 | ../pom.xml
44 |
45 |
46 | annotations
47 | annox
48 | annotate
49 | issues
50 | one
51 |
52 |
53 |
54 | org.glassfish.jaxb
55 | jaxb-core
56 |
57 |
58 | org.jvnet.jaxb2_commons
59 | jaxb2-basics-runtime
60 |
61 |
62 | org.jvnet.jaxb2_commons
63 | jaxb2-basics-testing
64 | test
65 |
66 |
67 |
68 | test
69 |
70 |
71 |
72 | org.jvnet.jaxb2.maven2
73 | maven-jaxb2-plugin
74 |
75 |
76 | generate
77 |
78 | generate
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | org.apache.maven.plugins
88 | maven-deploy-plugin
89 |
90 | true
91 |
92 |
93 |
94 | org.apache.maven.plugins
95 | maven-javadoc-plugin
96 |
97 | true
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------