org.mule.module.xml.transformer.jaxb
Class JAXBMarshallerTransformer
java.lang.Object
org.mule.transformer.AbstractTransformer
org.mule.module.xml.transformer.jaxb.JAXBMarshallerTransformer
- All Implemented Interfaces:
- MuleContextAware, MuleContextNotificationListener<MuleContextNotification>, ServerNotificationListener<MuleContextNotification>, Disposable, Initialisable, NamedObject, MessageProcessor, Transformer, EndpointAware
public class JAXBMarshallerTransformer
- extends AbstractTransformer
Allows marshaling of Java objects to XML using JAXB 2. A specific sourceClass can be set on this transformer, this
is the expected source object type. If no external JAXBContext
is set on the transformer, but
the 'sourceClass' is set, a JAXBContext
will be created using the sourceClass.
- Since:
- 3.0
Method Summary |
protected java.lang.Object |
doTransform(java.lang.Object src,
java.lang.String encoding)
|
javax.xml.bind.JAXBContext |
getJaxbContext()
|
java.lang.Class<?> |
getSourceClass()
|
void |
initialise()
Template method where deriving classes can do any initialisation after the
properties have been set on this transformer |
void |
setJaxbContext(javax.xml.bind.JAXBContext jaxbContext)
|
void |
setSourceClass(java.lang.Class<?> sourceClass)
|
Methods inherited from class org.mule.transformer.AbstractTransformer |
checkReturnClass, dispose, generateTransformerName, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, onNotification, process, registerSourceType, registerSourceType, setAllowNullReturn, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, transform, unregisterSourceType, unregisterSourceType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
jaxbContext
protected javax.xml.bind.JAXBContext jaxbContext
sourceClass
protected java.lang.Class<?> sourceClass
JAXBMarshallerTransformer
public JAXBMarshallerTransformer()
JAXBMarshallerTransformer
public JAXBMarshallerTransformer(javax.xml.bind.JAXBContext jaxbContext,
DataType returnType)
initialise
public void initialise()
throws InitialisationException
- Description copied from class:
AbstractTransformer
- Template method where deriving classes can do any initialisation after the
properties have been set on this transformer
- Specified by:
initialise
in interface Initialisable
- Overrides:
initialise
in class AbstractTransformer
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered from
doTransform
protected java.lang.Object doTransform(java.lang.Object src,
java.lang.String encoding)
throws TransformerException
- Specified by:
doTransform
in class AbstractTransformer
- Throws:
TransformerException
getJaxbContext
public javax.xml.bind.JAXBContext getJaxbContext()
setJaxbContext
public void setJaxbContext(javax.xml.bind.JAXBContext jaxbContext)
getSourceClass
public java.lang.Class<?> getSourceClass()
setSourceClass
public void setSourceClass(java.lang.Class<?> sourceClass)
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.