org.mule.config.transformer
Class AnnotatedTransformerProxy

java.lang.Object
  extended by org.mule.transformer.AbstractTransformer
      extended by org.mule.transformer.AbstractMessageTransformer
          extended by org.mule.config.transformer.AnnotatedTransformerProxy
All Implemented Interfaces:
AnnotatedObject, MuleContextAware, Disposable, Initialisable, NameableObject, NamedObject, MessageProcessor, Converter, DiscoverableTransformer, MessageTransformer, Transformer, EndpointAware

public class AnnotatedTransformerProxy
extends AbstractMessageTransformer
implements DiscoverableTransformer

Creates a Mule Transformer proxy around a transform method. The transformer will be given a generated name which is the short name of the class and the method name separated with a '.' i.e. 'MyTransformers.fooToBar'


Field Summary
 
Fields inherited from class org.mule.transformer.AbstractTransformer
encoding, endpoint, logger, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypes
 
Fields inherited from interface org.mule.api.transformer.Converter
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
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
AnnotatedTransformerProxy(int weighting, Object proxy, Method transformMethod, Class[] additionalSourceTypes, String sourceMimeType, String resultMimeType)
           
 
Method Summary
 boolean equals(Object o)
           
 int getPriorityWeighting()
          If two or more discoverable transformers are equal, this value can be used to select the correct one
 int hashCode()
           
 void initialise()
          Template method where deriving classes can do any initialisation after the properties have been set on this transformer
 void setPriorityWeighting(int weighting)
          If 2 or more discoverable transformers are equal, this value can be used to select the correct one
 Object transformMessage(MuleMessage message, String outputEncoding)
          Transform the message
protected  void validateMethod(Method method, Class[] sourceTypes)
           
 
Methods inherited from class org.mule.transformer.AbstractMessageTransformer
checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform
 
Methods inherited from class org.mule.transformer.AbstractTransformer
dispose, generateTransformerName, getAnnotation, getAnnotations, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, process, registerSourceType, registerSourceType, setAllowNullReturn, setAnnotations, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transformer.Transformer
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform, transform
 
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.NameableObject
setName
 
Methods inherited from interface org.mule.api.NamedObject
getName
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.endpoint.EndpointAware
setEndpoint
 

Constructor Detail

AnnotatedTransformerProxy

public AnnotatedTransformerProxy(int weighting,
                                 Object proxy,
                                 Method transformMethod,
                                 Class[] additionalSourceTypes,
                                 String sourceMimeType,
                                 String resultMimeType)
                          throws TransformerException,
                                 InitialisationException
Throws:
TransformerException
InitialisationException
Method Detail

validateMethod

protected void validateMethod(Method method,
                              Class[] sourceTypes)
                       throws IllegalArgumentException
Throws:
IllegalArgumentException

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

transformMessage

public Object transformMessage(MuleMessage message,
                               String outputEncoding)
                        throws TransformerException
Description copied from class: AbstractMessageTransformer
Transform the message

Specified by:
transformMessage in class AbstractMessageTransformer
Throws:
TransformerException

getPriorityWeighting

public int getPriorityWeighting()
Description copied from interface: Converter
If two or more discoverable transformers are equal, this value can be used to select the correct one

Specified by:
getPriorityWeighting in interface Converter
Returns:
the priority weighting for this transformer. This is a value between Converter.MIN_PRIORITY_WEIGHTING and Converter.MAX_PRIORITY_WEIGHTING.

setPriorityWeighting

public void setPriorityWeighting(int weighting)
Description copied from interface: Converter
If 2 or more discoverable transformers are equal, this value can be used to select the correct one

Specified by:
setPriorityWeighting in interface Converter
Parameters:
weighting - the priority weighting for this transformer. This is a value between Converter.MIN_PRIORITY_WEIGHTING and Converter.MAX_PRIORITY_WEIGHTING.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.