1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/bind/api/JAXBRIContext.java Thu Apr 04 19:05:24 2013 -0700 1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/bind/api/JAXBRIContext.java Tue Apr 09 14:51:13 2013 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -47,6 +47,7 @@ 1.11 import com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader; 1.12 import com.sun.xml.internal.bind.v2.model.nav.Navigator; 1.13 import com.sun.xml.internal.bind.v2.model.runtime.RuntimeTypeInfoSet; 1.14 +import java.util.HashMap; 1.15 1.16 /** 1.17 * {@link JAXBContext} enhanced with JAXB RI specific functionalities. 1.18 @@ -93,7 +94,7 @@ 1.19 @Nullable Map<Class,Class> subclassReplacements, 1.20 @Nullable String defaultNamespaceRemap, boolean c14nSupport, 1.21 @Nullable RuntimeAnnotationReader ar) throws JAXBException { 1.22 - return ContextFactory.createContext(classes, typeRefs, subclassReplacements, 1.23 + return newInstance(classes, typeRefs, subclassReplacements, 1.24 defaultNamespaceRemap, c14nSupport, ar, false, false, false, false); 1.25 } 1.26 1.27 @@ -135,9 +136,21 @@ 1.28 @Nullable Map<Class,Class> subclassReplacements, 1.29 @Nullable String defaultNamespaceRemap, boolean c14nSupport, 1.30 @Nullable RuntimeAnnotationReader ar, 1.31 - boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean supressAccessorWarnings) throws JAXBException { 1.32 - return ContextFactory.createContext(classes, typeRefs, subclassReplacements, 1.33 - defaultNamespaceRemap, c14nSupport, ar, xmlAccessorFactorySupport, allNillable, retainPropertyInfo, supressAccessorWarnings); 1.34 + boolean xmlAccessorFactorySupport, 1.35 + boolean allNillable, 1.36 + boolean retainPropertyInfo, 1.37 + boolean supressAccessorWarnings) throws JAXBException { 1.38 + Map<String, Object> properties = new HashMap<String, Object>(); 1.39 + if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs); 1.40 + if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements); 1.41 + if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap); 1.42 + if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar); 1.43 + properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport)); 1.44 + properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport)); 1.45 + properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable)); 1.46 + properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo)); 1.47 + properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings)); 1.48 + return (JAXBRIContext) ContextFactory.createContext(classes, properties); 1.49 } 1.50 1.51 /** 1.52 @@ -407,7 +420,6 @@ 1.53 return Navigator.REFLECTION.getBaseClass(type,baseType); 1.54 } 1.55 1.56 - 1.57 /** 1.58 * The property that you can specify to {@link JAXBContext#newInstance} 1.59 * to reassign the default namespace URI to something else at the runtime. 1.60 @@ -441,6 +453,7 @@ 1.61 * and {@link Marshaller#setProperty(String, Object)} 1.62 * to enable the c14n marshalling support in the {@link JAXBContext}. 1.63 * 1.64 + * Boolean 1.65 * @see C14nSupport_ArchitectureDocument 1.66 * @since 2.0 EA2 1.67 */ 1.68 @@ -451,6 +464,7 @@ 1.69 * to allow unmarshaller to honor <tt>xsi:nil</tt> anywhere, even if they are 1.70 * not specifically allowed by the schema. 1.71 * 1.72 + * Boolean 1.73 * @since 2.1.3 1.74 */ 1.75 public static final String TREAT_EVERYTHING_NILLABLE = "com.sun.xml.internal.bind.treatEverythingNillable"; 1.76 @@ -492,6 +506,7 @@ 1.77 /** 1.78 * Retains references to PropertyInfos. 1.79 * 1.80 + * Boolean 1.81 * @since 2.1.10 1.82 */ 1.83 public static final String RETAIN_REFERENCE_TO_INFO = "retainReferenceToInfo"; 1.84 @@ -499,6 +514,7 @@ 1.85 /** 1.86 * Supress security warnings when trying to access fields through reflection. 1.87 * 1.88 + * Boolean 1.89 * @since 2.1.14, 2.2.2 1.90 */ 1.91 public static final String SUPRESS_ACCESSOR_WARNINGS = "supressAccessorWarnings"; 1.92 @@ -506,8 +522,17 @@ 1.93 /** 1.94 * Improves handling of xsi:type used on leaf properties. 1.95 * 1.96 + * Boolean 1.97 * @since 2.2.3 1.98 */ 1.99 public static final String IMPROVED_XSI_TYPE_HANDLING = "com.sun.xml.internal.bind.improvedXsiTypeHandling"; 1.100 1.101 + /** 1.102 + * If true XML security features when parsing XML documents will be disabled. 1.103 + * The default value is false. 1.104 + * 1.105 + * Boolean 1.106 + * @since 2.2.6 1.107 + */ 1.108 + public static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; 1.109 }