Apache CXF API

org.apache.cxf.jaxb
Class JAXBDataBinding

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

public class JAXBDataBinding
extends AbstractDataBinding
implements WrapperCapableDatabinding, InterceptorProvider


Field Summary
static String MTOM_THRESHOLD
           
static String SCHEMA_RESOURCE
           
static String UNWRAP_JAXB_ELEMENT
           
static String USE_JAXB_BRIDGE
           
 
Fields inherited from class org.apache.cxf.databinding.AbstractDataBinding
mtomEnabled, mtomThreshold
 
Constructor Summary
JAXBDataBinding()
           
JAXBDataBinding(boolean q)
           
JAXBDataBinding(Class<?>... classes)
           
JAXBDataBinding(javax.xml.bind.JAXBContext context)
           
 
Method Summary
 boolean addJaxbObjectFactory(javax.xml.bind.JAXBException e1)
           
static void clearCaches()
           
 javax.xml.bind.JAXBContext createJAXBContext(Set<Class<?>> classes)
           
 javax.xml.bind.JAXBContext createJAXBContext(Set<Class<?>> classes, String defaultNs)
           
 org.apache.cxf.jaxb.JAXBDataBinding.CachedContextAndSchemas createJAXBContextAndSchemas(Set<Class<?>> classes, String defaultNs)
           
<T> DataReader<T>
createReader(Class<T> c)
           
 WrapperHelper createWrapperHelper(Class<?> wrapperType, QName wrapperName, List<String> partNames, List<String> elTypeNames, List<Class<?>> partClasses)
           
<T> DataWriter<T>
createWriter(Class<T> c)
           
 javax.xml.bind.JAXBContext getContext()
           
 Set<Class<?>> getContextClasses()
           
 Map<String,Object> getContextProperties()
          Return a map of properties.
 Class[] getExtraClass()
           
 List<Interceptor<? extends Message>> getInFaultInterceptors()
          Returns the list of interceptors attached to the incoming fault interceptor chain of the object.
 List<Interceptor<? extends Message>> getInInterceptors()
          Returns the list of interceptors attached to the incoming interceptor chain of the object.
 javax.xml.bind.Marshaller.Listener getMarshallerListener()
          Returns the Marshaller.Listener that will be registered on the Marshallers
 Map<String,Object> getMarshallerProperties()
          Return a map of properties.
 List<Interceptor<? extends Message>> getOutFaultInterceptors()
          Returns the list of interceptors attached to the outgoing fault interceptor chain of the object.
 List<Interceptor<? extends Message>> getOutInterceptors()
          Returns the list of interceptors attached to the outgoing interceptor chain of the object.
 Class<?>[] getSupportedReaderFormats()
           
 Class<?>[] getSupportedWriterFormats()
           
 javax.xml.bind.Unmarshaller.Listener getUnmarshallerListener()
          Returns the Unmarshaller.Listener that will be registered on the Unmarshallers
 Map<String,Object> getUnmarshallerProperties()
          Return a map of properties.
 javax.xml.bind.ValidationEventHandler getValidationEventHandler()
           
 void initialize(Service service)
          Initialize the service info (i.e.
 boolean isUnwrapJAXBElement()
           
 void setContext(javax.xml.bind.JAXBContext ctx)
           
 void setContextProperties(Map<String,Object> contextProperties)
          Set a map of JAXB context properties.
 void setExtraClass(Class[] userExtraClass)
           
 void setMarshallerListener(javax.xml.bind.Marshaller.Listener marshallerListener)
          Sets the Marshaller.Listener that will be registered on the Marshallers
 void setMarshallerProperties(Map<String,Object> marshallerProperties)
          Set a map of JAXB marshaller properties.
 void setUnmarshallerListener(javax.xml.bind.Unmarshaller.Listener unmarshallerListener)
          Sets the Unmarshaller.Listener that will be registered on the Unmarshallers
 void setUnmarshallerProperties(Map<String,Object> unmarshallerProperties)
          Set a map of JAXB unmarshaller properties.
 void setUnwrapJAXBElement(boolean unwrapJAXBElement)
           
 void setValidationEventHandler(javax.xml.bind.ValidationEventHandler validationEventHandler)
           
 
Methods inherited from class org.apache.cxf.databinding.AbstractDataBinding
addSchemaDocument, checkNamespaceMap, getBus, getDeclaredNamespaceMappings, getMtomThreshold, getNamespaceMap, getSchemas, isMtomEnabled, setBus, setMtomEnabled, setMtomThreshold, setNamespaceMap, setSchemas, updateSchemaLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
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(javax.xml.bind.JAXBContext context)
Method Detail

getContext

public javax.xml.bind.JAXBContext getContext()

setContext

public final void setContext(javax.xml.bind.JAXBContext ctx)

createWriter

public <T> DataWriter<T> createWriter(Class<T> c)
Specified by:
createWriter in interface DataBinding

getSupportedWriterFormats

public Class<?>[] getSupportedWriterFormats()
Specified by:
getSupportedWriterFormats in interface DataBinding

createReader

public <T> DataReader<T> createReader(Class<T> c)
Specified by:
createReader in interface DataBinding

getSupportedReaderFormats

public Class<?>[] getSupportedReaderFormats()
Specified by:
getSupportedReaderFormats in interface DataBinding

initialize

public void initialize(Service service)
Description copied from interface: DataBinding
Initialize the service info (i.e. type & element names, Schemas) with information from the databinding.

Specified by:
initialize in interface DataBinding

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 org.apache.cxf.jaxb.JAXBDataBinding.CachedContextAndSchemas createJAXBContextAndSchemas(Set<Class<?>> classes,
                                                                                               String defaultNs)
                                                                                        throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException

getContextClasses

public Set<Class<?>> getContextClasses()

addJaxbObjectFactory

public boolean addJaxbObjectFactory(javax.xml.bind.JAXBException e1)

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.

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)

clearCaches

public static void clearCaches()

createWrapperHelper

public WrapperHelper createWrapperHelper(Class<?> wrapperType,
                                         QName wrapperName,
                                         List<String> partNames,
                                         List<String> elTypeNames,
                                         List<Class<?>> partClasses)
Specified by:
createWrapperHelper in interface WrapperCapableDatabinding

getOutFaultInterceptors

public List<Interceptor<? extends Message>> getOutFaultInterceptors()
Description copied from interface: InterceptorProvider
Returns the list of interceptors attached to the outgoing fault interceptor chain of the object.

Specified by:
getOutFaultInterceptors in interface InterceptorProvider
Returns:
List outgoing fault interceptor chain

getInFaultInterceptors

public List<Interceptor<? extends Message>> getInFaultInterceptors()
Description copied from interface: InterceptorProvider
Returns the list of interceptors attached to the incoming fault interceptor chain of the object.

Specified by:
getInFaultInterceptors in interface InterceptorProvider
Returns:
List incoming fault interceptor chain

getInInterceptors

public List<Interceptor<? extends Message>> getInInterceptors()
Description copied from interface: InterceptorProvider
Returns the list of interceptors attached to the incoming interceptor chain of the object.

Specified by:
getInInterceptors in interface InterceptorProvider
Returns:
List incoming interceptor chain

getOutInterceptors

public List<Interceptor<? extends Message>> getOutInterceptors()
Description copied from interface: InterceptorProvider
Returns the list of interceptors attached to the outgoing interceptor chain of the object.

Specified by:
getOutInterceptors in interface InterceptorProvider
Returns:
List outgoing interceptor chain

Apache CXF API

Apache CXF