org.jcon.data
Interface ObjectTransform

All Known Subinterfaces:
ObjectMangler
All Known Implementing Classes:
Aggregator, ConditionalTransform, DictionaryValueTransform, FilterTransform, GroupByPropertyValue, IfThenTransform, MappedTransform, MultiTransform, OptionalTransform, ParallelMultiTransform, PropertyScrambler, PropertySettingMangler, PropertyTransformingMangler, ReportTransform, SimpleReplace, StringSplitter, SubstringTransform, TransformAndSetPropertyMangler, TruncateAndCat

public interface ObjectTransform

Transforms one object into another. This interface defines a single method, that takes one object and returns another, different object that is somehow derived from it. Said derivation is, of course, up to the implementation, but must not modify or destroy any portion of the input object. However, it is permissible to reuse portions of the input object by reference (e.g., when transforming one list into another, you could create a new list that directly contained the contents of the first list, but you can't reorder or change the contents of the first list).

Another popular technique is to output wrapper objects that do some strange thing to the original victim on the fly. Any behavior like this should be explictly mentioned however.

Both of those examples show how a change to the original may affect or even invalidate the new version. Tough - if you don't want that to happen, clone it first.


Method Summary
 java.lang.Object transform(java.lang.Object victim)
          Our one method; this transforms one object into another.
 

Method Detail

transform

java.lang.Object transform(java.lang.Object victim)
Our one method; this transforms one object into another. Transformation must be nondestructive, but may produce a derived product that is still affected by changes to the original, so beware.