Class JAXBDataBinding

java.lang.Object
org.apache.cxf.databinding.AbstractDataBinding
org.apache.cxf.databinding.AbstractInterceptorProvidingDataBinding
org.apache.cxf.jaxb.JAXBDataBinding
All Implemented Interfaces:
org.apache.cxf.databinding.DataBinding, org.apache.cxf.databinding.WrapperCapableDatabinding, org.apache.cxf.interceptor.InterceptorProvider

public class JAXBDataBinding extends org.apache.cxf.databinding.AbstractInterceptorProvidingDataBinding implements org.apache.cxf.databinding.WrapperCapableDatabinding, org.apache.cxf.interceptor.InterceptorProvider
  • Field Details

  • Constructor Details

    • JAXBDataBinding

      public JAXBDataBinding()
    • JAXBDataBinding

      public JAXBDataBinding(boolean q)
    • JAXBDataBinding

      public JAXBDataBinding(Class<?>... classes) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • JAXBDataBinding

      public JAXBDataBinding(boolean qualified, Map<String,Object> props) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • JAXBDataBinding

      public JAXBDataBinding(jakarta.xml.bind.JAXBContext context)
  • Method Details

    • getQualifiedSchemas

      protected boolean getQualifiedSchemas()
    • getContext

      public jakarta.xml.bind.JAXBContext getContext()
    • setContext

      public final void setContext(jakarta.xml.bind.JAXBContext ctx)
    • getEscapeHandler

      public Object getEscapeHandler()
    • setEscapeHandler

      public void setEscapeHandler(Object handler)
    • applyEscapeHandler

      public void applyEscapeHandler(boolean escape, Consumer<Object> consumer)
    • createWriter

      public <T> org.apache.cxf.databinding.DataWriter<T> createWriter(Class<T> c)
      Specified by:
      createWriter in interface org.apache.cxf.databinding.DataBinding
    • getSupportedWriterFormats

      public Class<?>[] getSupportedWriterFormats()
      Specified by:
      getSupportedWriterFormats in interface org.apache.cxf.databinding.DataBinding
    • createReader

      public <T> org.apache.cxf.databinding.DataReader<T> createReader(Class<T> c)
      Specified by:
      createReader in interface org.apache.cxf.databinding.DataBinding
    • getSupportedReaderFormats

      public Class<?>[] getSupportedReaderFormats()
      Specified by:
      getSupportedReaderFormats in interface org.apache.cxf.databinding.DataBinding
    • initialize

      public void initialize(org.apache.cxf.service.Service service)
      Specified by:
      initialize in interface org.apache.cxf.databinding.DataBinding
    • justCheckForJAXBAnnotations

      protected void justCheckForJAXBAnnotations(org.apache.cxf.service.model.ServiceInfo serviceInfo)
    • getNamespaceToUse

      protected String getNamespaceToUse(org.apache.cxf.service.Service service)
    • setExtraClass

      public void setExtraClass(Class<?>[] userExtraClass)
    • getExtraClass

      public Class<?>[] getExtraClass()
    • createJAXBContext

      public jakarta.xml.bind.JAXBContext createJAXBContext(Set<Class<?>> classes) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • createJAXBContext

      public jakarta.xml.bind.JAXBContext createJAXBContext(Set<Class<?>> classes, String defaultNs) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • createJAXBContextAndSchemas

      public org.apache.cxf.common.jaxb.JAXBContextCache.CachedContextAndSchemas createJAXBContextAndSchemas(Set<Class<?>> classes, String defaultNs) throws jakarta.xml.bind.JAXBException
      Throws:
      jakarta.xml.bind.JAXBException
    • getContextClasses

      public Set<Class<?>> getContextClasses()
    • getContextProperties

      public Map<String,Object> getContextProperties()
      Return a map of properties. These properties are passed to JAXBContext.newInstance when this object creates a context.
      Returns:
      the map of JAXB context properties.
    • setContextProperties

      public void setContextProperties(Map<String,Object> contextProperties)
      Set a map of JAXB context properties. These properties are passed to JAXBContext.newInstance when this object creates a context. Note that if you create a JAXB context elsewhere, you will not respect these properties unless you handle it manually.
      Parameters:
      contextProperties - map of properties.
    • getConfiguredXmlAdapters

      public List<jakarta.xml.bind.annotation.adapters.XmlAdapter<?,?>> getConfiguredXmlAdapters()
    • setConfiguredXmlAdapters

      public void setConfiguredXmlAdapters(List<jakarta.xml.bind.annotation.adapters.XmlAdapter<?,?>> adpters)
    • getMarshallerProperties

      public Map<String,Object> getMarshallerProperties()
      Return a map of properties. These properties are set into the JAXB Marshaller (via Marshaller.setProperty(...) when the marshaller is created.
      Returns:
      the map of JAXB marshaller properties.
    • setMarshallerProperties

      public void setMarshallerProperties(Map<String,Object> marshallerProperties)
      Set a map of JAXB marshaller properties. These properties are set into the JAXB Marshaller (via Marshaller.setProperty(...) when the marshaller is created.
      Parameters:
      marshallerProperties - map of properties.
    • getUnmarshallerProperties

      public Map<String,Object> getUnmarshallerProperties()
      Return a map of properties. These properties are set into the JAXB Unmarshaller (via Unmarshaller.setProperty(...) when the unmarshaller is created.
      Returns:
      the map of JAXB unmarshaller properties.
    • setUnmarshallerProperties

      public void setUnmarshallerProperties(Map<String,Object> unmarshallerProperties)
      Set a map of JAXB unmarshaller properties. These properties are set into the JAXB Unmarshaller (via Unmarshaller.setProperty(...) when the unmarshaller is created.
      Parameters:
      unmarshallerProperties - map of properties.
    • getUnmarshallerListener

      public jakarta.xml.bind.Unmarshaller.Listener getUnmarshallerListener()
      Returns the Unmarshaller.Listener that will be registered on the Unmarshallers
      Returns:
    • setUnmarshallerListener

      public void setUnmarshallerListener(jakarta.xml.bind.Unmarshaller.Listener unmarshallerListener)
      Sets the Unmarshaller.Listener that will be registered on the Unmarshallers
      Parameters:
      unmarshallerListener -
    • getMarshallerListener

      public jakarta.xml.bind.Marshaller.Listener getMarshallerListener()
      Returns the Marshaller.Listener that will be registered on the Marshallers
      Returns:
    • setMarshallerListener

      public void setMarshallerListener(jakarta.xml.bind.Marshaller.Listener marshallerListener)
      Sets the Marshaller.Listener that will be registered on the Marshallers
      Parameters:
      marshallerListener -
    • getValidationEventHandler

      public jakarta.xml.bind.ValidationEventHandler getValidationEventHandler()
    • setValidationEventHandler

      public void setValidationEventHandler(jakarta.xml.bind.ValidationEventHandler validationEventHandler)
    • isUnwrapJAXBElement

      public boolean isUnwrapJAXBElement()
    • setUnwrapJAXBElement

      public void setUnwrapJAXBElement(boolean unwrapJAXBElement)
    • createWrapperHelper

      public org.apache.cxf.databinding.WrapperHelper createWrapperHelper(Class<?> wrapperType, QName wrapperName, List<String> partNames, List<String> elTypeNames, List<Class<?>> partClasses)
      Specified by:
      createWrapperHelper in interface org.apache.cxf.databinding.WrapperCapableDatabinding
    • isInBuiltInSchemas

      public static boolean isInBuiltInSchemas(DOMResult schema)