jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java
changeset 43852 93a527059d8a
parent 32795 5a5710ee05a0
--- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Fri Feb 10 00:39:51 2017 -0800
+++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java	Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -242,6 +242,16 @@
     private Set<XmlNs> xmlNsSet = null;
 
     /**
+     * If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified.
+     * The default value is null for System {code}com.sun.xml.internal.bind.backupWithParentNamespace{code} property to be used,
+     * and false is assumed if it's not set either.
+     *
+     * Boolean
+     * @since 2.3.0
+     */
+    public Boolean backupWithParentNamespace = null;
+
+    /**
      * Returns declared XmlNs annotations (from package-level annotation XmlSchema
      *
      * @return set of all present XmlNs annotations
@@ -263,6 +273,7 @@
         this.supressAccessorWarnings = builder.supressAccessorWarnings;
         this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling;
         this.disableSecurityProcessing = builder.disableSecurityProcessing;
+        this.backupWithParentNamespace = builder.backupWithParentNamespace;
 
         Collection<TypeReference> typeRefs = builder.typeRefs;
 
@@ -1024,6 +1035,7 @@
         private boolean allNillable;
         private boolean improvedXsiTypeHandling = true;
         private boolean disableSecurityProcessing = true;
+        private Boolean backupWithParentNamespace = null; // null for System property to be used
 
         public JAXBContextBuilder() {};
 
@@ -1039,6 +1051,7 @@
             this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport;
             this.allNillable = baseImpl.allNillable;
             this.disableSecurityProcessing = baseImpl.disableSecurityProcessing;
+            this.backupWithParentNamespace = baseImpl.backupWithParentNamespace;
         }
 
         public JAXBContextBuilder setRetainPropertyInfo(boolean val) {
@@ -1101,6 +1114,11 @@
             return this;
         }
 
+        public JAXBContextBuilder setBackupWithParentNamespace(Boolean backupWithParentNamespace) {
+            this.backupWithParentNamespace = backupWithParentNamespace;
+            return this;
+        }
+
         public JAXBContextImpl build() throws JAXBException {
 
             // fool-proof