org.openadaptor.dostrings.transformers
Class TrimTransformer

java.lang.Object
  extended by org.openadaptor.dostrings.transformers.AbstractTransformer
      extended by org.openadaptor.dostrings.transformers.TrimTransformer
All Implemented Interfaces:
ObjectTransformer

public class TrimTransformer
extends AbstractTransformer

A simple transformer which takes the string value of the object passed to it and trims off all leading and trailing whitespace. Can be used in Readers and Writers.


Constructor Summary
TrimTransformer()
           
 
Method Summary
 void init(java.util.Properties props, java.lang.String prefix)
          Does nothing.
 java.lang.Object transform(java.lang.Object o)
          Returns trimmed string value.
 
Methods inherited from class org.openadaptor.dostrings.transformers.AbstractTransformer
getBooleanProperty, getProperty, getPropertyDefs, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrimTransformer

public TrimTransformer()
Method Detail

init

public void init(java.util.Properties props,
                 java.lang.String prefix)
          throws DOStringException
Does nothing.

Specified by:
init in interface ObjectTransformer
Overrides:
init in class AbstractTransformer
Parameters:
props - Properties object containing our properties.
prefix - Our properties prefix.
Throws:
DOStringException - If mandatory properties are not defined, or any property is incorrectly defined.

transform

public java.lang.Object transform(java.lang.Object o)
                           throws DOStringException
Returns trimmed string value.

Parameters:
o - Object whose string value is to be trimmed.
Returns:
String value trimmed of leading and trailing whitespace.
Throws:
DOStringException