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 ObjectToJson

    java.lang.Object
      org.mule.transformer.AbstractTransformer
          org.mule.transformer.AbstractMessageTransformer
              org.mule.module.json.transformers.AbstractJsonTransformer
                  org.mule.module.json.transformers.ObjectToJson

All Implemented Interfaces:
  MuleContextAware, MuleContextNotificationListener<MuleContextNotification>, ServerNotificationListener<MuleContextNotification>, Disposable, Initialisable, NamedObject, MessageProcessor, BaseTransformer, DiscoverableTransformer, MessageTransformer, Transformer

    public class ObjectToJson

extends AbstractJsonTransformer

Converts a java object to a JSON encoded object that can be consumed by other languages such as Javascript or Ruby.

The returnClass for this transformer is always java.lang.String, there is no need to set this.

Field Summary
`protected Log` | `logger` logger used by this class
`protected Class` | `sourceClass`

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

Fields inherited from class org.mule.transformer.AbstractTransformer
`encoding, endpoint, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, 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`

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

Constructor Summary
`ObjectToJson()`

Method Summary
`Map<Class,Class>` | `getSerializationMixins()`
`Class` | `getSourceClass()`
`void` | `initialise()` Template method where deriving classes can do any initialisation after the properties have been set on this transformer
`boolean` | `isHandleException()`
`void` | `setHandleException(boolean handleException)`
`void` | `setSerializationMixins(Map<Class,Class> serializationMixins)`
`void` | `setSourceClass(Class sourceClass)`
`Object` | `transformMessage(MuleMessage message, String encoding)` Transform the message

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

Methods inherited from class org.mule.transformer.AbstractMessageTransformer
`checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform`

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, isSourceTypeSupported, isSourceTypeSupported, onNotification, process, registerSourceType, registerSourceType, setAllowNullReturn, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType`

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

Methods inherited from interface org.mule.api.transformer.Transformer
`getEncoding, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform`

Methods inherited from interface org.mule.api.transformer.BaseTransformer
`getEndpoint, setEndpoint`

Methods inherited from interface org.mule.api.processor.MessageProcessor
`process`

Methods inherited from interface org.mule.api.lifecycle.Disposable
`dispose`

Methods inherited from interface org.mule.api.NamedObject
`getName, setName`

Methods inherited from interface org.mule.api.context.MuleContextAware
`setMuleContext`

Field Detail

### logger

    protected final transient Log logger

  logger used by this class

### sourceClass

    protected Class sourceClass

Constructor Detail

### ObjectToJson

    public ObjectToJson()

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

### transformMessage

    public Object transformMessage(MuleMessage message,
                                   String encoding)
                            throws TransformerException

  Description copied from class: `AbstractMessageTransformer`
  Transform the message

  Specified by:
    `transformMessage` in class `AbstractMessageTransformer`
  Returns:
  Throws:
    `TransformerException`

### isHandleException

    public boolean isHandleException()

### setHandleException

    public void setHandleException(boolean handleException)

### getSourceClass

    public Class getSourceClass()

### setSourceClass

    public void setSourceClass(Class sourceClass)

### getSerializationMixins

    public Map<Class,Class> getSerializationMixins()

### setSerializationMixins

    public void setSerializationMixins(Map<Class,Class> serializationMixins)

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-2010 MuleSoft, Inc.. All Rights Reserved.