Search in sources :

Example 6 with DatabindingException

use of com.sun.xml.ws.spi.db.DatabindingException in project metro-jax-ws by eclipse-ee4j.

the class JAXBRIContextFactory method newContext.

@Override
public BindingContext newContext(BindingInfo bi) {
    Class[] classes = bi.contentClasses().toArray(new Class[0]);
    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("org.glassfish.jaxb.runtime.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);
    }
}
Also used : TypeInfo(com.sun.xml.ws.spi.db.TypeInfo) DatabindingException(com.sun.xml.ws.spi.db.DatabindingException) JAXBRIContext(org.glassfish.jaxb.runtime.api.JAXBRIContext) DatabindingException(com.sun.xml.ws.spi.db.DatabindingException) RuntimeAnnotationReader(org.glassfish.jaxb.runtime.v2.model.annotation.RuntimeAnnotationReader) JAXBContextFactory(com.sun.xml.ws.developer.JAXBContextFactory) TypeReference(org.glassfish.jaxb.runtime.api.TypeReference)

Aggregations

DatabindingException (com.sun.xml.ws.spi.db.DatabindingException)6 TypeInfo (com.sun.xml.ws.spi.db.TypeInfo)2 WrapperComposite (com.sun.xml.ws.spi.db.WrapperComposite)2 XmlElement (jakarta.xml.bind.annotation.XmlElement)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)1 DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)1 DummyAnnotations (com.sun.xml.ws.base.DummyAnnotations)1 JAXBContextFactory (com.sun.xml.ws.developer.JAXBContextFactory)1 ParameterImpl (com.sun.xml.ws.model.ParameterImpl)1 WrapperParameter (com.sun.xml.ws.model.WrapperParameter)1 RepeatedElementBridge (com.sun.xml.ws.spi.db.RepeatedElementBridge)1 HelloImpl (com.sun.xml.ws.test.HelloImpl)1 HelloPort (com.sun.xml.ws.test.HelloPort)1 JAXBContext (jakarta.xml.bind.JAXBContext)1 JAXBException (jakarta.xml.bind.JAXBException)1 XmlRootElement (jakarta.xml.bind.annotation.XmlRootElement)1 XmlType (jakarta.xml.bind.annotation.XmlType)1 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)1 GenericArrayType (java.lang.reflect.GenericArrayType)1