- All Implemented Interfaces:
public class RecursiveCollectionItemTransformer
- extends Object
- implements ItemTransformer
An implementation of
ItemTransformer that treats its argument
specially if it is an array or collection. In this case it loops though,
calling itself on each member in turn, until it encounters a non collection.
At this point, if the item is a String, that is used, or else it is passed to
ItemTransformer. The transformed single item Strings
are all concatenated with line separators.
- Dave Syer
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void setDelegate(ItemTransformer delegate)
- Public setter for the
ItemTransformer to use on single items,
that are not Strings. This can be used to strategise the conversion of
collection and array elements to a String, e.g. via a subclass of
N.B. if the delegate returns an array or collection, it will not be
treated the same way as the original item passed in for transformation.
Rather, in this case, it will simply be converted immediately to a String
by calling its toString().
delegate - the delegate to set. Defaults to a pass through.
public Object transform(Object input)
- Specified by:
transform in interface
public String stringify(Object item)
Copyright © 2008 SpringSource. All Rights Reserved.