org.mule.providers.file.transformers
Class FileToString

java.lang.Object
  extended byorg.mule.transformers.AbstractTransformer
      extended byorg.mule.providers.file.transformers.FileToByteArray
          extended byorg.mule.providers.file.transformers.FileToString
All Implemented Interfaces:
Cloneable, Initialisable, Serializable, UMOSimpleTransformer, UMOTransformer

public class FileToString
extends FileToByteArray

FileToString reads file contents into a string.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mule.transformers.AbstractTransformer
endpoint, logger, name, nextTransformer, returnClass, sourceTypes, TRANSFORMER_DEFAULT
 
Fields inherited from interface org.mule.umo.transformer.UMOSimpleTransformer
SERVICE_ID
 
Constructor Summary
FileToString()
           
 
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.transformers.AbstractTransformer
checkReturnClass, clone, generateTransformerName, getEndpoint, getFinalReturnClass, getName, getNextTransformer, getReturnClass, getSourceType, getSourceTypeClassesIterator, initialise, isAcceptNull, isIgnoreBadInput, isSourceTypeSupported, isSourceTypeSupported, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setNextTransformer, setReturnClass, setSourceType, toString, transform, unregisterSourceType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileToString

public FileToString()
Method Detail

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 trasfromation at all. NOTE: if a byte[] is passed in as a source object this transformer accept it an try the usual transformation.

Overrides:
doTransform in class FileToByteArray
Throws:
TransformerException


Copyright © 2003-2006 MuleSource Inc.. All Rights Reserved.