org.mule.module.json.transformers
Class JsonToObject
java.lang.Object
org.mule.transformer.AbstractTransformer
org.mule.transformer.AbstractMessageAwareTransformer
org.mule.module.json.transformers.AbstractJsonTransformer
org.mule.module.json.transformers.JsonToObject
- All Implemented Interfaces:
- MuleContextAware, Initialisable, NamedObject, BaseTransformer, DiscoverableTransformer, Transformer
public class JsonToObject
- extends AbstractJsonTransformer
A transformer that will convert a JSON encoded object graph to a java object. The object type is
determined by the 'returnClass' attribute. Note that this transformers supports Arrays and Lists. For
example, to
convert a JSON string to an array of org.foo.Person, set the the returnClass=[Lorg.foo.Person;.
The JSON engine can be configured using the jsonConfig attribute. This is an object reference to an
instance of: net.sf.json.JsonConfig. This can be created as a spring bean.
| Methods inherited from class org.mule.transformer.AbstractTransformer |
checkReturnClass, generateTransformerName, getEncoding, getEndpoint, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, registerSourceType, registerSourceType, setEndpoint, setIgnoreBadInput, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, transform, unregisterSourceType, unregisterSourceType |
JsonToObject
public JsonToObject()
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 AbstractJsonTransformer
- Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from
transform
public Object transform(MuleMessage message,
String outputEncoding)
throws TransformerException
- Specified by:
transform in class AbstractMessageAwareTransformer
- Throws:
TransformerException
getDeserializationMixins
public Map<Class,Class> getDeserializationMixins()
setDeserializationMixins
public void setDeserializationMixins(Map<Class,Class> deserializationMixins)
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.