org.mule.transport.file.transformers
Class FileToString
java.lang.Object
org.mule.transformer.AbstractTransformer
org.mule.transformer.simple.SerializableToByteArray
org.mule.transformer.simple.ObjectToByteArray
org.mule.transport.file.transformers.FileToByteArray
org.mule.transport.file.transformers.FileToString
- All Implemented Interfaces:
- Initialisable, NamedObject, BaseTransformer, DiscoverableTransformer, Transformer
public class FileToString
- extends FileToByteArray
FileToString
reads file contents into a string.
Method Summary |
Object |
doTransform(Object src,
String encoding)
Simple implementation which relies on FileToByteArray to get a
byte[] from the file beeing parsed and then transform it to a
String with the correct encoding. |
Methods inherited from class org.mule.transformer.AbstractTransformer |
checkReturnClass, generateTransformerName, getEndpoint, getName, getReturnClass, getSourceTypes, initialise, isAcceptNull, isConsumed, isIgnoreBadInput, isSourceTypeSupported, isSourceTypeSupported, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setReturnClass, toString, transform, unregisterSourceType |
FileToString
public FileToString()
doTransform
public Object doTransform(Object src,
String encoding)
throws TransformerException
- Simple implementation which relies on
FileToByteArray
to get a
byte[]
from the file beeing parsed and then transform it to a
String with the correct encoding. If the encoding isn't supported simply throw
an exception, good tranformation or no transformation at all. NOTE: if a
byte[]
is passed in as a source object this transformer accepts
it and tries the usual transformation.
- Overrides:
doTransform
in class FileToByteArray
- Throws:
TransformerException
Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.