Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.

Field Summary

Fields inherited from class org.mule.module.json.transformers.AbstractJsonTransformer
`weighting`

Fields inherited from class org.mule.transformer.AbstractTransformer
`DEFAULT_TRUNCATE_LENGTH, endpoint, logger, muleContext, name, returnClass, sourceTypes`

Fields inherited from interface org.mule.api.transformer.DiscoverableTransformer
`DEFAULT_PRIORITY_WEIGHTING, MAX_PRIORITY_WEIGHTING, MIN_PRIORITY_WEIGHTING`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Constructor Summary
`JsonToObject()`

Method Summary
`Map<Class,Class>` | `getDeserializationMixins()`
`void` | `initialise()` Template method where deriving classes can do any initialisation after the properties have been set on this transformer
`void` | `setDeserializationMixins(Map<Class,Class> deserializationMixins)`
`Object` | `transform(MuleMessage message, String outputEncoding)`

Methods inherited from class org.mule.module.json.transformers.AbstractJsonTransformer
`getMapper, getMixins, getPriorityWeighting, setMapper, setMixins, setPriorityWeighting`

Methods inherited from class org.mule.transformer.AbstractMessageAwareTransformer
`doTransform, isSourceTypeSupported`

Methods inherited from class org.mule.transformer.AbstractTransformer
`checkReturnClass, generateTransformerName, getEncoding, getEndpoint, getName, getReturnClass, getSourceTypes, isAcceptNull, isConsumed, isIgnoreBadInput, isSourceTypeSupported, registerSourceType, setEndpoint, setIgnoreBadInput, setMuleContext, setName, setReturnClass, toString, transform, transform, unregisterSourceType`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### JsonToObject

    public JsonToObject()

Method Detail

### 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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.