Package org.apache.cxf.jaxb
Class JAXBDataBinding
- java.lang.Object
-
- org.apache.cxf.databinding.AbstractDataBinding
-
- org.apache.cxf.databinding.AbstractInterceptorProvidingDataBinding
-
- org.apache.cxf.jaxb.JAXBDataBinding
-
- All Implemented Interfaces:
DataBinding,WrapperCapableDatabinding,InterceptorProvider
public class JAXBDataBinding extends AbstractInterceptorProvidingDataBinding implements WrapperCapableDatabinding, InterceptorProvider
-
-
Field Summary
Fields Modifier and Type Field Description static StringJAXB_SCAN_PACKAGESstatic StringMTOM_THRESHOLDstatic StringREADER_VALIDATION_EVENT_HANDLERstatic StringSCHEMA_RESOURCEstatic StringSET_VALIDATION_EVENT_HANDLERstatic StringUNWRAP_JAXB_ELEMENTstatic StringUSE_JAXB_BRIDGEstatic StringVALIDATION_EVENT_HANDLERstatic StringWRITER_VALIDATION_EVENT_HANDLER-
Fields inherited from class org.apache.cxf.databinding.AbstractInterceptorProvidingDataBinding
inFaultInterceptors, inInterceptors, outFaultInterceptors, outInterceptors
-
Fields inherited from class org.apache.cxf.databinding.AbstractDataBinding
mtomEnabled, mtomThreshold
-
-
Constructor Summary
Constructors Constructor Description JAXBDataBinding()JAXBDataBinding(boolean q)JAXBDataBinding(boolean qualified, Map<String,Object> props)JAXBDataBinding(Class<?>... classes)JAXBDataBinding(javax.xml.bind.JAXBContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyEscapeHandler(boolean escape, Consumer<Object> consumer)javax.xml.bind.JAXBContextcreateJAXBContext(Set<Class<?>> classes)javax.xml.bind.JAXBContextcreateJAXBContext(Set<Class<?>> classes, String defaultNs)JAXBContextCache.CachedContextAndSchemascreateJAXBContextAndSchemas(Set<Class<?>> classes, String defaultNs)<T> DataReader<T>createReader(Class<T> c)WrapperHelpercreateWrapperHelper(Class<?> wrapperType, QName wrapperName, List<String> partNames, List<String> elTypeNames, List<Class<?>> partClasses)<T> DataWriter<T>createWriter(Class<T> c)List<javax.xml.bind.annotation.adapters.XmlAdapter<?,?>>getConfiguredXmlAdapters()javax.xml.bind.JAXBContextgetContext()Set<Class<?>>getContextClasses()Map<String,Object>getContextProperties()Return a map of properties.ObjectgetEscapeHandler()Class<?>[]getExtraClass()javax.xml.bind.Marshaller.ListenergetMarshallerListener()Returns the Marshaller.Listener that will be registered on the MarshallersMap<String,Object>getMarshallerProperties()Return a map of properties.protected StringgetNamespaceToUse(Service service)protected booleangetQualifiedSchemas()Class<?>[]getSupportedReaderFormats()Class<?>[]getSupportedWriterFormats()javax.xml.bind.Unmarshaller.ListenergetUnmarshallerListener()Returns the Unmarshaller.Listener that will be registered on the UnmarshallersMap<String,Object>getUnmarshallerProperties()Return a map of properties.javax.xml.bind.ValidationEventHandlergetValidationEventHandler()voidinitialize(Service service)Initialize the service info (i.e.static booleanisInBuiltInSchemas(DOMResult schema)booleanisUnwrapJAXBElement()protected voidjustCheckForJAXBAnnotations(ServiceInfo serviceInfo)voidsetConfiguredXmlAdapters(List<javax.xml.bind.annotation.adapters.XmlAdapter<?,?>> adpters)voidsetContext(javax.xml.bind.JAXBContext ctx)voidsetContextProperties(Map<String,Object> contextProperties)Set a map of JAXB context properties.voidsetEscapeHandler(Object handler)voidsetExtraClass(Class<?>[] userExtraClass)voidsetMarshallerListener(javax.xml.bind.Marshaller.Listener marshallerListener)Sets the Marshaller.Listener that will be registered on the MarshallersvoidsetMarshallerProperties(Map<String,Object> marshallerProperties)Set a map of JAXB marshaller properties.voidsetUnmarshallerListener(javax.xml.bind.Unmarshaller.Listener unmarshallerListener)Sets the Unmarshaller.Listener that will be registered on the UnmarshallersvoidsetUnmarshallerProperties(Map<String,Object> unmarshallerProperties)Set a map of JAXB unmarshaller properties.voidsetUnwrapJAXBElement(boolean unwrapJAXBElement)voidsetValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)-
Methods inherited from class org.apache.cxf.databinding.AbstractInterceptorProvidingDataBinding
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors
-
Methods inherited from class org.apache.cxf.databinding.AbstractDataBinding
addSchemaDocument, addSchemaDocument, checkNamespaceMap, getBus, getContextualNamespaceMap, getDeclaredNamespaceMappings, getMtomThreshold, getNamespaceMap, getSchemas, isMtomEnabled, setBus, setContextualNamespaceMap, setMtomEnabled, setMtomThreshold, setNamespaceMap, setSchemas, updateSchemaLocation
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cxf.interceptor.InterceptorProvider
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors
-
-
-
-
Field Detail
-
READER_VALIDATION_EVENT_HANDLER
public static final String READER_VALIDATION_EVENT_HANDLER
- See Also:
- Constant Field Values
-
VALIDATION_EVENT_HANDLER
public static final String VALIDATION_EVENT_HANDLER
- See Also:
- Constant Field Values
-
SET_VALIDATION_EVENT_HANDLER
public static final String SET_VALIDATION_EVENT_HANDLER
- See Also:
- Constant Field Values
-
WRITER_VALIDATION_EVENT_HANDLER
public static final String WRITER_VALIDATION_EVENT_HANDLER
- See Also:
- Constant Field Values
-
SCHEMA_RESOURCE
public static final String SCHEMA_RESOURCE
- See Also:
- Constant Field Values
-
MTOM_THRESHOLD
public static final String MTOM_THRESHOLD
- See Also:
- Constant Field Values
-
UNWRAP_JAXB_ELEMENT
public static final String UNWRAP_JAXB_ELEMENT
- See Also:
- Constant Field Values
-
USE_JAXB_BRIDGE
public static final String USE_JAXB_BRIDGE
- See Also:
- Constant Field Values
-
JAXB_SCAN_PACKAGES
public static final String JAXB_SCAN_PACKAGES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JAXBDataBinding
public JAXBDataBinding()
-
JAXBDataBinding
public JAXBDataBinding(boolean q)
-
JAXBDataBinding
public JAXBDataBinding(Class<?>... classes) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
JAXBDataBinding
public JAXBDataBinding(boolean qualified, Map<String,Object> props) throws javax.xml.bind.JAXBException- Throws:
javax.xml.bind.JAXBException
-
JAXBDataBinding
public JAXBDataBinding(javax.xml.bind.JAXBContext context)
-
-
Method Detail
-
getQualifiedSchemas
protected boolean getQualifiedSchemas()
-
getContext
public javax.xml.bind.JAXBContext getContext()
-
setContext
public final void setContext(javax.xml.bind.JAXBContext ctx)
-
getEscapeHandler
public Object getEscapeHandler()
-
setEscapeHandler
public void setEscapeHandler(Object handler)
-
createWriter
public <T> DataWriter<T> createWriter(Class<T> c)
- Specified by:
createWriterin interfaceDataBinding
-
getSupportedWriterFormats
public Class<?>[] getSupportedWriterFormats()
- Specified by:
getSupportedWriterFormatsin interfaceDataBinding
-
createReader
public <T> DataReader<T> createReader(Class<T> c)
- Specified by:
createReaderin interfaceDataBinding
-
getSupportedReaderFormats
public Class<?>[] getSupportedReaderFormats()
- Specified by:
getSupportedReaderFormatsin interfaceDataBinding
-
initialize
public void initialize(Service service)
Description copied from interface:DataBindingInitialize the service info (i.e. type & element names, Schemas) with information from the databinding.- Specified by:
initializein interfaceDataBinding
-
justCheckForJAXBAnnotations
protected void justCheckForJAXBAnnotations(ServiceInfo serviceInfo)
-
setExtraClass
public void setExtraClass(Class<?>[] userExtraClass)
-
getExtraClass
public Class<?>[] getExtraClass()
-
createJAXBContext
public javax.xml.bind.JAXBContext createJAXBContext(Set<Class<?>> classes) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
createJAXBContext
public javax.xml.bind.JAXBContext createJAXBContext(Set<Class<?>> classes, String defaultNs) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
createJAXBContextAndSchemas
public JAXBContextCache.CachedContextAndSchemas createJAXBContextAndSchemas(Set<Class<?>> classes, String defaultNs) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
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<javax.xml.bind.annotation.adapters.XmlAdapter<?,?>> getConfiguredXmlAdapters()
-
setConfiguredXmlAdapters
public void setConfiguredXmlAdapters(List<javax.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 javax.xml.bind.Unmarshaller.Listener getUnmarshallerListener()
Returns the Unmarshaller.Listener that will be registered on the Unmarshallers- Returns:
-
setUnmarshallerListener
public void setUnmarshallerListener(javax.xml.bind.Unmarshaller.Listener unmarshallerListener)
Sets the Unmarshaller.Listener that will be registered on the Unmarshallers- Parameters:
unmarshallerListener-
-
getMarshallerListener
public javax.xml.bind.Marshaller.Listener getMarshallerListener()
Returns the Marshaller.Listener that will be registered on the Marshallers- Returns:
-
setMarshallerListener
public void setMarshallerListener(javax.xml.bind.Marshaller.Listener marshallerListener)
Sets the Marshaller.Listener that will be registered on the Marshallers- Parameters:
marshallerListener-
-
getValidationEventHandler
public javax.xml.bind.ValidationEventHandler getValidationEventHandler()
-
setValidationEventHandler
public void setValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)
-
isUnwrapJAXBElement
public boolean isUnwrapJAXBElement()
-
setUnwrapJAXBElement
public void setUnwrapJAXBElement(boolean unwrapJAXBElement)
-
createWrapperHelper
public WrapperHelper createWrapperHelper(Class<?> wrapperType, QName wrapperName, List<String> partNames, List<String> elTypeNames, List<Class<?>> partClasses)
- Specified by:
createWrapperHelperin interfaceWrapperCapableDatabinding
-
isInBuiltInSchemas
public static boolean isInBuiltInSchemas(DOMResult schema)
-
-