com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader Java Examples

The following examples show how to use com.sun.xml.internal.bind.v2.model.annotation.RuntimeAnnotationReader. 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 openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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 openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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 #4
Source File: ContextFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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 #6
Source File: ContextFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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 jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @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: 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 #10
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 #11
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 #12
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 #13
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 #14
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 #15
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 #16
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 #17
Source File: JAXBContextImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public JAXBContextBuilder setAnnotationReader(RuntimeAnnotationReader val) {
    this.annotationReader = val;
    return this;
}
 
Example #18
Source File: JAXBContextImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public JAXBContextBuilder setAnnotationReader(RuntimeAnnotationReader val) {
    this.annotationReader = val;
    return this;
}
 
Example #19
Source File: RuntimeModelBuilder.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap) {
    super(annotationReader, Utils.REFLECTION_NAVIGATOR, subclassReplacements, defaultNamespaceRemap);
    this.context = context;
}
 
Example #20
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 #21
Source File: JAXBContextImpl.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public JAXBContextBuilder setAnnotationReader(RuntimeAnnotationReader val) {
    this.annotationReader = val;
    return this;
}
 
Example #22
Source File: ContextFactory.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #23
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);
}
 
Example #24
Source File: JAXBContextImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public JAXBContextBuilder setAnnotationReader(RuntimeAnnotationReader val) {
    this.annotationReader = val;
    return this;
}
 
Example #25
Source File: RuntimeModelBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap) {
    super(annotationReader, Utils.REFLECTION_NAVIGATOR, subclassReplacements, defaultNamespaceRemap);
    this.context = context;
}
 
Example #26
Source File: ContextFactory.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #27
Source File: ContextFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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 #28
Source File: RuntimeModelBuilder.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public RuntimeModelBuilder(JAXBContextImpl context, RuntimeAnnotationReader annotationReader, Map<Class, Class> subclassReplacements, String defaultNamespaceRemap) {
    super(annotationReader, Utils.REFLECTION_NAVIGATOR, subclassReplacements, defaultNamespaceRemap);
    this.context = context;
}
 
Example #29
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 #30
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);
}