public class PropertyExtractingDelegatingItemWriter<T> extends AbstractMethodInvokingDelegator<T> implements ItemWriter<T>
ItemWriterAdapter
AbstractMethodInvokingDelegator.InvocationTargetThrowableWrapper
Constructor and Description |
---|
PropertyExtractingDelegatingItemWriter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
setFieldsUsedAsTargetMethodArguments(java.lang.String[] fieldsUsedAsMethodArguments) |
void |
write(java.util.List<? extends T> items)
Extracts values from item's fields named in
fieldsUsedAsTargetMethodArguments and passes them as arguments to the
delegate method.
|
getArguments, invokeDelegateMethod, invokeDelegateMethodWithArgument, invokeDelegateMethodWithArguments, setArguments, setTargetMethod, setTargetObject
public PropertyExtractingDelegatingItemWriter()
public void write(java.util.List<? extends T> items) throws java.lang.Exception
write
in interface ItemWriter<T>
items
- items to be writtenjava.lang.Exception
- if there are errors. The framework will catch the
exception and convert or rethrow it as appropriate.public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class AbstractMethodInvokingDelegator<T>
java.lang.Exception
public void setFieldsUsedAsTargetMethodArguments(java.lang.String[] fieldsUsedAsMethodArguments)
fieldsUsedAsMethodArguments
- the values of the these item's fields
will be used as arguments for the delegate method. Nested property values
are supported, e.g. address.city