Java Code Examples for com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl#JAXBContextBuilder
The following examples show how to use
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl#JAXBContextBuilder .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContextFactory.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 2
Source File: ContextFactory.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 3
Source File: ContextFactory.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 4
Source File: ContextFactory.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 5
Source File: ContextFactory.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use {@code createContext( Class[] classes, Map<String,Object> properties)} method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 6
Source File: ContextFactory.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 7
Source File: ContextFactory.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 8
Source File: ContextFactory.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * * @param classes * @param typeRefs * @param subclassReplacements * @param defaultNsUri * @param c14nSupport * @param ar * @param xmlAccessorFactorySupport * @param allNillable * @param retainPropertyInfo * @param improvedXsiTypeHandling * @return * @throws JAXBException * @deprecated use createContext( Class[] classes, Map<String,Object> properties) method instead */ @Deprecated public static JAXBRIContext createContext( Class[] classes, Collection<TypeReference> typeRefs, Map<Class,Class> subclassReplacements, String defaultNsUri, boolean c14nSupport, RuntimeAnnotationReader ar, boolean xmlAccessorFactorySupport, boolean allNillable, boolean retainPropertyInfo, boolean improvedXsiTypeHandling) throws JAXBException { JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(typeRefs); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); return builder.build(); }
Example 9
Source File: ContextFactory.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); }
Example 10
Source File: ContextFactory.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); }
Example 11
Source File: ContextFactory.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); }
Example 12
Source File: ContextFactory.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); }
Example 13
Source File: ContextFactory.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } Boolean backupWithParentNamespace = getPropertyValue(properties, JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE, Boolean.class); RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); builder.setBackupWithParentNamespace(backupWithParentNamespace); return builder.build(); }
Example 14
Source File: ContextFactory.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); }
Example 15
Source File: ContextFactory.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); }
Example 16
Source File: ContextFactory.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * The API will invoke this method via reflection */ public static JAXBContext createContext(Class[] classes, Map<String,Object> properties ) throws JAXBException { // fool-proof check, and copy the map to make it easier to find unrecognized properties. if(properties==null) properties = Collections.emptyMap(); else properties = new HashMap<String,Object>(properties); String defaultNsUri = getPropertyValue(properties,JAXBRIContext.DEFAULT_NAMESPACE_REMAP,String.class); Boolean c14nSupport = getPropertyValue(properties,JAXBRIContext.CANONICALIZATION_SUPPORT,Boolean.class); if(c14nSupport==null) c14nSupport = false; Boolean disablesecurityProcessing = getPropertyValue(properties, JAXBRIContext.DISABLE_XML_SECURITY, Boolean.class); if (disablesecurityProcessing==null) disablesecurityProcessing = false; Boolean allNillable = getPropertyValue(properties,JAXBRIContext.TREAT_EVERYTHING_NILLABLE,Boolean.class); if(allNillable==null) allNillable = false; Boolean retainPropertyInfo = getPropertyValue(properties, JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.class); if(retainPropertyInfo==null) retainPropertyInfo = false; Boolean supressAccessorWarnings = getPropertyValue(properties, JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.class); if(supressAccessorWarnings==null) supressAccessorWarnings = false; Boolean improvedXsiTypeHandling = getPropertyValue(properties, JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING, Boolean.class); if (improvedXsiTypeHandling == null) { String improvedXsiSystemProperty = Util.getSystemProperty(JAXBRIContext.IMPROVED_XSI_TYPE_HANDLING); if (improvedXsiSystemProperty == null) { improvedXsiTypeHandling = true; } else { improvedXsiTypeHandling = Boolean.valueOf(improvedXsiSystemProperty); } } Boolean xmlAccessorFactorySupport = getPropertyValue(properties, JAXBRIContext.XMLACCESSORFACTORY_SUPPORT,Boolean.class); if(xmlAccessorFactorySupport==null){ xmlAccessorFactorySupport = false; Util.getClassLogger().log(Level.FINE, "Property " + JAXBRIContext.XMLACCESSORFACTORY_SUPPORT + "is not active. Using JAXB's implementation"); } RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection<TypeReference> tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); if (tr == null) { tr = Collections.<TypeReference>emptyList(); } Map<Class,Class> subclassReplacements; try { subclassReplacements = TypeCast.checkedCast( getPropertyValue(properties, JAXBRIContext.SUBCLASS_REPLACEMENTS, Map.class), Class.class, Class.class); } catch (ClassCastException e) { throw new JAXBException(Messages.INVALID_TYPE_IN_MAP.format(),e); } if(!properties.isEmpty()) { throw new JAXBException(Messages.UNSUPPORTED_PROPERTY.format(properties.keySet().iterator().next())); } JAXBContextImpl.JAXBContextBuilder builder = new JAXBContextImpl.JAXBContextBuilder(); builder.setClasses(classes); builder.setTypeRefs(tr); builder.setSubclassReplacements(subclassReplacements); builder.setDefaultNsUri(defaultNsUri); builder.setC14NSupport(c14nSupport); builder.setAnnotationReader(ar); builder.setXmlAccessorFactorySupport(xmlAccessorFactorySupport); builder.setAllNillable(allNillable); builder.setRetainPropertyInfo(retainPropertyInfo); builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); return builder.build(); }