org.apache.commons.collections.Transformer |
Known Indirect Subclasses
ChainedTransformer,
CloneTransformer,
ClosureTransformer,
ConstantTransformer,
ExceptionTransformer,
FactoryTransformer,
InstantiateTransformer,
InvokerTransformer,
MapTransformer,
NOPTransformer,
PredicateTransformer,
StringValueTransformer,
SwitchTransformer
ChainedTransformer |
Transformer implementation that chains the specified transformers together. |
CloneTransformer |
Transformer implementation that returns a clone of the input object. |
ClosureTransformer |
Transformer implementation that calls a Closure using the input object
and then returns the input. |
ConstantTransformer |
Transformer implementation that returns the same constant each time. |
ExceptionTransformer |
Transformer implementation that always throws an exception. |
FactoryTransformer |
Transformer implementation that calls a Factory and returns the result. |
InstantiateTransformer |
Transformer implementation that creates a new object instance by reflection. |
InvokerTransformer |
Transformer implementation that creates a new object instance by reflection. |
MapTransformer |
Transformer implementation that returns the value held in a specified map
using the input parameter as a key. |
NOPTransformer |
Transformer implementation that does nothing. |
PredicateTransformer |
Transformer implementation that calls a Predicate using the input object
and then returns the input. |
StringValueTransformer |
Transformer implementation that returns the result of calling
String.valueOf on the input object. |
SwitchTransformer |
Transformer implementation calls the transformer whose predicate returns true,
like a switch statement. |
|
Class Overview
Defines a functor interface implemented by classes that transform one
object into another.
A Transformer
converts the input object to the output object.
The input object should be left unchanged.
Transformers are typically used for type conversions, or extracting data
from an object.
Standard implementations of common transformers are provided by
TransformerUtils
. These include method invokation, returning a constant,
cloning and returning the string value.
Summary
Public Methods |
abstract
Object
|
transform(Object input)
Transforms the input object (leaving it unchanged) into some output object.
|
Public Methods
public
abstract
Object
transform
(Object input)
Transforms the input object (leaving it unchanged) into some output object.
Parameters
input
| the object to be transformed, should be left unchanged |