aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vojtek2014-07-25 08:33:24 (EDT)
committerTomas Kraus2014-07-25 08:49:51 (EDT)
commit306056b9313a2241bbd68341b2910a09466f9e88 (patch)
treeec7e01e0dad7daeea34fef71d429793c3644a391
parent18fd11635e619cca349b95ce8775398f75fa3c92 (diff)
downloadeclipselink.runtime-306056b9313a2241bbd68341b2910a09466f9e88.zip
eclipselink.runtime-306056b9313a2241bbd68341b2910a09466f9e88.tar.gz
eclipselink.runtime-306056b9313a2241bbd68341b2910a09466f9e88.tar.bz2
Bug# 368547 - Introduced new annotation XmlElementNillable with ElementType.TYPE and ElementType.PACKAGE targets.
Annotation with ElementType.TYPE overrides annotation with ElementType.PACKAGE. I have also extended annotation XmlNullPolicy to target ElementType.TYPE and ElementType.PACKAGE. I think it makes sense and its purpose and behavior is different than XmlElementNillable annotation. Purpose of XmlElementNillable is to extend standard XmlElement annotation with targets ElementType.TYPE and ElementType.PACKAGE. New xsd schema eclipselink_oxm_2.6.xsd introduced, which contains new xml elements xml-element-nillable and xml-null-policy. Signed-off-by: Martin Vojtek <martin.vojtek@oracle.com>
-rw-r--r--foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlElementNillable.java42
-rw-r--r--foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlNullPolicy.java24
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/nillable_field.xml7
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillablepackage/nillable_package.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/nillable_type.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/root_override.xml6
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillablepackage/nillable_package.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/nillable_type.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/root_override.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/eclipselink-oxm.xml4
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package_root_override_control.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/eclipselink-oxm.xml4
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/nillable_package.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/eclipselink-oxm.xml4
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/package_type_override_control.xml6
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/eclipselink-oxm.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/type_root_control.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/eclipselink-oxm.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/type_root_override_control.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/eclipselink-oxm.xml4
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package_root_override_control.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/eclipselink-oxm.xml4
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/nillable_package.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/eclipselink-oxm.xml4
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/package_type_override_control.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/eclipselink-oxm.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/type_root_control.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/eclipselink-oxm.xml8
-rw-r--r--moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/type_root_override_control.xml8
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/JAXBTestCases.java51
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/AnnotationsTestSuite.java116
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableFieldLevelOverrideTestCases.java44
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java44
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java44
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java44
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/FieldRoot.java71
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/NillableRoot.java71
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/Root.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/package-info.java16
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/OverrideRoot.java71
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/package-info.java16
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java44
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java44
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java44
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/NillableRoot.java69
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/Root.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/package-info.java14
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/OverrideRoot.java69
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/package-info.java14
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestCases.java24
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestSuite.java118
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelOverrideTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageTypeOverrideTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/PackageRootOverride.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package-info.java16
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/Root.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/package-info.java16
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/PackageTypeOverride.java71
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/TypeRoot.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/TypeRootOverride.java71
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelOverrideTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageTypeOverrideTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java61
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/PackageRootOverride.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package-info.java16
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/Root.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/package-info.java16
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/PackageTypeOverride.java71
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/TypeRoot.java68
-rw-r--r--moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/TypeRootOverride.java71
-rw-r--r--moxy/org.eclipse.persistence.moxy/resource/org/eclipse/persistence/jaxb/eclipselink_oxm_2_6.xsd (renamed from moxy/org.eclipse.persistence.moxy/resource/org/eclipse/persistence/jaxb/eclipselink_oxm_2_5.xsd)40
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java203
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/TypeInfo.java155
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XMLProcessor.java304
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XmlNillableInfo.java38
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/JavaType.java147
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlBindings.java129
-rw-r--r--moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlElementNillable.java69
83 files changed, 3386 insertions, 482 deletions
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlElementNillable.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlElementNillable.java
new file mode 100644
index 0000000..960901b
--- /dev/null
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlElementNillable.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.oxm.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <b>Purpose:</b> Provide a means of setting nillable on type and package
+ * level, which is not possible with standard XmlElement annotation.
+ * <p>
+ * Type level annotation overrides package level annotation.
+ * </p>
+ * <p>
+ * Standard XmlElement with nillable attribute overrides the value of
+ * XmlElementNillable annotation.
+ * </p>
+ *
+ * @see javax.xml.bind.annotation.XmlElement
+ */
+@Target({ ElementType.TYPE, ElementType.PACKAGE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface XmlElementNillable {
+
+ /**
+ * (Optional) Customize the element declaration to be nillable.
+ * If nillable() is true, then the JavaBean property is mapped to a XML Schema nillable element declaration.
+ */
+ boolean nillable() default true;
+}
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlNullPolicy.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlNullPolicy.java
index cdda41e..0bc8d54 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlNullPolicy.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/annotations/XmlNullPolicy.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -31,13 +31,13 @@ import java.lang.annotation.Target;
* <li>nullRepresentationForXml - Determines how a null value in the object model is written out
* to XML. </li></ul>
*
- * @see XmlNullPolicy
- * @see XmlMarshalNullRepresentation
- */
-@Target({ElementType.FIELD, ElementType.METHOD})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface XmlNullPolicy {
-
+ * @see XmlNullPolicy
+ * @see XmlMarshalNullRepresentation
+ */
+@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.PACKAGE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface XmlNullPolicy {
+
boolean xsiNilRepresentsNull() default false;
boolean emptyNodeRepresentsNull() default false;
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/nillable_field.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/nillable_field.xml
new file mode 100644
index 0000000..664a3b9
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/nillable_field.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<fieldRoot>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</fieldRoot>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillablepackage/nillable_package.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillablepackage/nillable_package.xml
new file mode 100644
index 0000000..a6157a8
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillablepackage/nillable_package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</root>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/nillable_type.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/nillable_type.xml
new file mode 100644
index 0000000..d6f874d
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/nillable_type.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nillableRoot>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</nillableRoot>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/root_override.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/root_override.xml
new file mode 100644
index 0000000..7f03f0c
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/root_override.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<overrideRoot>
+ <b>B</b>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</overrideRoot>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillablepackage/nillable_package.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillablepackage/nillable_package.xml
new file mode 100644
index 0000000..fd855a5
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillablepackage/nillable_package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <a/>
+ <b>B</b>
+ <c/>
+ <d/>
+ <e/>
+</root>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/nillable_type.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/nillable_type.xml
new file mode 100644
index 0000000..15995b5
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/nillable_type.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nillableRoot>
+ <a/>
+ <b>B</b>
+ <c/>
+ <d/>
+ <e/>
+</nillableRoot>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/root_override.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/root_override.xml
new file mode 100644
index 0000000..bc4bc27
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/root_override.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<overrideRoot>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</overrideRoot>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/eclipselink-oxm.xml
new file mode 100644
index 0000000..01eee93
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/eclipselink-oxm.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packageleveloverride">
+ <xml-element-nillable />
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package_root_override_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package_root_override_control.xml
new file mode 100644
index 0000000..ad91274
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package_root_override_control.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<packageRootOverride>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</packageRootOverride>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/eclipselink-oxm.xml
new file mode 100644
index 0000000..04018b2
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/eclipselink-oxm.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packagetype">
+ <xml-element-nillable nillable="true" />
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/nillable_package.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/nillable_package.xml
new file mode 100644
index 0000000..a6157a8
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/nillable_package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</root>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/eclipselink-oxm.xml
new file mode 100644
index 0000000..2aa31c1
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/eclipselink-oxm.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packagetypeoverride">
+ <xml-element-nillable nillable="true" />
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/package_type_override_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/package_type_override_control.xml
new file mode 100644
index 0000000..a71e762
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/package_type_override_control.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<packageTypeOverride>
+ <b>B</b>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</packageTypeOverride>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/eclipselink-oxm.xml
new file mode 100644
index 0000000..1afae57
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/eclipselink-oxm.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typelevel">
+ <java-types>
+ <java-type name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typelevel.TypeRoot">
+ <xml-element-nillable nillable="true" />
+ </java-type>
+ </java-types>
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/type_root_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/type_root_control.xml
new file mode 100644
index 0000000..3abddc9
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/type_root_control.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typeRoot>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</typeRoot>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/eclipselink-oxm.xml
new file mode 100644
index 0000000..e982984
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/eclipselink-oxm.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typeleveloverride">
+ <java-types>
+ <java-type name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typeleveloverride.TypeRootOverride">
+ <xml-element-nillable nillable="true" />
+ </java-type>
+ </java-types>
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/type_root_override_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/type_root_override_control.xml
new file mode 100644
index 0000000..eeaf8f7
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/type_root_override_control.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typeRootOverride>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</typeRootOverride>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/eclipselink-oxm.xml
new file mode 100644
index 0000000..3599148
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/eclipselink-oxm.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packageleveloverride">
+ <xml-null-policy null-representation-for-xml="XSI_NIL"/>
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package_root_override_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package_root_override_control.xml
new file mode 100644
index 0000000..ad91274
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package_root_override_control.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<packageRootOverride>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</packageRootOverride>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/eclipselink-oxm.xml
new file mode 100644
index 0000000..ecf9e3c
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/eclipselink-oxm.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packagetype">
+ <xml-null-policy null-representation-for-xml="XSI_NIL"/>
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/nillable_package.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/nillable_package.xml
new file mode 100644
index 0000000..a6157a8
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/nillable_package.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<root>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</root>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/eclipselink-oxm.xml
new file mode 100644
index 0000000..cb9bb5a
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/eclipselink-oxm.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packagetypeoverride">
+ <xml-null-policy null-representation-for-xml="XSI_NIL"/>
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/package_type_override_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/package_type_override_control.xml
new file mode 100644
index 0000000..9ee434d
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/package_type_override_control.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<packageTypeOverride>
+ <a/>
+ <b>B</b>
+ <c/>
+ <d/>
+ <e/>
+</packageTypeOverride>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/eclipselink-oxm.xml
new file mode 100644
index 0000000..6cd750a
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/eclipselink-oxm.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typelevel">
+ <java-types>
+ <java-type name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typelevel.TypeRoot">
+ <xml-null-policy null-representation-for-xml="XSI_NIL"/>
+ </java-type>
+ </java-types>
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/type_root_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/type_root_control.xml
new file mode 100644
index 0000000..3abddc9
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/type_root_control.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typeRoot>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</typeRoot>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/eclipselink-oxm.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/eclipselink-oxm.xml
new file mode 100644
index 0000000..bee22dd
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/eclipselink-oxm.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typeleveloverride">
+ <java-types>
+ <java-type name="org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typeleveloverride.TypeRootOverride">
+ <xml-null-policy null-representation-for-xml="XSI_NIL"/>
+ </java-type>
+ </java-types>
+</xml-bindings>
diff --git a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/type_root_override_control.xml b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/type_root_override_control.xml
new file mode 100644
index 0000000..eeaf8f7
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/type_root_override_control.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<typeRootOverride>
+ <a xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <b>B</b>
+ <c xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <d xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+ <e xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
+</typeRootOverride>
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/JAXBTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/JAXBTestCases.java
index a9fbd4b..de11ef2 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/JAXBTestCases.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/JAXBTestCases.java
@@ -1,8 +1,8 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
@@ -57,20 +57,19 @@ import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
-import org.eclipse.persistence.internal.oxm.record.XMLStreamReaderInputSource;
-import org.eclipse.persistence.internal.oxm.record.XMLStreamReaderReader;
-import org.eclipse.persistence.jaxb.JAXBContextFactory;
-import org.eclipse.persistence.jaxb.JAXBUnmarshallerHandler;
-import org.eclipse.persistence.jaxb.JAXBUnmarshaller;
-import org.eclipse.persistence.jaxb.MarshallerProperties;
-import org.eclipse.persistence.jaxb.UnmarshallerProperties;
-import org.eclipse.persistence.jaxb.compiler.CompilerHelper;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings;
-import org.eclipse.persistence.oxm.MediaType;
-import org.eclipse.persistence.oxm.XMLConstants;
-import org.eclipse.persistence.oxm.XMLContext;
-import org.eclipse.persistence.oxm.XMLDescriptor;
-import org.eclipse.persistence.oxm.XMLRoot;
+import org.eclipse.persistence.internal.oxm.record.XMLStreamReaderInputSource;
+import org.eclipse.persistence.internal.oxm.record.XMLStreamReaderReader;
+import org.eclipse.persistence.jaxb.JAXBContextFactory;
+import org.eclipse.persistence.jaxb.JAXBUnmarshaller;
+import org.eclipse.persistence.jaxb.JAXBUnmarshallerHandler;
+import org.eclipse.persistence.jaxb.MarshallerProperties;
+import org.eclipse.persistence.jaxb.UnmarshallerProperties;
+import org.eclipse.persistence.jaxb.compiler.CompilerHelper;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings;
+import org.eclipse.persistence.oxm.MediaType;
+import org.eclipse.persistence.oxm.XMLContext;
+import org.eclipse.persistence.oxm.XMLDescriptor;
+import org.eclipse.persistence.oxm.XMLRoot;
import org.eclipse.persistence.oxm.record.XMLStreamWriterRecord;
import org.eclipse.persistence.platform.xml.SAXDocumentBuilder;
import org.eclipse.persistence.platform.xml.XMLPlatformFactory;
@@ -83,13 +82,13 @@ import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
-
-public abstract class JAXBTestCases extends XMLMappingTestCases {
-
- public static final String ECLIPSELINK_OXM_XSD = "eclipselink_oxm_2_5.xsd";
- protected JAXBContext jaxbContext;
- protected Marshaller jaxbMarshaller;
- protected Unmarshaller jaxbUnmarshaller;
+
+public abstract class JAXBTestCases extends XMLMappingTestCases {
+
+ public static final String ECLIPSELINK_OXM_XSD = "eclipselink_oxm_2_6.xsd";
+ protected JAXBContext jaxbContext;
+ protected Marshaller jaxbMarshaller;
+ protected Unmarshaller jaxbUnmarshaller;
protected Class[] classes;
protected Type[] types;
protected String contextPath;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/AnnotationsTestSuite.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/AnnotationsTestSuite.java
index 398355c..a9f8741 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/AnnotationsTestSuite.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/AnnotationsTestSuite.java
@@ -1,22 +1,29 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 2011, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Blaise Doughan - 2.3 - initial implementation
- ******************************************************************************/
-package org.eclipse.persistence.testing.jaxb.annotations;
-
-import org.eclipse.persistence.testing.jaxb.annotations.xmlaccessmethods.XmlAccessMethodsTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlclassextractor.XmlClassExtractorTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlidref.XmlIdRefMissingIdEventHandlerTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlidref.XmlIdRefMissingIdTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlidref.self.XmlIdRefSelfTestCases;
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.persistence.testing.jaxb.annotations.xmlaccessmethods.XmlAccessMethodsTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlclassextractor.XmlClassExtractorTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.XmlElementNillableFieldLevelOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.XmlElementNillablePackageLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.XmlElementNillableTypeLevelOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.XmlElementNillableTypeLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlidref.XmlIdRefMissingIdEventHandlerTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlidref.XmlIdRefMissingIdTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlidref.self.XmlIdRefSelfTestCases;
import org.eclipse.persistence.testing.jaxb.annotations.xmlinlinebinarydata.InlineHexBinaryTestCases;
import org.eclipse.persistence.testing.jaxb.annotations.xmlinversereference.InverseRefChoiceAdapterTestCases;
import org.eclipse.persistence.testing.jaxb.annotations.xmlinversereference.InverseReferenceAdapterTestCases;
@@ -24,26 +31,28 @@ import org.eclipse.persistence.testing.jaxb.annotations.xmlinversereference.Inve
import org.eclipse.persistence.testing.jaxb.annotations.xmllocation.XmlLocationTestSuite;
import org.eclipse.persistence.testing.jaxb.annotations.xmlnametransformer.JAXBDefaultNameTransformerTestCases;
import org.eclipse.persistence.testing.jaxb.annotations.xmlnametransformer.classlevel.upper.JAXBClassLevelUpperNameTransformerTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlnametransformer.upper.JAXBUpperNameTransformerTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.DefaultNoNodeTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.XmlNullPolicyNoXmlElementTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.XmlNullPolicyTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlpath.predicate.PredicateTestSuite;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlpath.predicate.adapter.CustomerTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlpaths.XmlPathsTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlpaths.override.XmlPathsOverrideTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmlproperty.XmlPropertyTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XMLTransformationNoArgCtorTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XMLTransformationNoArgCtorXMLBindingsTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XmlTransformationMethodTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XmlTransformationTestCases;
-import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.SimpleRootTestCases;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AnnotationsTestSuite extends TestSuite {
-
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnametransformer.upper.JAXBUpperNameTransformerTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.DefaultNoNodeTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.XmlNullPolicyNoXmlElementTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.XmlNullPolicyPackageLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.XmlNullPolicyTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.XmlNullPolicyTypeLevelOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.XmlNullPolicyTypeLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlpath.predicate.PredicateTestSuite;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlpath.predicate.adapter.CustomerTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlpaths.XmlPathsTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlpaths.override.XmlPathsOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlproperty.XmlPropertyTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.SimpleRootTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XMLTransformationNoArgCtorTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XMLTransformationNoArgCtorXMLBindingsTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XmlTransformationMethodTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmltransformation.XmlTransformationTestCases;
+
+
+
+public class AnnotationsTestSuite extends TestSuite {
+
public static Test suite() {
TestSuite suite = new TestSuite("JAXB20 Compiler Test Suite");
@@ -65,23 +74,30 @@ public class AnnotationsTestSuite extends TestSuite {
suite.addTestSuite(XmlPathsTestCases.class);
suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.xmlpath.enumtype.EnumTestCases.class);
suite.addTestSuite(XmlPathsOverrideTestCases.class);
- suite.addTestSuite(XmlNullPolicyTestCases.class);
- suite.addTestSuite(DefaultNoNodeTestCases.class);
- suite.addTestSuite(XmlNullPolicyNoXmlElementTestCases.class);
- suite.addTestSuite(JAXBDefaultNameTransformerTestCases.class);
- suite.addTestSuite(JAXBUpperNameTransformerTestCases.class);
- suite.addTestSuite(JAXBClassLevelUpperNameTransformerTestCases.class);
+ suite.addTestSuite(XmlNullPolicyTestCases.class);
+ suite.addTestSuite(DefaultNoNodeTestCases.class);
+ suite.addTestSuite(XmlNullPolicyNoXmlElementTestCases.class);
+ suite.addTestSuite(XmlNullPolicyPackageLevelTestCases.class);
+ suite.addTestSuite(XmlNullPolicyTypeLevelTestCases.class);
+ suite.addTestSuite(XmlNullPolicyTypeLevelOverrideTestCases.class);
+ suite.addTestSuite(XmlElementNillablePackageLevelTestCases.class);
+ suite.addTestSuite(XmlElementNillableTypeLevelTestCases.class);
+ suite.addTestSuite(XmlElementNillableTypeLevelOverrideTestCases.class);
+ suite.addTestSuite(XmlElementNillableFieldLevelOverrideTestCases.class);
+ suite.addTestSuite(JAXBDefaultNameTransformerTestCases.class);
+ suite.addTestSuite(JAXBUpperNameTransformerTestCases.class);
+ suite.addTestSuite(JAXBClassLevelUpperNameTransformerTestCases.class);
suite.addTestSuite(XmlAccessMethodsTestCases.class);
suite.addTestSuite(XmlClassExtractorTestCases.class);
suite.addTestSuite(XmlPropertyTestCases.class);
suite.addTestSuite(XmlTransformationTestCases.class);
- suite.addTestSuite(XMLTransformationNoArgCtorTestCases.class);
- suite.addTestSuite(XMLTransformationNoArgCtorXMLBindingsTestCases.class);
- suite.addTestSuite(XmlTransformationMethodTestCases.class);
- suite.addTestSuite(SimpleRootTestCases.class);
- suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.xmlcontainerproperty.ContainerPropertyTestCases.class);
- suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.PropertyTypeTestCases.class);
- suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.required.RequiredAnnotationTestCases.class);
+ suite.addTestSuite(XMLTransformationNoArgCtorTestCases.class);
+ suite.addTestSuite(XMLTransformationNoArgCtorXMLBindingsTestCases.class);
+ suite.addTestSuite(XmlTransformationMethodTestCases.class);
+ suite.addTestSuite(SimpleRootTestCases.class);
+ suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.xmlcontainerproperty.ContainerPropertyTestCases.class);
+ suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.PropertyTypeTestCases.class);
+ suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.required.RequiredAnnotationTestCases.class);
suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.xmldiscriminator.XmlDiscriminatorTestCases.class);
suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.xmldiscriminator.ns.XmlDiscriminatorNSTestCases.class);
suite.addTestSuite(org.eclipse.persistence.testing.jaxb.annotations.xmldiscriminator.ns.XmlDiscriminatorRootNSTestCases.class);
@@ -111,7 +127,7 @@ public class AnnotationsTestSuite extends TestSuite {
suite.addTestSuite(InverseReferenceAdapterTestCases.class);
suite.addTestSuite(InverseRefChoiceAdapterTestCases.class);
- return suite;
- }
-
-} \ No newline at end of file
+ return suite;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableFieldLevelOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableFieldLevelOverrideTestCases.java
new file mode 100644
index 0000000..b27516f
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableFieldLevelOverrideTestCases.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable;
+
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.fieldoverride.FieldRoot;
+
+/**
+ * Test demonstrates that XmlElement annotation declared on field overrides XmlElementNillable annotation declared on class level.
+ */
+public class XmlElementNillableFieldLevelOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/nillable_field.xml";
+
+ public XmlElementNillableFieldLevelOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { FieldRoot.class });
+ }
+
+ @Override
+ protected FieldRoot getControlObject() {
+ FieldRoot controlObject = new FieldRoot();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java
new file mode 100644
index 0000000..1b5d6d3
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable;
+
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.packagetype.Root;
+
+/**
+ * Test demonstrates XmlElementNillable annotation declared on package level in package-info.java
+ */
+public class XmlElementNillablePackageLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillablepackage/nillable_package.xml";
+
+ public XmlElementNillablePackageLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { Root.class });
+ }
+
+ @Override
+ protected Root getControlObject() {
+ Root controlObject = new Root();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java
new file mode 100644
index 0000000..33925c6
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable;
+
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.typeleveloverride.OverrideRoot;
+
+/**
+ * Test demonstrates that XmlElement annotation declared on class overrides XmlElementNillable annotation declared on package level.
+ */
+public class XmlElementNillableTypeLevelOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/root_override.xml";
+
+ public XmlElementNillableTypeLevelOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { OverrideRoot.class });
+ }
+
+ @Override
+ protected OverrideRoot getControlObject() {
+ OverrideRoot controlObject = new OverrideRoot();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java
new file mode 100644
index 0000000..90502c2
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable;
+
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.nillabletype.NillableRoot;
+
+/**
+ * Test demonstrates XmlElementNillable annotation declared on class level.
+ */
+public class XmlElementNillableTypeLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/nillable_type.xml";
+
+ public XmlElementNillableTypeLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { NillableRoot.class });
+ }
+
+ @Override
+ protected NillableRoot getControlObject() {
+ NillableRoot controlObject = new NillableRoot();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/FieldRoot.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/FieldRoot.java
new file mode 100644
index 0000000..81da8a3
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/fieldoverride/FieldRoot.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 15/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.fieldoverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
+
+@XmlRootElement
+@XmlElementNillable(nillable = true)
+public class FieldRoot {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = false)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/NillableRoot.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/NillableRoot.java
new file mode 100644
index 0000000..86a877e
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/nillabletype/NillableRoot.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.nillabletype;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
+
+@XmlRootElement
+@XmlElementNillable
+public class NillableRoot {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/Root.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/Root.java
new file mode 100644
index 0000000..ee6732a
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/Root.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.packagetype;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Root {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/package-info.java
new file mode 100644
index 0000000..f7777ea
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/packagetype/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+@XmlElementNillable
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.packagetype;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/OverrideRoot.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/OverrideRoot.java
new file mode 100644
index 0000000..bea3a60
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/OverrideRoot.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.typeleveloverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
+
+@XmlRootElement
+@XmlElementNillable(nillable = false)
+public class OverrideRoot {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/package-info.java
new file mode 100644
index 0000000..ca98461
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlelementnillable/typeleveloverride/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+@XmlElementNillable
+package org.eclipse.persistence.testing.jaxb.annotations.xmlelementnillable.typeleveloverride;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java
new file mode 100644
index 0000000..55ffebc
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy;
+
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.packagetype.Root;
+
+/**
+ * Test demonstrates XmlNullPolicy annotation declared on package level in package-info.java
+ */
+public class XmlNullPolicyPackageLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillablepackage/nillable_package.xml";
+
+ public XmlNullPolicyPackageLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { Root.class });
+ }
+
+ @Override
+ protected Root getControlObject() {
+ Root controlObject = new Root();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java
new file mode 100644
index 0000000..4e6465f
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy;
+
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.typeleveloverride.OverrideRoot;
+
+/**
+ * Test demonstrates that XmlNullPolicy annotation declared on class level overrides XmlNullPolicy annotation declare in package-info.java
+ */
+public class XmlNullPolicyTypeLevelOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/root_override.xml";
+
+ public XmlNullPolicyTypeLevelOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { OverrideRoot.class });
+ }
+
+ @Override
+ protected OverrideRoot getControlObject() {
+ OverrideRoot controlObject = new OverrideRoot();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java
new file mode 100644
index 0000000..83c60de
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy;
+
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.nillabletype.NillableRoot;
+
+/**
+ * Test demonstrates XmlNullPolicy annotation declared on class level.
+ */
+public class XmlNullPolicyTypeLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/nillable_type.xml";
+
+ public XmlNullPolicyTypeLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { NillableRoot.class });
+ }
+
+ @Override
+ protected NillableRoot getControlObject() {
+ NillableRoot controlObject = new NillableRoot();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/NillableRoot.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/NillableRoot.java
new file mode 100644
index 0000000..4dc3c46
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/nillabletype/NillableRoot.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.nillabletype;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@org.eclipse.persistence.oxm.annotations.XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.EMPTY_NODE)
+public class NillableRoot {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/Root.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/Root.java
new file mode 100644
index 0000000..c7e0681
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/Root.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.packagetype;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Root {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/package-info.java
new file mode 100644
index 0000000..93029ac
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/packagetype/package-info.java
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+@org.eclipse.persistence.oxm.annotations.XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.EMPTY_NODE)
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.packagetype;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/OverrideRoot.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/OverrideRoot.java
new file mode 100644
index 0000000..e02a491
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/OverrideRoot.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.typeleveloverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@org.eclipse.persistence.oxm.annotations.XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.XSI_NIL)
+public class OverrideRoot {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/package-info.java
new file mode 100644
index 0000000..f8ade1a
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmlnullpolicy/typeleveloverride/package-info.java
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 7/2014
+ ******************************************************************************/
+@org.eclipse.persistence.oxm.annotations.XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.EMPTY_NODE)
+package org.eclipse.persistence.testing.jaxb.annotations.xmlnullpolicy.typeleveloverride;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestCases.java
index 3e8783f..cd98207 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestCases.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestCases.java
@@ -558,18 +558,18 @@ public class ExternalizedMetadataTestCases extends TestCase {
*/
protected void validateBindingsFileAgainstSchema(InputStream src) {
String result = null;
- SchemaFactory sFact = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
- Schema theSchema;
- try {
- InputStream bindingsFileXSDInputStream = getClass().getClassLoader().getResourceAsStream("eclipselink_oxm_2_5.xsd");
- if (bindingsFileXSDInputStream == null){
- bindingsFileXSDInputStream = getClass().getClassLoader().getResourceAsStream("org/eclipse/persistence/jaxb/eclipselink_oxm_2_5.xsd");
- }
- if (bindingsFileXSDInputStream == null){
- fail("ERROR LOADING eclipselink_oxm_2_4.xsd");
- }
- Source bindingsFileXSDSource = new StreamSource(bindingsFileXSDInputStream);
- theSchema = sFact.newSchema(bindingsFileXSDSource);
+ SchemaFactory sFact = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema theSchema;
+ try {
+ InputStream bindingsFileXSDInputStream = getClass().getClassLoader().getResourceAsStream("eclipselink_oxm_2_6.xsd");
+ if (bindingsFileXSDInputStream == null){
+ bindingsFileXSDInputStream = getClass().getClassLoader().getResourceAsStream("org/eclipse/persistence/jaxb/eclipselink_oxm_2_6.xsd");
+ }
+ if (bindingsFileXSDInputStream == null){
+ fail("ERROR LOADING eclipselink_oxm_2_6.xsd");
+ }
+ Source bindingsFileXSDSource = new StreamSource(bindingsFileXSDInputStream);
+ theSchema = sFact.newSchema(bindingsFileXSDSource);
Validator validator = theSchema.newValidator();
StreamSource ss = new StreamSource(src);
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestSuite.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestSuite.java
index 974783e..d4b7aa3 100644
--- a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestSuite.java
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/ExternalizedMetadataTestSuite.java
@@ -9,12 +9,15 @@
*
* Contributors:
* dmccann - June 17/2009 - 2.0 - Initial implementation
- ******************************************************************************/
-package org.eclipse.persistence.testing.jaxb.externalizedmetadata;
-
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.exceptions.ExceptionHandlingTestSuite;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.jaxbcontextfactory.JAXBContextFactoryTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.mappings.MappingsTestSuite;
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.exceptions.ExceptionHandlingTestSuite;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.jaxbcontextfactory.JAXBContextFactoryTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.mappings.MappingsTestSuite;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.multiplebindings.MultipleBindingsFourFilesTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.multiplebindings.MultipleBindingsSimpleTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.superclassoverride.SuperClassOverrideTestCases;
@@ -39,35 +42,40 @@ import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlaccessortype
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.classlevel.AdapterOnClassTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.hexbinary.AdapterHexBinaryTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.list.XmlAdapterListTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.list.XmlAdapterListsTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.negative.XmlAdapterNegativeTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.packagelevel.AdapterOnPackageTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.property.AdapterOnPropertyTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.packagelevel.unspecified.XmlAdapterUnspecifiedClassTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.unmappable.ClassLevelTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.unmappable.PackageLevelTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.unmappable.PropertyLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.list.XmlAdapterListsTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.negative.XmlAdapterNegativeTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.packagelevel.AdapterOnPackageTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.packagelevel.unspecified.XmlAdapterUnspecifiedClassTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.property.AdapterOnPropertyTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.unmappable.ClassLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.unmappable.PackageLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmladapter.unmappable.PropertyLevelTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyattribute.XmlAnyAttributeTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementAdapterListTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementAdapterTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementBaseLAXFalseTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementBaseLAXTrueTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementBaseTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementDomHandlerTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementListTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.xmlelementrefs2.XmlAnyElementWithEltRefsNonGlobalTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.xmlelementrefs.XmlAnyElementWithEltRefsTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.xmlelementrefs3.XmlAnyElementWithEltRefsViaAnnotationTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlattachmentref.XmlAttachmentRefCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlattribute.XmlAttributeTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementBaseTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementDomHandlerTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.XmlAnyElementListTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.xmlelementrefs.XmlAnyElementWithEltRefsTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.xmlelementrefs2.XmlAnyElementWithEltRefsNonGlobalTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlanyelement.xmlelementrefs3.XmlAnyElementWithEltRefsViaAnnotationTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlattachmentref.XmlAttachmentRefCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlattribute.XmlAttributeTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlclassextractor.XmlClassExtractorTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlcustomizer.XmlCustomizerTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlcustomizer.XmlCustomizerWithOverrideTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmldiscriminator.XmlDiscriminatorTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelement.XmlElementTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementref.XmlElementRefTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementref.XmlElementRefWithWrapperTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementrefs.XmlElementRefsTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlcustomizer.XmlCustomizerWithOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmldiscriminator.XmlDiscriminatorTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelement.XmlElementTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.XmlElementNillablePackageLevelOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.XmlElementNillablePackageLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.XmlElementNillablePackageTypeOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.XmlElementNillableTypeLevelOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.XmlElementNillableTypeLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementref.XmlElementRefTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementref.XmlElementRefWithWrapperTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementrefs.XmlElementRefsTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelements.XmlElementsTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementwrapper.XmlElemenetWrapperNilTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementwrapper.XmlElementWrapperDefaultNameTestCases;
@@ -91,12 +99,17 @@ import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlmimetype.Xml
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlmixed.XmlMixedTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.NameTransformerExceptionTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.NameTransformerSimpleTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.NameTransformerTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.XmlMappingDefaultNameTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.XmlMappingSpecifiedNameTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlregistry.XmlRegistryNonLocalTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlregistry.XmlRegistryTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlrootelement.XmlRootElementTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.NameTransformerTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.XmlMappingDefaultNameTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnametransformer.XmlMappingSpecifiedNameTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.XmlNullPolicyPackageLevelOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.XmlNullPolicyPackageLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.XmlNullPolicyPackageTypeOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.XmlNullPolicyTypeLevelOverrideTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.XmlNullPolicyTypeLevelTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlregistry.XmlRegistryNonLocalTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlregistry.XmlRegistryTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlrootelement.XmlRootElementTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlschema.XmlSchemaTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlschema.namespace.NamespaceTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlschematype.XmlSchemaTypeTestCases;
@@ -116,15 +129,12 @@ import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlvalue.XmlVal
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlvalue.XmlValueCdnPricesTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlvalue.XmlValueInternationalPriceTestCases;
import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlvalue.XmlValueInternationalPricesTestCases;
-import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlvalue.XmlValueTestCases;
-import org.eclipse.persistence.testing.jaxb.xmlanyelement.XmlAnyElementArrayTestCases;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Suite for testing eclipselink-oxm.xml processing.
- *
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlvalue.XmlValueTestCases;
+import org.eclipse.persistence.testing.jaxb.xmlanyelement.XmlAnyElementArrayTestCases;
+
+/**
+ * Suite for testing eclipselink-oxm.xml processing.
+ *
*/
public class ExternalizedMetadataTestSuite extends TestSuite {
public static Test suite() {
@@ -233,12 +243,22 @@ public class ExternalizedMetadataTestSuite extends TestSuite {
suite.addTestSuite(SuperClassOverrideTestCases.class);
suite.addTest(PropOrderTestSuite.suite());
suite.addTestSuite(FieldAccessTestCases.class);
- suite.addTestSuite(PropertyAccessTestCases.class);
- suite.addTestSuite(UnspecifiedTestCases.class);
- suite.addTestSuite(XmlTransientUnsetPropTestCases.class);
- return suite;
- }
-
+ suite.addTestSuite(PropertyAccessTestCases.class);
+ suite.addTestSuite(UnspecifiedTestCases.class);
+ suite.addTestSuite(XmlTransientUnsetPropTestCases.class);
+ suite.addTestSuite(XmlElementNillablePackageLevelOverrideTestCases.class);
+ suite.addTestSuite(XmlElementNillablePackageLevelTestCases.class);
+ suite.addTestSuite(XmlElementNillablePackageTypeOverrideTestCases.class);
+ suite.addTestSuite(XmlElementNillableTypeLevelOverrideTestCases.class);
+ suite.addTestSuite(XmlElementNillableTypeLevelTestCases.class);
+ suite.addTestSuite(XmlNullPolicyPackageLevelOverrideTestCases.class);
+ suite.addTestSuite(XmlNullPolicyPackageLevelTestCases.class);
+ suite.addTestSuite(XmlNullPolicyPackageTypeOverrideTestCases.class);
+ suite.addTestSuite(XmlNullPolicyTypeLevelOverrideTestCases.class);
+ suite.addTestSuite(XmlNullPolicyTypeLevelTestCases.class);
+ return suite;
+ }
+
public static void main(String[] args) {
String[] arguments = { "-c", "org.eclipse.persistence.testing.jaxb.externalizedmetadata.ExternalizedMetadataTestSuite" };
junit.textui.TestRunner.main(arguments);
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelOverrideTestCases.java
new file mode 100644
index 0000000..14cb030
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelOverrideTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packageleveloverride.PackageRootOverride;
+
+/**
+ * Test demonstrates that xml-element-nillable element declared in oxm.xml file overrides XmlElementNillable annotation declared on package level in package-info.java
+ */
+public class XmlElementNillablePackageLevelOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package_root_override_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/eclipselink-oxm.xml";
+
+ public XmlElementNillablePackageLevelOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { PackageRootOverride.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected PackageRootOverride getControlObject() {
+ PackageRootOverride controlObject = new PackageRootOverride();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java
new file mode 100644
index 0000000..abdabc4
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageLevelTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packagetype.Root;
+
+/**
+ * Test demonstrates the usage of xml-element-nillable element declared in oxm.xml file.
+ */
+public class XmlElementNillablePackageLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/nillable_package.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/eclipselink-oxm.xml";
+
+ public XmlElementNillablePackageLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { Root.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected Root getControlObject() {
+ Root controlObject = new Root();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageTypeOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageTypeOverrideTestCases.java
new file mode 100644
index 0000000..5c35dba
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillablePackageTypeOverrideTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packagetypeoverride.PackageTypeOverride;
+
+/**
+ * Test demonstrates that XmlElementNillable annotation declared on class overrides xml-element-nillable element declared in oxm.xml file (package level).
+ */
+public class XmlElementNillablePackageTypeOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/package_type_override_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/eclipselink-oxm.xml";
+
+ public XmlElementNillablePackageTypeOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { PackageTypeOverride.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected PackageTypeOverride getControlObject() {
+ PackageTypeOverride controlObject = new PackageTypeOverride();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java
new file mode 100644
index 0000000..71892ca
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelOverrideTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typeleveloverride.TypeRootOverride;
+
+/**
+ * Test demonstrates that xml-element-nillable element declared in oxm.xml file overrides XmlElementNillable annotation declared on class.
+ */
+public class XmlElementNillableTypeLevelOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/type_root_override_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/eclipselink-oxm.xml";
+
+ public XmlElementNillableTypeLevelOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { TypeRootOverride.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected TypeRootOverride getControlObject() {
+ TypeRootOverride controlObject = new TypeRootOverride();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java
new file mode 100644
index 0000000..7742c91
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/XmlElementNillableTypeLevelTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typelevel.TypeRoot;
+
+/**
+ * Test demonstrates the usage of class level xml-element-nillable element declared in oxm.xml file.
+ */
+public class XmlElementNillableTypeLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/type_root_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/eclipselink-oxm.xml";
+
+ public XmlElementNillableTypeLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { TypeRoot.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected TypeRoot getControlObject() {
+ TypeRoot controlObject = new TypeRoot();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/PackageRootOverride.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/PackageRootOverride.java
new file mode 100644
index 0000000..8b64455
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/PackageRootOverride.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packageleveloverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class PackageRootOverride {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package-info.java
new file mode 100644
index 0000000..af4708d
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packageleveloverride/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+@XmlElementNillable(nillable = false)
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packageleveloverride;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/Root.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/Root.java
new file mode 100644
index 0000000..e97a9a0
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/Root.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packagetype;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Root {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/package-info.java
new file mode 100644
index 0000000..449396d
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetype/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+@XmlElementNillable
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packagetype;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/PackageTypeOverride.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/PackageTypeOverride.java
new file mode 100644
index 0000000..6bee162
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/packagetypeoverride/PackageTypeOverride.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.packagetypeoverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
+
+@XmlRootElement
+@XmlElementNillable(nillable = false)
+public class PackageTypeOverride {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/TypeRoot.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/TypeRoot.java
new file mode 100644
index 0000000..51889eb
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typelevel/TypeRoot.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typelevel;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class TypeRoot {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/TypeRootOverride.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/TypeRootOverride.java
new file mode 100644
index 0000000..e5e77fd
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlelementnillable/typeleveloverride/TypeRootOverride.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlelementnillable.typeleveloverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
+
+@XmlRootElement
+@XmlElementNillable(nillable = false)
+public class TypeRootOverride {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelOverrideTestCases.java
new file mode 100644
index 0000000..d2dc894
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelOverrideTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packageleveloverride.PackageRootOverride;
+
+/**
+ * Test demonstrates that xml-null-policy element declared in oxm.xml file overrides XmlNullPolicy annotation declared on package level in package-info.java
+ */
+public class XmlNullPolicyPackageLevelOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package_root_override_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/eclipselink-oxm.xml";
+
+ public XmlNullPolicyPackageLevelOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { PackageRootOverride.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected PackageRootOverride getControlObject() {
+ PackageRootOverride controlObject = new PackageRootOverride();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java
new file mode 100644
index 0000000..917dea2
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageLevelTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packagetype.Root;
+
+/**
+ * Test demonstrates the usage of xml-null-policy element declared in oxm.xml file.
+ */
+public class XmlNullPolicyPackageLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/nillable_package.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/eclipselink-oxm.xml";
+
+ public XmlNullPolicyPackageLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { Root.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected Root getControlObject() {
+ Root controlObject = new Root();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageTypeOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageTypeOverrideTestCases.java
new file mode 100644
index 0000000..5981122
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyPackageTypeOverrideTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packagetypeoverride.PackageTypeOverride;
+
+/**
+ * Test demonstrates that XmlNullPolicy annotation declared on class overrides xml-null-policy element declared in oxm.xml file (package level).
+ */
+public class XmlNullPolicyPackageTypeOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/package_type_override_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/eclipselink-oxm.xml";
+
+ public XmlNullPolicyPackageTypeOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { PackageTypeOverride.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected PackageTypeOverride getControlObject() {
+ PackageTypeOverride controlObject = new PackageTypeOverride();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java
new file mode 100644
index 0000000..51e68a2
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelOverrideTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typeleveloverride.TypeRootOverride;
+
+/**
+ * Test demonstrates that xml-null-policy element declared in oxm.xml file overrides XmlNullPolicy annotation declared on class.
+ */
+public class XmlNullPolicyTypeLevelOverrideTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/type_root_override_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/eclipselink-oxm.xml";
+
+ public XmlNullPolicyTypeLevelOverrideTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { TypeRootOverride.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected TypeRootOverride getControlObject() {
+ TypeRootOverride controlObject = new TypeRootOverride();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java
new file mode 100644
index 0000000..2649851
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/XmlNullPolicyTypeLevelTestCases.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.persistence.jaxb.JAXBContextProperties;
+import org.eclipse.persistence.testing.jaxb.JAXBTestCases;
+import org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typelevel.TypeRoot;
+
+/**
+ * Test demonstrates the usage of class level xml-null-policy element declared in oxm.xml file.
+ */
+public class XmlNullPolicyTypeLevelTestCases extends JAXBTestCases {
+
+ private final static String XML_CONTROL_RESOURCE = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/type_root_control.xml";
+
+ private final static String BINDINGS_DOC = "org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/eclipselink-oxm.xml";
+
+ public XmlNullPolicyTypeLevelTestCases(String name) throws Exception {
+ super(name);
+ setControlDocument(XML_CONTROL_RESOURCE);
+ setClasses(new Class[] { TypeRoot.class });
+ }
+
+ public Map getProperties() {
+
+ InputStream iStream = ClassLoader.getSystemResourceAsStream(BINDINGS_DOC);
+
+ HashMap<String, Object> properties = new HashMap<String, Object>();
+ properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, iStream);
+
+ return properties;
+ }
+
+ @Override
+ protected TypeRoot getControlObject() {
+ TypeRoot controlObject = new TypeRoot();
+ controlObject.setB("B");
+
+ return controlObject;
+ }
+
+ @Override
+ public boolean isUnmarshalTest() {
+ return false;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/PackageRootOverride.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/PackageRootOverride.java
new file mode 100644
index 0000000..38e3c95
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/PackageRootOverride.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packageleveloverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class PackageRootOverride {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package-info.java
new file mode 100644
index 0000000..8d389c4
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packageleveloverride/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+@XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.XSI_NIL)
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packageleveloverride;
+
+import org.eclipse.persistence.oxm.annotations.XmlNullPolicy;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/Root.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/Root.java
new file mode 100644
index 0000000..d1d5f82
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/Root.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packagetype;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class Root {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/package-info.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/package-info.java
new file mode 100644
index 0000000..31a30e3
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetype/package-info.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+@XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.XSI_NIL)
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packagetype;
+
+import org.eclipse.persistence.oxm.annotations.XmlNullPolicy;
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/PackageTypeOverride.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/PackageTypeOverride.java
new file mode 100644
index 0000000..f330247
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/packagetypeoverride/PackageTypeOverride.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.packagetypeoverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.persistence.oxm.annotations.XmlNullPolicy;
+
+@XmlRootElement
+@XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.EMPTY_NODE)
+public class PackageTypeOverride {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/TypeRoot.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/TypeRoot.java
new file mode 100644
index 0000000..dfc5ca2
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typelevel/TypeRoot.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typelevel;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class TypeRoot {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/TypeRootOverride.java b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/TypeRootOverride.java
new file mode 100644
index 0000000..91431be
--- /dev/null
+++ b/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/externalizedmetadata/xmlnullpolicy/typeleveloverride/TypeRootOverride.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.testing.jaxb.externalizedmetadata.xmlnullpolicy.typeleveloverride;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.eclipse.persistence.oxm.annotations.XmlNullPolicy;
+
+@XmlRootElement
+@XmlNullPolicy(nullRepresentationForXml = org.eclipse.persistence.oxm.annotations.XmlMarshalNullRepresentation.EMPTY_NODE)
+public class TypeRootOverride {
+ private String a;
+ private String b;
+ private String c;
+ private String d;
+ private String e;
+
+ public String getA() {
+ return a;
+ }
+
+ public void setA(String a) {
+ this.a = a;
+ }
+
+ public String getB() {
+ return b;
+ }
+
+ public void setB(String b) {
+ this.b = b;
+ }
+
+ public String getC() {
+ return c;
+ }
+
+ public void setC(String c) {
+ this.c = c;
+ }
+
+ @XmlElement(nillable = true)
+ public String getD() {
+ return d;
+ }
+
+ public void setD(String d) {
+ this.d = d;
+ }
+
+ @XmlElement(nillable = true)
+ public String getE() {
+ return e;
+ }
+
+ public void setE(String e) {
+ this.e = e;
+ }
+
+}
diff --git a/moxy/org.eclipse.persistence.moxy/resource/org/eclipse/persistence/jaxb/eclipselink_oxm_2_5.xsd b/moxy/org.eclipse.persistence.moxy/resource/org/eclipse/persistence/jaxb/eclipselink_oxm_2_6.xsd
index 7dd0732..bd1aae9 100644
--- a/moxy/org.eclipse.persistence.moxy/resource/org/eclipse/persistence/jaxb/eclipselink_oxm_2_5.xsd
+++ b/moxy/org.eclipse.persistence.moxy/resource/org/eclipse/persistence/jaxb/eclipselink_oxm_2_6.xsd
@@ -1,24 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
******************************************************************************
- Copyright (c) 1998, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- which accompanies this distribution.
+ Copyright (c) 1998, 2014 Oracle. All rights reserved.
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ which accompanies this distribution.
The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- and the Eclipse Distribution License is available at
+ and the Eclipse Distribution License is available at
http://www.eclipse.org/org/documents/edl-v10.php.
Contributors:
dmccann - December 22/2010 - 2.3 - Initial implementation
+ Martin Vojtek - July 7/2014 - 2.6 - Added XmlNullPolicy and XmlElementNillable
*****************************************************************************/
-->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
+ targetNamespace="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
- version="2.5">
+ version="2.6">
<xs:element name="xml-bindings">
<xs:complexType>
@@ -48,6 +49,8 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element ref="xml-null-policy" minOccurs="0" />
+ <xs:element ref="xml-element-nillable" minOccurs="0" />
</xs:all>
<xs:attribute name="xml-accessor-type" type="xml-access-type" default="PUBLIC_MEMBER" />
<xs:attribute name="xml-accessor-order" type="xml-access-order" default="UNDEFINED" />
@@ -94,6 +97,8 @@
</xs:complexType>
</xs:element>
<xs:element ref="xml-named-object-graphs" minOccurs="0"/>
+ <xs:element ref="xml-null-policy" minOccurs="0" />
+ <xs:element ref="xml-element-nillable" minOccurs="0" />
</xs:all>
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="super-type" type="xs:string" default="##default" />
@@ -171,7 +176,7 @@
<xs:enumeration value="2.4"/>
<xs:enumeration value="2.5"/>
</xs:restriction>
- </xs:simpleType>
+ </xs:simpleType>
<!-- @Target(value=PACKAGE) -->
<xs:element name="xml-schema">
@@ -204,6 +209,11 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+ <xs:element name="xml-element-nillable">
+ <xs:complexType>
+ <xs:attribute name="nillable" type="xs:boolean" default="true" use="optional" />
+ </xs:complexType>
+ </xs:element>
<!-- @Target(value={FIELD,METHOD,PACKAGE}) -->
<xs:element name="xml-schema-type">
@@ -221,7 +231,7 @@
<xs:extension base="java-attribute">
<xs:attribute name="value" type="xs:string" use="required" />
<xs:attribute name="type" type="xs:string" default="javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT" />
- <xs:attribute name="value-type" type="xs:string" default="javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT" />
+ <xs:attribute name="value-type" type="xs:string" default="javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter.DEFAULT" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
@@ -296,7 +306,7 @@
</xs:simpleContent>
</xs:complexType>
</xs:element>
-
+
<!-- @Target(value={FIELD,METHOD}) -->
<xs:element name="xml-any-attribute" substitutionGroup="java-attribute">
<xs:complexType>
@@ -319,7 +329,7 @@
<xs:complexContent>
<xs:extension base="java-attribute">
<xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
+ <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
<xs:element ref="xml-access-methods" minOccurs="0" />
<xs:element ref="xml-java-type-adapter" minOccurs="0"/>
<xs:element ref="xml-properties" minOccurs="0" />
@@ -393,7 +403,7 @@
<xs:complexContent>
<xs:extension base="java-attribute">
<xs:all>
- <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
+ <xs:element ref="xml-abstract-null-policy" minOccurs="0" />
<xs:element ref="xml-access-methods" minOccurs="0" />
<xs:element ref="xml-element-wrapper" minOccurs="0"/>
<xs:element name="xml-inverse-reference" minOccurs="0">
@@ -546,7 +556,7 @@
</xs:complexType>
</xs:element>
</xs:all>
- </xs:complexType>
+ </xs:complexType>
</xs:element>
<xs:element name="xml-abstract-null-policy" type="xml-abstract-null-policy" />
<xs:complexType name="xml-abstract-null-policy" abstract="true">
@@ -656,4 +666,4 @@
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
</xs:complexType>
-</xs:schema> \ No newline at end of file
+</xs:schema>
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
index f30a0da..618349f 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java
@@ -137,13 +137,14 @@ import org.eclipse.persistence.oxm.annotations.XmlNamedSubgraph;
import org.eclipse.persistence.oxm.annotations.XmlAccessMethods;
import org.eclipse.persistence.oxm.annotations.XmlCDATA;
import org.eclipse.persistence.oxm.annotations.XmlClassExtractor;
-import org.eclipse.persistence.oxm.annotations.XmlContainerProperty;
-import org.eclipse.persistence.oxm.annotations.XmlCustomizer;
-import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode;
-import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
-import org.eclipse.persistence.oxm.annotations.XmlElementsJoinNodes;
-import org.eclipse.persistence.oxm.annotations.XmlLocation;
-import org.eclipse.persistence.oxm.annotations.XmlVariableNode;
+import org.eclipse.persistence.oxm.annotations.XmlContainerProperty;
+import org.eclipse.persistence.oxm.annotations.XmlCustomizer;
+import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode;
+import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorValue;
+import org.eclipse.persistence.oxm.annotations.XmlElementNillable;
+import org.eclipse.persistence.oxm.annotations.XmlElementsJoinNodes;
+import org.eclipse.persistence.oxm.annotations.XmlLocation;
+import org.eclipse.persistence.oxm.annotations.XmlVariableNode;
import org.eclipse.persistence.oxm.annotations.XmlVirtualAccessMethods;
import org.eclipse.persistence.oxm.annotations.XmlInverseReference;
import org.eclipse.persistence.oxm.annotations.XmlIsSetNullPolicy;
@@ -217,6 +218,7 @@ public final class AnnotationsProcessor {
private List<JavaClass> typeInfoClasses;
private Map<String, PackageInfo> packageToPackageInfoMappings;
+ private HashMap<String, XmlNillableInfo> packageToXmlNillableInfoMappings;
private Map<String, MarshalCallback> marshalCallbacks;
private Map<String, QName> userDefinedSchemaTypes;
private Map<String, TypeInfo> typeInfos;
@@ -557,13 +559,16 @@ public final class AnnotationsProcessor {
info.setJavaClassName(qualifiedName);
info.setPreBuilt(true);
- // handle @XmlTransient
- if (helper.isAnnotationPresent(javaClass, XmlTransient.class)) {
- info.setXmlTransient(true);
- }
-
- // handle @XmlExtensible
- processXmlExtensible(javaClass, info);
+ // handle @XmlTransient
+ if (helper.isAnnotationPresent(javaClass, XmlTransient.class)) {
+ info.setXmlTransient(true);
+ }
+
+ // handle @XmlElementNillable
+ processXmlElementNillable(javaClass, info);
+
+ // handle @XmlExtensible
+ processXmlExtensible(javaClass, info);
// handle @XmlInlineBinaryData
if (helper.isAnnotationPresent(javaClass, XmlInlineBinaryData.class)) {
@@ -645,6 +650,27 @@ public final class AnnotationsProcessor {
return typeInfos;
}
+ private void processXmlElementNillable(JavaClass javaClass, TypeInfo info) {
+ if (helper.isAnnotationPresent(javaClass, XmlElementNillable.class)) {
+ XmlElementNillable xmlElementNillable = (XmlElementNillable) helper.getAnnotation(javaClass, XmlElementNillable.class);
+ info.setXmlElementNillable(xmlElementNillable.nillable());
+ } else if (hasExternalPackageMapping(javaClass)) {
+ info.setXmlElementNillable(packageToXmlNillableInfoMappings.get(javaClass.getPackageName()).getXmlElementNillable().isNillable());
+ } else if (helper.isAnnotationPresent(javaClass.getPackage(), XmlElementNillable.class)) {
+ XmlElementNillable xmlElementNillable = (XmlElementNillable) helper.getAnnotation(javaClass.getPackage(), XmlElementNillable.class);
+ info.setXmlElementNillable(xmlElementNillable.nillable());
+ }
+ }
+
+ private boolean hasExternalPackageMapping(JavaClass javaClass) {
+
+ if (null == packageToXmlNillableInfoMappings || !packageToXmlNillableInfoMappings.containsKey(javaClass.getPackageName())) {
+ return false;
+ }
+
+ return null != packageToXmlNillableInfoMappings.get(javaClass.getPackageName()).getXmlElementNillable();
+ }
+
private void processNamedObjectGraphs(JavaClass javaClass, TypeInfo info) {
List<XmlNamedObjectGraph> objectGraphs = new ArrayList<XmlNamedObjectGraph>();
if(helper.isAnnotationPresent(javaClass, XmlNamedObjectGraphs.class)) {
@@ -1655,9 +1681,17 @@ public final class AnnotationsProcessor {
* @param property
*/
private void processXmlElement(Property property, TypeInfo info) {
- if (helper.isAnnotationPresent(property.getElement(), XmlElement.class)) {
- XmlElement element = (XmlElement) helper.getAnnotation(property.getElement(), XmlElement.class);
- property.setIsRequired(element.required());
+
+ if (helper.isAnnotationPresent(property.getElement(), XmlElementNillable.class)) {
+ XmlElementNillable elementNillable = (XmlElementNillable) helper.getAnnotation(property.getElement(), XmlElementNillable.class);
+ property.setNillable(elementNillable.nillable());
+ } else if (info.isXmlElementNillable()) {
+ property.setNillable(true);
+ }
+
+ if (helper.isAnnotationPresent(property.getElement(), XmlElement.class)) {
+ XmlElement element = (XmlElement) helper.getAnnotation(property.getElement(), XmlElement.class);
+ property.setIsRequired(element.required());
property.setNillable(element.nillable());
if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
property.setOriginalType(property.getType());
@@ -2717,8 +2751,8 @@ public final class AnnotationsProcessor {
info.addXmlKeyProperty(property);
}
// handle XmlJoinNode(s)
- processXmlJoinNodes(property);
- processXmlNullPolicy(property);
+ processXmlJoinNodes(property);
+ processXmlNullPolicy(property, cls, info);
// Handle XmlLocation
JavaHasAnnotations elem = propertyElement;
@@ -2840,20 +2874,21 @@ public final class AnnotationsProcessor {
if (src == null || tgt == null) {
return false;
}
- return src.getRawName().equals(tgt.getCanonicalName());
- }
-
- private void processXmlNullPolicy(Property property) {
- if (helper.isAnnotationPresent(property.getElement(), XmlNullPolicy.class)) {
- XmlNullPolicy nullPolicy = (XmlNullPolicy) helper.getAnnotation(property.getElement(), XmlNullPolicy.class);
- org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy policy = new org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy();
- policy.setEmptyNodeRepresentsNull(nullPolicy.emptyNodeRepresentsNull());
- policy.setIsSetPerformedForAbsentNode(nullPolicy.isSetPerformedForAbsentNode());
- policy.setXsiNilRepresentsNull(nullPolicy.xsiNilRepresentsNull());
- policy.setNullRepresentationForXml(org.eclipse.persistence.jaxb.xmlmodel.XmlMarshalNullRepresentation.valueOf(nullPolicy.nullRepresentationForXml().toString()));
- property.setNullPolicy(policy);
+ return src.getRawName().equals(tgt.getCanonicalName());
+ }
- } else if (helper.isAnnotationPresent(property.getElement(), XmlIsSetNullPolicy.class)) {
+ private void processXmlNullPolicy(Property property, JavaClass cls, TypeInfo info) {
+ if (propertyHasXmlNullPolicyAnnotation(property)) {
+ setNullPolicyOnProperty(property, helper.getAnnotation(property.getElement(), XmlNullPolicy.class));
+ } else if (existsExternalMappingWithJavaTypeXmlNullPolicy(info)) {
+ property.setNullPolicy(info.getXmlNullPolicy());
+ } else if (javaTypeHasXmlNullPolicyAnnotation(cls)) {
+ setNullPolicyOnProperty(property, helper.getAnnotation(cls, XmlNullPolicy.class));
+ } else if (existsExternaMappingWithPackageXmlNullPolicy(cls)) {
+ property.setNullPolicy(packageToXmlNillableInfoMappings.get(cls.getPackageName()).getXmlNullPolicy());
+ } else if (helper.isAnnotationPresent(cls.getPackage(), XmlNullPolicy.class)) {
+ setNullPolicyOnProperty(property, helper.getAnnotation(cls.getPackage(), XmlNullPolicy.class));
+ } else if (helper.isAnnotationPresent(property.getElement(), XmlIsSetNullPolicy.class)) {
XmlIsSetNullPolicy nullPolicy = (XmlIsSetNullPolicy) helper.getAnnotation(property.getElement(), XmlIsSetNullPolicy.class);
org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy policy = new org.eclipse.persistence.jaxb.xmlmodel.XmlIsSetNullPolicy();
policy.setEmptyNodeRepresentsNull(nullPolicy.emptyNodeRepresentsNull());
@@ -2865,11 +2900,42 @@ public final class AnnotationsProcessor {
param.setValue(next.value());
param.setType(next.type().getName());
policy.getIsSetParameter().add(param);
- }
- property.setNullPolicy(policy);
- }
- }
-
+ }
+ property.setNullPolicy(policy);
+ }
+ }
+
+ private boolean existsExternaMappingWithPackageXmlNullPolicy(JavaClass cls) {
+
+ if (null == packageToXmlNillableInfoMappings || !packageToXmlNillableInfoMappings.containsKey(cls.getPackageName())) {
+ return false;
+ }
+
+ return null != packageToXmlNillableInfoMappings.get(cls.getPackageName()).getXmlNullPolicy();
+ }
+
+ private boolean javaTypeHasXmlNullPolicyAnnotation(JavaClass cls) {
+ return helper.isAnnotationPresent(cls, XmlNullPolicy.class);
+ }
+
+ private boolean existsExternalMappingWithJavaTypeXmlNullPolicy(TypeInfo info) {
+ return null != info.getXmlNullPolicy();
+ }
+
+ private boolean propertyHasXmlNullPolicyAnnotation(Property property) {
+ return helper.isAnnotationPresent(property.getElement(), XmlNullPolicy.class);
+ }
+
+ private void setNullPolicyOnProperty(Property property, Annotation nullPolicyAnnotation) {
+ XmlNullPolicy nullPolicy = (XmlNullPolicy) nullPolicyAnnotation;
+ org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy policy = new org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy();
+ policy.setEmptyNodeRepresentsNull(nullPolicy.emptyNodeRepresentsNull());
+ policy.setIsSetPerformedForAbsentNode(nullPolicy.isSetPerformedForAbsentNode());
+ policy.setXsiNilRepresentsNull(Boolean.valueOf(nullPolicy.xsiNilRepresentsNull()));
+ policy.setNullRepresentationForXml(org.eclipse.persistence.jaxb.xmlmodel.XmlMarshalNullRepresentation.valueOf(nullPolicy.nullRepresentationForXml().toString()));
+ property.setNullPolicy(policy);
+ }
+
/**
* Compares a JavaModel JavaClass to a Class. Equality is based on the raw
* name of the JavaClass compared to the canonical name of the Class.
@@ -3487,18 +3553,57 @@ public final class AnnotationsProcessor {
* @return
*/
public void addPackageToNamespaceMapping(String packageName, NamespaceInfo nsInfo) {
- if (packageToPackageInfoMappings == null) {
- packageToPackageInfoMappings = new HashMap<String, PackageInfo>();
- }
- PackageInfo info = packageToPackageInfoMappings.get(packageName);
- if(info == null) {
- info = new PackageInfo();
- packageToPackageInfoMappings.put(packageName, info);
- }
- info.setNamespaceInfo(nsInfo);
- }
-
- public void addPackageToPackageInfoMapping(String packageName, PackageInfo packageInfo) {
+ PackageInfo info = getPackageInfoWithLazyInit(packageName);
+ info.setNamespaceInfo(nsInfo);
+ }
+
+ /**
+ * Add a package name/XmlElementNillable entry to the map. This method will
+ * lazy-load the map if necessary.
+ *
+ * @return
+ */
+ public void addPackageToXmlElementNillable(String packageName, org.eclipse.persistence.jaxb.xmlmodel.XmlElementNillable xmlElementNillable) {
+ XmlNillableInfo info = getXmlNillableInfoWithLazyInit(packageName);
+ info.setXmlElementNillable(xmlElementNillable);
+ }
+
+ /**
+ * Add a package name/XmlNullPolicy entry to the map. This method will
+ * lazy-load the map if necessary.
+ *
+ * @return
+ */
+ public void addPackageToXmlNullPolicy(String packageName, org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy xmlNullPolicy) {
+ XmlNillableInfo info = getXmlNillableInfoWithLazyInit(packageName);
+ info.setXmlNullPolicy(xmlNullPolicy);
+ }
+
+ private XmlNillableInfo getXmlNillableInfoWithLazyInit(String packageName) {
+ if (packageToXmlNillableInfoMappings == null) {
+ packageToXmlNillableInfoMappings = new HashMap<String, XmlNillableInfo>();
+ }
+ XmlNillableInfo info = packageToXmlNillableInfoMappings.get(packageName);
+ if (info == null) {
+ info = new XmlNillableInfo();
+ packageToXmlNillableInfoMappings.put(packageName, info);
+ }
+ return info;
+ }
+
+ private PackageInfo getPackageInfoWithLazyInit(String packageName) {
+ if (packageToPackageInfoMappings == null) {
+ packageToPackageInfoMappings = new HashMap<String, PackageInfo>();
+ }
+ PackageInfo info = packageToPackageInfoMappings.get(packageName);
+ if (info == null) {
+ info = new PackageInfo();
+ packageToPackageInfoMappings.put(packageName, info);
+ }
+ return info;
+ }
+
+ public void addPackageToPackageInfoMapping(String packageName, PackageInfo packageInfo) {
if(packageToPackageInfoMappings == null) {
packageToPackageInfoMappings = new HashMap<String, PackageInfo>();
}
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/TypeInfo.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/TypeInfo.java
index 265ed38..ccdc46a 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/TypeInfo.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/TypeInfo.java
@@ -3,9 +3,9 @@
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
@@ -23,25 +23,29 @@ import org.eclipse.persistence.internal.jaxb.AccessorFactoryWrapper;
import org.eclipse.persistence.internal.oxm.mappings.Descriptor;
import org.eclipse.persistence.internal.oxm.schema.model.ComplexType;
import org.eclipse.persistence.internal.oxm.schema.model.Schema;
-import org.eclipse.persistence.internal.oxm.schema.model.SimpleType;
-import org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle;
-
-import org.eclipse.persistence.oxm.XMLNameTransformer;
-
-import org.eclipse.persistence.jaxb.DefaultXMLNameTransformer;
-import org.eclipse.persistence.jaxb.javamodel.Helper;
-import org.eclipse.persistence.jaxb.javamodel.JavaClass;
-
-import org.eclipse.persistence.jaxb.xmlmodel.XmlNamedObjectGraph;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlAccessOrder;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlVirtualAccessMethods;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlJavaTypeAdapter;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlType;
-
-/**
- * INTERNAL:
+import org.eclipse.persistence.internal.oxm.schema.model.SimpleType;
+import org.eclipse.persistence.internal.oxm.schema.model.TypeDefParticle;
+
+
+
+import org.eclipse.persistence.jaxb.DefaultXMLNameTransformer;
+import org.eclipse.persistence.jaxb.javamodel.Helper;
+import org.eclipse.persistence.jaxb.javamodel.JavaClass;
+
+
+import org.eclipse.persistence.jaxb.xmlmodel.XmlAccessOrder;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType;
+
+import org.eclipse.persistence.jaxb.xmlmodel.XmlJavaTypeAdapter;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlNamedObjectGraph;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlRootElement;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlType;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlVirtualAccessMethods;
+import org.eclipse.persistence.oxm.XMLNameTransformer;
+
+/**
+ * INTERNAL:
* <p>
* <b>Purpose:</b>Used to store meta data about JAXB 2.0 Annotated classes during schema and mapping
* generation processes.
@@ -92,12 +96,14 @@ public class TypeInfo {
private boolean isMixed;
private boolean isTransient;
- private boolean isPreBuilt;
- private boolean isPostBuilt;
- private boolean isSetXmlTransient;
-
- private List<String> xmlSeeAlso;
- private XmlRootElement xmlRootElement;
+ private boolean isPreBuilt;
+ private boolean isPostBuilt;
+ private boolean isSetXmlTransient;
+ private boolean isXmlElementNillable;
+ private XmlNullPolicy xmlNullPolicy;
+
+ private List<String> xmlSeeAlso;
+ private XmlRootElement xmlRootElement;
private XmlType xmlType;
private XmlAccessType xmlAccessType;
private XmlAccessOrder xmlAccessOrder;
@@ -135,12 +141,13 @@ public class TypeInfo {
propertyNames = new ArrayList<String>();
properties = new HashMap<String, Property>();
originalProperties = new HashMap<String, Property>();
- propertyList = new ArrayList<Property>();
- xmlNameTransformer = DEFAULT_NAME_TRANSFORMER;
- isSetXmlTransient = false;
- isPreBuilt = false;
- isPostBuilt = false;
- this.javaClass = javaClass;
+ propertyList = new ArrayList<Property>();
+ xmlNameTransformer = DEFAULT_NAME_TRANSFORMER;
+ isSetXmlTransient = false;
+ isXmlElementNillable = false;
+ isPreBuilt = false;
+ isPostBuilt = false;
+ this.javaClass = javaClass;
}
/**
@@ -406,9 +413,9 @@ public class TypeInfo {
}
public boolean isAnonymousComplexType() {
- return this.schemaTypeName == null || this.schemaTypeName.equals("");
- }
-
+ return this.schemaTypeName == null || this.schemaTypeName.equals("");
+ }
+
/**
* Return the xmladapter class for a given bound type class name.
*
@@ -416,9 +423,9 @@ public class TypeInfo {
* @return
*/
public JavaClass getPackageLevelAdapterClass(String boundTypeName) {
- if(hasPackageLevelAdaptersByClass()) {
- return getPackageLevelAdaptersByClass().get(boundTypeName);
- }
+ if(hasPackageLevelAdaptersByClass()) {
+ return getPackageLevelAdaptersByClass().get(boundTypeName);
+ }
return null;
}
@@ -614,12 +621,48 @@ public class TypeInfo {
public void setXmlTransient(boolean isTransient) {
isSetXmlTransient = true;
setTransient(isTransient);
- }
-
- /**
- * Indicates if xmlSeeAlso has been set, i.e. is non-null
- *
- * @return true is xmlSeeAlso has been set, i.e. is non-null, false otherwise
+ }
+
+ /**
+ * Indicates if XmlElementNillable is set.
+ *
+ * @return
+ */
+ public boolean isXmlElementNillable() {
+ return isXmlElementNillable;
+ }
+
+ /**
+ * Set the XmlElementNillable for this TypeInfo.
+ *
+ * @param isXmlElementNillable
+ */
+ public void setXmlElementNillable(boolean isXmlElementNillable) {
+ this.isXmlElementNillable = isXmlElementNillable;
+ }
+
+ /**
+ * Return XmlNullPolicy for this TypeInfo.
+ *
+ * @return xmlNullPolicy
+ */
+ public XmlNullPolicy getXmlNullPolicy() {
+ return xmlNullPolicy;
+ }
+
+ /**
+ * Set the XmlNullPolicy for this TypeInfo.
+ *
+ * @param xmlNullPolicy
+ */
+ public void setXmlNullPolicy(XmlNullPolicy xmlNullPolicy) {
+ this.xmlNullPolicy = xmlNullPolicy;
+ }
+
+ /**
+ * Indicates if xmlSeeAlso has been set, i.e. is non-null
+ *
+ * @return true is xmlSeeAlso has been set, i.e. is non-null, false otherwise
*/
public boolean isSetXmlSeeAlso() {
return xmlSeeAlso != null;
@@ -830,9 +873,9 @@ public class TypeInfo {
* @see DescriptorCustomizer
*/
public String getXmlCustomizer() {
- return xmlCustomizer;
- }
-
+ return xmlCustomizer;
+ }
+
/**
* Sets the XmlCustomizer class name on this TypeInfo.
*
@@ -840,9 +883,9 @@ public class TypeInfo {
* @see DescriptorCustomizer
*/
public void setXmlCustomizer(String xmlCustomizerClassName) {
- this.xmlCustomizer = xmlCustomizerClassName;
- }
-
+ this.xmlCustomizer = xmlCustomizerClassName;
+ }
+
/**
* Indicates if the name of the XmlAnyElement property has been set.
*
@@ -1205,7 +1248,7 @@ public class TypeInfo {
}
public void setJavaClass(JavaClass javaClass) {
- this.javaClass = javaClass;
- }
-
-} \ No newline at end of file
+ this.javaClass = javaClass;
+ }
+
+}
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XMLProcessor.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XMLProcessor.java
index b5550ef..fd142e7 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XMLProcessor.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XMLProcessor.java
@@ -3,27 +3,28 @@
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dmccann - June 17/2009 - 2.0 - Initial implementation
- ******************************************************************************/
-package org.eclipse.persistence.jaxb.compiler;
-
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * dmccann - June 17/2009 - 2.0 - Initial implementation
+ * Martin Vojtek - July 8/2014 - 2.6 - XmlNullPolicy and XmlElementNillable
+ ******************************************************************************/
+package org.eclipse.persistence.jaxb.compiler;
+
import static org.eclipse.persistence.jaxb.javamodel.Helper.getQualifiedJavaTypeName;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.Map.Entry;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.namespace.QName;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.StringTokenizer;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
import org.eclipse.persistence.exceptions.JAXBException;
import org.eclipse.persistence.internal.oxm.Constants;
@@ -35,48 +36,50 @@ import org.eclipse.persistence.jaxb.javamodel.JavaField;
import org.eclipse.persistence.jaxb.javamodel.JavaHasAnnotations;
import org.eclipse.persistence.jaxb.javamodel.JavaMethod;
import org.eclipse.persistence.jaxb.javamodel.JavaModelInput;
-import org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl;
-import org.eclipse.persistence.jaxb.xmlmodel.JavaAttribute;
-import org.eclipse.persistence.jaxb.xmlmodel.JavaType;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlNamedObjectGraph;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlAbstractNullPolicy;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlAnyAttribute;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlAnyElement;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlAttribute;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlElement;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlElementRef;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlElementRefs;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlElementWrapper;
+import org.eclipse.persistence.jaxb.javamodel.reflection.JavaClassImpl;
+import org.eclipse.persistence.jaxb.xmlmodel.JavaAttribute;
+import org.eclipse.persistence.jaxb.xmlmodel.JavaType;
+import org.eclipse.persistence.jaxb.xmlmodel.JavaType.JavaAttributes;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlAbstractNullPolicy;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlAnyAttribute;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlAnyElement;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlAttribute;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.JavaTypes;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.XmlEnums;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.XmlRegistries;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlElement;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlElementNillable;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlElementRef;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlElementRefs;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlElementWrapper;
import org.eclipse.persistence.jaxb.xmlmodel.XmlElements;
import org.eclipse.persistence.jaxb.xmlmodel.XmlEnum;
import org.eclipse.persistence.jaxb.xmlmodel.XmlEnumValue;
import org.eclipse.persistence.jaxb.xmlmodel.XmlInverseReference;
import org.eclipse.persistence.jaxb.xmlmodel.XmlJavaTypeAdapter;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlJavaTypeAdapters;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlJoinNodes;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlMap;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlNsForm;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlRegistry;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlSchema;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlSchemaType;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlSchemaTypes;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlTransformation;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlTransient;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlValue;
-import org.eclipse.persistence.jaxb.xmlmodel.JavaType.JavaAttributes;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.JavaTypes;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.XmlEnums;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlBindings.XmlRegistries;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlProperties.XmlProperty;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlSchema.XmlNs;
-import org.eclipse.persistence.jaxb.xmlmodel.XmlVariableNode;
-import org.eclipse.persistence.oxm.XMLNameTransformer;
-import org.eclipse.persistence.oxm.NamespaceResolver;
-
-/**
- * INTERNAL:
+import org.eclipse.persistence.jaxb.xmlmodel.XmlJavaTypeAdapters;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlJoinNodes;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlMap;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlNamedObjectGraph;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlNsForm;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlProperties.XmlProperty;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlRegistry;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlSchema;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlSchema.XmlNs;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlSchemaType;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlSchemaTypes;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlTransformation;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlTransient;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlValue;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlVariableNode;
+import org.eclipse.persistence.oxm.NamespaceResolver;
+import org.eclipse.persistence.oxm.XMLNameTransformer;
+
+/**
+ * INTERNAL:
* <p>
* Purpose: XMLProcessor is used to process the meta data provided
* in external OXM XML files. This information is then used in conjunction with the
@@ -148,12 +151,22 @@ public class XMLProcessor {
// handle @XmlSchema override
NamespaceInfo nsInfo = processXmlSchema(xmlBindings, packageName);
if (nsInfo != null) {
- aProcessor.addPackageToNamespaceMapping(packageName, nsInfo);
- }
-
- // handle xml-registries
- // add an entry to the map of registries keyed on factory class name for each
- XmlRegistries xmlRegs = xmlBindings.getXmlRegistries();
+ aProcessor.addPackageToNamespaceMapping(packageName, nsInfo);
+ }
+
+ // handle @XmlElementNillable override
+ if (null != xmlBindings.getXmlElementNillable()) {
+ aProcessor.addPackageToXmlElementNillable(packageName, xmlBindings.getXmlElementNillable());
+ }
+
+ // handle @XmlNullPolicy override
+ if (null != xmlBindings.getXmlNullPolicy()) {
+ aProcessor.addPackageToXmlNullPolicy(packageName, xmlBindings.getXmlNullPolicy());
+ }
+
+ // handle xml-registries
+ // add an entry to the map of registries keyed on factory class name for each
+ XmlRegistries xmlRegs = xmlBindings.getXmlRegistries();
if (xmlRegs != null) {
for (XmlRegistry xmlReg : xmlRegs.getXmlRegistry()) {
aProcessor.addXmlRegistry(xmlReg.getName(), xmlReg);
@@ -228,12 +241,24 @@ public class XMLProcessor {
// handle class-level @XmlJavaTypeAdapter override
if (javaType.getXmlJavaTypeAdapter() != null) {
- info.setXmlJavaTypeAdapter(javaType.getXmlJavaTypeAdapter());
- }
-
- // handle class-level @XmlNameTransformer
- String transformerClassName = javaType.getXmlNameTransformer();
-
+ info.setXmlJavaTypeAdapter(javaType.getXmlJavaTypeAdapter());
+ }
+
+ // handle class-level @XmlNullPolicy override
+ XmlNullPolicy xmlNullPolicy = javaType.getXmlNullPolicy();
+ if (null != xmlNullPolicy) {
+ info.setXmlNullPolicy(xmlNullPolicy);
+ }
+
+ // handle class-level @XmlElementNillable override
+ XmlElementNillable xmlElementNillable = javaType.getXmlElementNillable();
+ if (null != xmlElementNillable) {
+ info.setXmlElementNillable(xmlElementNillable.isNillable());
+ }
+
+ // handle class-level @XmlNameTransformer
+ String transformerClassName = javaType.getXmlNameTransformer();
+
XMLNameTransformer transformer = getXMLNameTransformerClassFromString(transformerClassName);
if(transformer != null){
info.setXmlNameTransformer(transformer);
@@ -405,9 +430,9 @@ public class XMLProcessor {
pkgToClassMap.remove(packageName);
}
- // now process remaining classes
- Iterator<ArrayList<JavaClass>> classIt = pkgToClassMap.values().iterator();
- while (classIt.hasNext()) {
+ // now process remaining classes
+ Iterator<ArrayList<JavaClass>> classIt = pkgToClassMap.values().iterator();
+ while (classIt.hasNext()) {
ArrayList<JavaClass> jClassList = classIt.next();
JavaClass[] jClassArray = (JavaClass[]) jClassList.toArray(new JavaClass[jClassList.size()]);
aProcessor.buildNewTypeInfo(jClassArray);
@@ -420,11 +445,11 @@ public class XMLProcessor {
for (Entry<String, TypeInfo> entry : typeInfos.entrySet()) {
JavaClass[] jClassArray;
for (Property prop : entry.getValue().getPropertyList()) {
- if (prop.isSetXmlJavaTypeAdapter()) {
- jClassArray = new JavaClass[] { prop.getActualType() };
- aProcessor.buildNewTypeInfo(jClassArray);
- }
- }
+ if (prop.isSetXmlJavaTypeAdapter()) {
+ jClassArray = new JavaClass[] { prop.getActualType() };
+ aProcessor.buildNewTypeInfo(jClassArray);
+ }
+ }
}
// now trigger the annotations processor to process the classes
@@ -438,7 +463,7 @@ public class XMLProcessor {
aProcessor.processPropertiesSuperClass(c, ti);
}
}
-
+
aProcessor.processPropertyTypes(jClasses.toArray(new JavaClass[jClasses.size()]));
aProcessor.finalizeProperties();
aProcessor.createElementsForTypeMappingInfo();
@@ -446,9 +471,9 @@ public class XMLProcessor {
}
private XMLNameTransformer getXMLNameTransformerClassFromString(String transformerClassName){
- XMLNameTransformer transformer = null;
- if(transformerClassName != null){
- Class nameTransformerClass;
+ XMLNameTransformer transformer = null;
+ if(transformerClassName != null){
+ Class nameTransformerClass;
try {
nameTransformerClass = Class.forName(transformerClassName);
@@ -741,9 +766,9 @@ public class XMLProcessor {
if (!xmlInverseReference.getType().equals(DEFAULT)) {
JavaClass pType = jModelInput.getJavaModel().getClass(xmlInverseReference.getType());
if (aProcessor.getHelper().isCollectionType(oldProperty.getType())) {
- oldProperty.setGenericType(pType);
- } else {
- oldProperty.setType(pType);
+ oldProperty.setGenericType(pType);
+ } else {
+ oldProperty.setType(pType);
}
oldProperty.setHasXmlElementType(true);
// may need to generate a type info for the type
@@ -751,9 +776,9 @@ public class XMLProcessor {
aProcessor.buildNewTypeInfo(new JavaClass[] { pType });
}
}
- return oldProperty;
- }
-
+ return oldProperty;
+ }
+
/**
* Handle xml-any-attribute.
*
@@ -1001,9 +1026,9 @@ public class XMLProcessor {
if (!xmlAttribute.getType().equals(DEFAULT)) {
JavaClass pType = jModelInput.getJavaModel().getClass(xmlAttribute.getType());
if (aProcessor.getHelper().isCollectionType(oldProperty.getType())) {
- oldProperty.setGenericType(pType);
- } else {
- oldProperty.setType(pType);
+ oldProperty.setGenericType(pType);
+ } else {
+ oldProperty.setType(pType);
}
oldProperty.setHasXmlElementType(true);
// may need to generate a type info for the type
@@ -1011,9 +1036,9 @@ public class XMLProcessor {
aProcessor.buildNewTypeInfo(new JavaClass[] { pType });
}
}
-
- reapplyPackageAndClassAdapters(oldProperty, typeInfo);
- // handle XmlJavaTypeAdapter
+
+ reapplyPackageAndClassAdapters(oldProperty, typeInfo);
+ // handle XmlJavaTypeAdapter
if (xmlAttribute.getXmlJavaTypeAdapter() != null) {
oldProperty.setXmlJavaTypeAdapter(xmlAttribute.getXmlJavaTypeAdapter());
}
@@ -1199,9 +1224,9 @@ public class XMLProcessor {
} else {
JavaClass pType = jModelInput.getJavaModel().getClass(xmlElement.getType());
if(aProcessor.getHelper().isCollectionType(oldProperty.getType())) {
- oldProperty.setGenericType(pType);
- } else {
- oldProperty.setType(pType);
+ oldProperty.setGenericType(pType);
+ } else {
+ oldProperty.setType(pType);
}
oldProperty.setHasXmlElementType(true);
// may need to generate a type info for the type
@@ -1209,9 +1234,9 @@ public class XMLProcessor {
aProcessor.buildNewTypeInfo(new JavaClass[] { pType });
}
}
-
- reapplyPackageAndClassAdapters(oldProperty, typeInfo);
- // handle XmlJavaTypeAdapter
+
+ reapplyPackageAndClassAdapters(oldProperty, typeInfo);
+ // handle XmlJavaTypeAdapter
if (xmlElement.getXmlJavaTypeAdapter() != null) {
try {
oldProperty.setXmlJavaTypeAdapter(xmlElement.getXmlJavaTypeAdapter());
@@ -1505,9 +1530,9 @@ public class XMLProcessor {
if (!xmlValue.getType().equals(DEFAULT)) {
JavaClass pType = jModelInput.getJavaModel().getClass(xmlValue.getType());
if (aProcessor.getHelper().isCollectionType(oldProperty.getType())) {
- oldProperty.setGenericType(pType);
- } else {
- oldProperty.setType(pType);
+ oldProperty.setGenericType(pType);
+ } else {
+ oldProperty.setType(pType);
}
oldProperty.setHasXmlElementType(true);
// may need to generate a type info for the type
@@ -1515,9 +1540,9 @@ public class XMLProcessor {
aProcessor.buildNewTypeInfo(new JavaClass[] { pType });
}
}
-
- reapplyPackageAndClassAdapters(oldProperty, info);
- // handle XmlJavaTypeAdapter
+
+ reapplyPackageAndClassAdapters(oldProperty, info);
+ // handle XmlJavaTypeAdapter
if (xmlValue.getXmlJavaTypeAdapter() != null) {
try {
oldProperty.setXmlJavaTypeAdapter(xmlValue.getXmlJavaTypeAdapter());
@@ -1647,9 +1672,9 @@ public class XMLProcessor {
if (!xmlJoinNodes.getType().equals(DEFAULT)) {
JavaClass pType = jModelInput.getJavaModel().getClass(xmlJoinNodes.getType());
if (aProcessor.getHelper().isCollectionType(oldProperty.getType())) {
- oldProperty.setGenericType(pType);
- } else {
- oldProperty.setType(pType);
+ oldProperty.setGenericType(pType);
+ } else {
+ oldProperty.setType(pType);
}
oldProperty.setHasXmlElementType(true);
// may need to generate a type info for the type
@@ -1657,9 +1682,9 @@ public class XMLProcessor {
aProcessor.buildNewTypeInfo(new JavaClass[] { pType });
}
}
- return oldProperty;
- }
-
+ return oldProperty;
+ }
+
/**
* Convenience method for building a Map of package to classes.
*
@@ -2038,9 +2063,9 @@ public class XMLProcessor {
* @param owningInfo the typeInfo that represents the owner of this property.
*/
public void reapplyPackageAndClassAdapters(Property prop, TypeInfo owningInfo) {
- if(prop.getXmlJavaTypeAdapter() != null) {
- //if there's already a property level adapter, don't apply package/class level
- return;
+ if(prop.getXmlJavaTypeAdapter() != null) {
+ //if there's already a property level adapter, don't apply package/class level
+ return;
}
JavaClass type = prop.getActualType();
//if a class level adapter is present on the target class, set it
@@ -2048,9 +2073,9 @@ public class XMLProcessor {
if(targetInfo != null) {
if(targetInfo.getXmlJavaTypeAdapter() != null) {
prop.setXmlJavaTypeAdapter(targetInfo.getXmlJavaTypeAdapter());
- }
- }
-
+ }
+ }
+
//check for package level adapter. Don't overwrite class level
if(owningInfo.hasPackageLevelAdaptersByClass()) {
JavaClass packageLevelAdapter = owningInfo.getPackageLevelAdaptersByClass().get(type.getQualifiedName());
@@ -2106,16 +2131,39 @@ public class XMLProcessor {
if(rootBindings.getXmlJavaTypeAdapters() == null) {
rootBindings.setXmlJavaTypeAdapters(nextBindings.getXmlJavaTypeAdapters());
- } else if(nextBindings.getXmlJavaTypeAdapters() != null){
- mergeXmlJavaTypeAdapters(rootBindings.getXmlJavaTypeAdapters(), nextBindings.getXmlJavaTypeAdapters());
- }
- }
- return rootBindings;
- }
-
- private static void mergeXmlJavaTypeAdapters(XmlJavaTypeAdapters xmlJavaTypeAdapters, XmlJavaTypeAdapters overrideAdapters) {
- List<XmlJavaTypeAdapter> adapterList = xmlJavaTypeAdapters.getXmlJavaTypeAdapter();
- HashMap<String, XmlJavaTypeAdapter> adapterMap = new HashMap<String, XmlJavaTypeAdapter>(adapterList.size());
+ } else if(nextBindings.getXmlJavaTypeAdapters() != null){
+ mergeXmlJavaTypeAdapters(rootBindings.getXmlJavaTypeAdapters(), nextBindings.getXmlJavaTypeAdapters());
+ }
+
+ if (rootBindings.getXmlNullPolicy() == null) {
+ rootBindings.setXmlNullPolicy(nextBindings.getXmlNullPolicy());
+ } else if (nextBindings.getXmlNullPolicy() != null) {
+ mergeXmlNullPolicy(rootBindings.getXmlNullPolicy(), nextBindings.getXmlNullPolicy());
+ }
+
+ if (rootBindings.getXmlElementNillable() == null) {
+ rootBindings.setXmlElementNillable(nextBindings.getXmlElementNillable());
+ } else if (nextBindings.getXmlElementNillable() != null) {
+ mergeXmlElementNillable(rootBindings.getXmlElementNillable(), nextBindings.getXmlElementNillable());
+ }
+ }
+ return rootBindings;
+ }
+
+ private static void mergeXmlElementNillable(XmlElementNillable xmlElementNillable, XmlElementNillable overrideXmlElementNillable) {
+ xmlElementNillable.setNillable(overrideXmlElementNillable.isNillable());
+ }
+
+ private static void mergeXmlNullPolicy(XmlNullPolicy xmlNullPolicy, XmlNullPolicy overrideXmlNullPolicy) {
+ xmlNullPolicy.setEmptyNodeRepresentsNull(overrideXmlNullPolicy.isEmptyNodeRepresentsNull());
+ xmlNullPolicy.setIsSetPerformedForAbsentNode(overrideXmlNullPolicy.isIsSetPerformedForAbsentNode());
+ xmlNullPolicy.setNullRepresentationForXml(overrideXmlNullPolicy.getNullRepresentationForXml());
+ xmlNullPolicy.setXsiNilRepresentsNull(overrideXmlNullPolicy.isXsiNilRepresentsNull());
+ }
+
+ private static void mergeXmlJavaTypeAdapters(XmlJavaTypeAdapters xmlJavaTypeAdapters, XmlJavaTypeAdapters overrideAdapters) {
+ List<XmlJavaTypeAdapter> adapterList = xmlJavaTypeAdapters.getXmlJavaTypeAdapter();
+ HashMap<String, XmlJavaTypeAdapter> adapterMap = new HashMap<String, XmlJavaTypeAdapter>(adapterList.size());
for(XmlJavaTypeAdapter next:adapterList) {
adapterMap.put(next.getType(), next);
}
@@ -2270,7 +2318,7 @@ public class XMLProcessor {
if(existingAttribute != null) {
attributes.getJavaAttribute().remove(existingAttribute);
}
- attributes.getJavaAttribute().add(next);
- }
- }
-} \ No newline at end of file
+ attributes.getJavaAttribute().add(next);
+ }
+ }
+}
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XmlNillableInfo.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XmlNillableInfo.java
new file mode 100644
index 0000000..256a47b
--- /dev/null
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/XmlNillableInfo.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.jaxb.compiler;
+
+import org.eclipse.persistence.jaxb.xmlmodel.XmlElementNillable;
+import org.eclipse.persistence.jaxb.xmlmodel.XmlNullPolicy;
+
+public class XmlNillableInfo {
+
+ private XmlElementNillable xmlElementNillable;
+ private XmlNullPolicy xmlNullPolicy;
+
+ public XmlElementNillable getXmlElementNillable() {
+ return xmlElementNillable;
+ }
+
+ public void setXmlElementNillable(XmlElementNillable xmlElementNillable) {
+ this.xmlElementNillable = xmlElementNillable;
+ }
+
+ public XmlNullPolicy getXmlNullPolicy() {
+ return xmlNullPolicy;
+ }
+
+ public void setXmlNullPolicy(XmlNullPolicy xmlNullPolicy) {
+ this.xmlNullPolicy = xmlNullPolicy;
+ }
+}
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/JavaType.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/JavaType.java
index 321cea9..9d18ce1 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/JavaType.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/JavaType.java
@@ -1,31 +1,36 @@
-/*******************************************************************************
- * Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
+/*******************************************************************************
+ * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dmccann - June 29/2009 - 2.0 - Initial implementation
- ******************************************************************************/
-package org.eclipse.persistence.jaxb.xmlmodel;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlList;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
+ *
+ * Contributors:
+ * dmccann - June 29/2009 - 2.0 - Initial implementation
+ * Martin Vojtek - July 8/2014 - 2.6 - Added XmlNullPolicy and XmlElementNillable
+ ******************************************************************************/
+package org.eclipse.persistence.jaxb.xmlmodel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlList;
+
+
+/**
+ * <p>
+ * Java class for anonymous complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ * <pre>
+ * &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;all>
@@ -45,12 +50,14 @@ import javax.xml.bind.annotation.XmlList;
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;element ref="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-named-object-graphs" minOccurs="0"/>
- * &lt;/all>
- * &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
- * &lt;attribute name="super-type" type="{http://www.w3.org/2001/XMLSchema}string" default="##default" />
+ * &lt;/complexType>
+ * &lt;/element>
+ * &lt;element ref="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-named-object-graphs" minOccurs="0"/>
+ * &lt;element ref="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-null-policy" minOccurs="0"/>
+ * &lt;element ref="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-element-nillable" minOccurs="0"/>
+ * &lt;/all>
+ * &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
+ * &lt;attribute name="super-type" type="{http://www.w3.org/2001/XMLSchema}string" default="##default" />
* &lt;attribute name="xml-accessor-order" type="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-access-order" default="UNDEFINED" />
* &lt;attribute name="xml-accessor-type" type="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-access-type" default="PUBLIC_MEMBER" />
* &lt;attribute name="xml-customizer" type="{http://www.w3.org/2001/XMLSchema}string" />
@@ -89,12 +96,16 @@ public class JavaType {
@javax.xml.bind.annotation.XmlElement(name = "xml-properties")
protected XmlProperties xmlProperties;
@javax.xml.bind.annotation.XmlElement(name = "java-attributes")
- protected JavaType.JavaAttributes javaAttributes;
- @javax.xml.bind.annotation.XmlElement(name = "xml-named-object-graphs")
- protected XmlNamedObjectGraphs xmlNamedObjectGraphs;
- @javax.xml.bind.annotation.XmlAttribute(name = "name")
- protected String name;
- @javax.xml.bind.annotation.XmlAttribute(name = "super-type")
+ protected JavaType.JavaAttributes javaAttributes;
+ @javax.xml.bind.annotation.XmlElement(name = "xml-named-object-graphs")
+ protected XmlNamedObjectGraphs xmlNamedObjectGraphs;
+ @javax.xml.bind.annotation.XmlElement(name = "xml-null-policy")
+ protected XmlNullPolicy xmlNullPolicy;
+ @javax.xml.bind.annotation.XmlElement(name = "xml-element-nillable")
+ protected XmlElementNillable xmlElementNillable;
+ @javax.xml.bind.annotation.XmlAttribute(name = "name")
+ protected String name;
+ @javax.xml.bind.annotation.XmlAttribute(name = "super-type")
protected String superType;
@javax.xml.bind.annotation.XmlAttribute(name = "xml-accessor-order")
protected XmlAccessOrder xmlAccessorOrder;
@@ -332,12 +343,54 @@ public class JavaType {
*/
public void setXmlNamedObjectGraphs(XmlNamedObjectGraphs value) {
this.xmlNamedObjectGraphs = value;
- }
-
- /**
- * Gets the value of the name property.
- *
- * @return
+ }
+
+ /**
+ * Gets the value of the xmlNullPolicy property.
+ *
+ * @return possible object is {@link XmlNullPolicy }
+ *
+ */
+ public XmlNullPolicy getXmlNullPolicy() {
+ return xmlNullPolicy;
+ }
+
+ /**
+ * Sets the value of the xmlNullPolicy property.
+ *
+ * @param value
+ * allowed object is {@link XmlNullPolicy }
+ *
+ */
+ public void setXmlNullPolicy(XmlNullPolicy value) {
+ this.xmlNullPolicy = value;
+ }
+
+ /**
+ * Gets the value of the xmlElementNillable property.
+ *
+ * @return possible object is {@link XmlElementNillable }
+ *
+ */
+ public XmlElementNillable getXmlElementNillable() {
+ return xmlElementNillable;
+ }
+
+ /**
+ * Sets the value of the xmlElementNillable property.
+ *
+ * @param value
+ * allowed object is {@link XmlElementNillable }
+ *
+ */
+ public void setXmlElementNillable(XmlElementNillable value) {
+ this.xmlElementNillable = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
* possible object is
* {@link String }
*
@@ -700,7 +753,7 @@ public class JavaType {
}
return this.javaAttribute;
}
-
- }
-
-} \ No newline at end of file
+
+ }
+
+}
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlBindings.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlBindings.java
index 60621a0..9a8407d 100644
--- a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlBindings.java
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlBindings.java
@@ -6,28 +6,33 @@
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * dmccann - June 29/2009 - 2.0 - Initial implementation
- ******************************************************************************/
-package org.eclipse.persistence.jaxb.xmlmodel;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
+ *
+ * Contributors:
+ * dmccann - June 29/2009 - 2.0 - Initial implementation
+ * Martin Vojtek - July 8/2014 - 2.6 - Added XmlNullPolicy and XmlElementNillable
+ ******************************************************************************/
+package org.eclipse.persistence.jaxb.xmlmodel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-
-
-/**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType>
+
+
+/**
+ * <p>
+ * Java class for anonymous complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ *
+ * <pre>
+ * &lt;complexType>
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;all>
@@ -65,12 +70,14 @@ import javax.xml.bind.annotation.XmlType;
* &lt;element ref="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}java-type" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
- * &lt;/complexContent>
- * &lt;/complexType>
- * &lt;/element>
- * &lt;/all>
- * &lt;attribute name="xml-accessor-type" type="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-access-type" default="PUBLIC_MEMBER" />
- * &lt;attribute name="xml-accessor-order" type="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-access-order" default="UNDEFINED" />
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * &lt;/element>
+ * &lt;element ref="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-null-policy" minOccurs="0"/>
+ * &lt;element ref="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-element-nillable" minOccurs="0"/>
+ * &lt;/all>
+ * &lt;attribute name="xml-accessor-type" type="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-access-type" default="PUBLIC_MEMBER" />
+ * &lt;attribute name="xml-accessor-order" type="{http://www.eclipse.org/eclipselink/xsds/persistence/oxm}xml-access-order" default="UNDEFINED" />
* &lt;attribute name="xml-mapping-metadata-complete" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="package-name" type="{http://www.w3.org/2001/XMLSchema}string" default="##default" />
* &lt;attribute name="xml-name-transformer" type="{http://www.w3.org/2001/XMLSchema}string" />
@@ -99,12 +106,16 @@ public class XmlBindings {
@XmlElement(name = "xml-registries")
protected XmlBindings.XmlRegistries xmlRegistries;
@XmlElement(name = "xml-enums")
- protected XmlBindings.XmlEnums xmlEnums;
- @XmlElement(name = "java-types")
- protected XmlBindings.JavaTypes javaTypes;
- @XmlAttribute(name = "xml-accessor-type")
- protected org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType xmlAccessorType;
- @XmlAttribute(name = "xml-accessor-order")
+ protected XmlBindings.XmlEnums xmlEnums;
+ @XmlElement(name = "java-types")
+ protected XmlBindings.JavaTypes javaTypes;
+ @XmlElement(name = "xml-null-policy")
+ protected XmlNullPolicy xmlNullPolicy;
+ @XmlElement(name = "xml-element-nillable")
+ protected XmlElementNillable xmlElementNillable;
+ @XmlAttribute(name = "xml-accessor-type")
+ protected org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType xmlAccessorType;
+ @XmlAttribute(name = "xml-accessor-order")
protected XmlAccessOrder xmlAccessorOrder;
@XmlAttribute(name = "xml-mapping-metadata-complete")
protected Boolean xmlMappingMetadataComplete;
@@ -279,12 +290,54 @@ public class XmlBindings {
*/
public void setJavaTypes(XmlBindings.JavaTypes value) {
this.javaTypes = value;
- }
-
- /**
- * Gets the value of the xmlAccessorType property.
- *
- * @return
+ }
+
+ /**
+ * Gets the value of the xmlNullPolicy property.
+ *
+ * @return possible object is {@link XmlNullPolicy }
+ *
+ */
+ public XmlNullPolicy getXmlNullPolicy() {
+ return xmlNullPolicy;
+ }
+
+ /**
+ * Sets the value of the xmlNullPolicy property.
+ *
+ * @param value
+ * allowed object is {@link XmlNullPolicy }
+ *
+ */
+ public void setXmlNullPolicy(XmlNullPolicy value) {
+ this.xmlNullPolicy = value;
+ }
+
+ /**
+ * Gets the value of the xmlElementNillable property.
+ *
+ * @return possible object is {@link XmlElementNillable }
+ *
+ */
+ public XmlElementNillable getXmlElementNillable() {
+ return xmlElementNillable;
+ }
+
+ /**
+ * Sets the value of the xmlElementNillable property.
+ *
+ * @param value
+ * allowed object is {@link XmlElementNillable }
+ *
+ */
+ public void setXmlElementNillable(XmlElementNillable value) {
+ this.xmlElementNillable = value;
+ }
+
+ /**
+ * Gets the value of the xmlAccessorType property.
+ *
+ * @return
* possible object is
* {@link org.eclipse.persistence.jaxb.xmlmodel.XmlAccessType }
*
diff --git a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlElementNillable.java b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlElementNillable.java
new file mode 100644
index 0000000..671b0ef
--- /dev/null
+++ b/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/xmlmodel/XmlElementNillable.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Martin Vojtek - July 8/2014
+ ******************************************************************************/
+package org.eclipse.persistence.jaxb.xmlmodel;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * <p>
+ * Java class for anonymous complex type.
+ * </p>
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
+ * </p>
+ * <pre>
+ * &lt;complexType>
+ * &lt;complexContent>
+ * &lt;attribute name="nillable" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" use="optional" />
+ * &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlRootElement(name = "xml-element-nillable")
+public class XmlElementNillable {
+
+ @XmlAttribute(name = "nillable")
+ protected Boolean nillable = true;
+
+ /**
+ * Gets the value of the nillable property.
+ *
+ * @return possible object is {@link Boolean }
+ *
+ */
+ public boolean isNillable() {
+ if (nillable == null) {
+ return false;
+ } else {
+ return nillable;
+ }
+ }
+
+ /**
+ * Sets the value of the nillable property.
+ *
+ * @param value
+ * allowed object is {@link Boolean }
+ *
+ */
+ public void setNillable(Boolean value) {
+ this.nillable = value;
+ }
+}