Class PassThroughFieldExtractor<T>
- java.lang.Object
- org.springframework.batch.item.file.transform.PassThroughFieldExtractor<T>
- All Implemented Interfaces:
FieldExtractor<T>
public class PassThroughFieldExtractor<T> extends java.lang.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
Constructors Constructor Description PassThroughFieldExtractor()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]
extract(T item)
Get an array of fields as close as possible to the input.
Method Detail
extract
public java.lang.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:- A
FieldSet
or array will be returned as is - For a Collection the
toArray()
method will be used - For a Map the
values()
will be returned as an array - Otherwise it is wrapped in a single element array.
- Specified by:
extract
in interfaceFieldExtractor<T>
- Parameters:
item
- the object to convert- Returns:
- an array of objects as close as possible to the original item
- A