Java Code Examples for com.sun.xml.internal.bind.v2.ContextFactory#createContext()

The following examples show how to use com.sun.xml.internal.bind.v2.ContextFactory#createContext() . 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: JAXBRIContextFactory.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 2
Source File: JAXBRIContextFactory.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 3
Source File: JAXBRIContextFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 4
Source File: JAXBRIContextFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 5
Source File: JAXBRIContextFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 6
Source File: JAXBRIContextFactory.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 7
Source File: JAXBRIContextFactory.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 8
Source File: JAXBRIContextFactory.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[bi.contentClasses().size()]);
    for (int i = 0; i < classes.length; i++) {
        if (WrapperComposite.class.equals(classes[i])) {
            classes[i] = CompositeStructure.class;
        }
    }
    Map<TypeInfo, TypeReference> typeInfoMappings = typeInfoMappings(bi.typeInfos());
    Map<Class, Class> subclassReplacements = bi.subclassReplacements();
    String defaultNamespaceRemap = bi.getDefaultNamespace();
    Boolean c14nSupport = (Boolean) bi.properties().get("c14nSupport");
    RuntimeAnnotationReader ar = (RuntimeAnnotationReader) bi.properties().get("com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader");
    JAXBContextFactory jaxbContextFactory = (JAXBContextFactory) bi.properties().get(JAXBContextFactory.class.getName());
    try {
        JAXBRIContext context = (jaxbContextFactory != null)
                ? jaxbContextFactory.createJAXBContext(
                bi.getSEIModel(),
                toList(classes),
                toList(typeInfoMappings.values()))
                : ContextFactory.createContext(
                classes, typeInfoMappings.values(),
                subclassReplacements, defaultNamespaceRemap,
                (c14nSupport != null) ? c14nSupport : false,
                ar, false, false, false);
        return new JAXBRIContextWrapper(context, typeInfoMappings);
    } catch (Exception e) {
        throw new DatabindingException(e);
    }
}
 
Example 9
Source File: JAXBRIContext.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
 
Example 10
Source File: JAXBRIContext.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
 
Example 11
Source File: JAXBRIContext.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
 
Example 12
Source File: JAXBRIContext.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
 
Example 13
Source File: JAXBRIContext.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
 
Example 14
Source File: JAXBRIContext.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
 
Example 15
Source File: JAXBRIContext.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}
 
Example 16
Source File: JAXBRIContext.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new {@link JAXBRIContext}.
 *
 * <p>
 * {@link JAXBContext#newInstance(Class[]) JAXBContext.newInstance()} methods may
 * return other JAXB providers that are not compatible with the JAX-RPC RI.
 * This method guarantees that the JAX-WS RI will finds the JAXB RI.
 *
 * @param classes
 *      Classes to be bound. See {@link JAXBContext#newInstance(Class[])} for the meaning.
 * @param typeRefs
 *      See {@link #TYPE_REFERENCES} for the meaning of this parameter.
 *      Can be null.
 * @param subclassReplacements
 *      See {@link #SUBCLASS_REPLACEMENTS} for the meaning of this parameter.
 *      Can be null.
 * @param defaultNamespaceRemap
 *      See {@link #DEFAULT_NAMESPACE_REMAP} for the meaning of this parameter.
 *      Can be null (and should be null for ordinary use of JAXB.)
 * @param c14nSupport
 *      See {@link #CANONICALIZATION_SUPPORT} for the meaning of this parameter.
 * @param ar
 *      See {@link #ANNOTATION_READER} for the meaning of this parameter.
 *      Can be null.
 * @param xmlAccessorFactorySupport
 *      See {@link #XMLACCESSORFACTORY_SUPPORT} for the meaning of this parameter.
 * @param allNillable
 *      See {@link #TREAT_EVERYTHING_NILLABLE} for the meaning of this parameter.
 * @param retainPropertyInfo
 *      See {@link #RETAIN_REFERENCE_TO_INFO} for the meaning of this parameter.
 * @param supressAccessorWarnings
 *      See {@link #SUPRESS_ACCESSOR_WARNINGS} for the meaning of this parameter.
 */
public static JAXBRIContext newInstance(@NotNull Class[] classes,
   @Nullable Collection<TypeReference> typeRefs,
   @Nullable Map<Class,Class> subclassReplacements,
   @Nullable String defaultNamespaceRemap, boolean c14nSupport,
   @Nullable RuntimeAnnotationReader ar,
   boolean xmlAccessorFactorySupport,
   boolean allNillable,
   boolean retainPropertyInfo,
   boolean supressAccessorWarnings) throws JAXBException {
    Map<String, Object> properties = new HashMap<String, Object>();
    if (typeRefs != null) properties.put(JAXBRIContext.TYPE_REFERENCES, typeRefs);
    if (subclassReplacements != null) properties.put(JAXBRIContext.SUBCLASS_REPLACEMENTS, subclassReplacements);
    if (defaultNamespaceRemap != null) properties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, defaultNamespaceRemap);
    if (ar != null) properties.put(JAXBRIContext.ANNOTATION_READER, ar);
    properties.put(JAXBRIContext.CANONICALIZATION_SUPPORT, Boolean.valueOf(c14nSupport));
    properties.put(JAXBRIContext.XMLACCESSORFACTORY_SUPPORT, Boolean.valueOf(xmlAccessorFactorySupport));
    properties.put(JAXBRIContext.TREAT_EVERYTHING_NILLABLE, Boolean.valueOf(allNillable));
    properties.put(JAXBRIContext.RETAIN_REFERENCE_TO_INFO, Boolean.valueOf(retainPropertyInfo));
    properties.put(JAXBRIContext.SUPRESS_ACCESSOR_WARNINGS, Boolean.valueOf(supressAccessorWarnings));
    return (JAXBRIContext) ContextFactory.createContext(classes, properties);
}