org.springframework.batch.item.file.transform
Class PassThroughFieldExtractor<T>

java.lang.Object
  extended by org.springframework.batch.item.file.transform.PassThroughFieldExtractor<T>
All Implemented Interfaces:
FieldExtractor<T>

public class PassThroughFieldExtractor<T>
extends Object
implements FieldExtractor<T>

FieldExtractor that just returns the original item. If the item is an array or collection it will be returned as is, otherwise it is wrapped in a single element array.

Author:
Dave Syer

Constructor Summary
PassThroughFieldExtractor()
           
 
Method Summary
 Object[] extract(T item)
          Get an array of fields as close as possible to the input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassThroughFieldExtractor

public PassThroughFieldExtractor()
Method Detail

extract

public Object[] extract(T item)
Get an array of fields as close as possible to the input. The result depends on the type of the input: Note that no attempt is made to sort the values, so passing in an unordered collection or map is probably a bad idea. Spring often gives you an ordered Map (e.g. if extracting data from a generic query using JDBC), so check the documentation for whatever is being used to generate the input.

Specified by:
extract in interface FieldExtractor<T>
Parameters:
item - the object to convert
Returns:
an array of objects as close as possible to the original item


Copyright © 2013 SpringSource. All Rights Reserved.