olg.csv.bean.impl
Class ComplexPropertyProcessor<B>

Package class diagram package ComplexPropertyProcessor
java.lang.Object
  extended by olg.csv.bean.impl.AbstractPropertyProcessor<B>
      extended by olg.csv.bean.impl.ComplexPropertyProcessor<B>
Type Parameters:
B - bean this property Processor deals with.
All Implemented Interfaces:
IPropertyProcessor<B>

public final class ComplexPropertyProcessor<B>
extends AbstractPropertyProcessor<B>

Complex property transformer. Typically the case when we need to instanciate a bean from a list of Strings we want to set as a property of our final bean.


Field Summary
private  IBeanProcessor transformer
          the transformer used to product a bean from a list of Strings
 
Fields inherited from class olg.csv.bean.impl.AbstractPropertyProcessor
beanClass, method
 
Constructor Summary
ComplexPropertyProcessor(IBeanProcessor transformer, Class<B> beanClass, String propertyName)
           
 
Method Summary
 B transform(Row line, B bean)
          Returns the bean after this transformer sets its property from a row.
 
Methods inherited from class olg.csv.bean.impl.AbstractPropertyProcessor
getBeanClass, getComplexPropertyTransformer, getSimplePropertyTransformer, invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transformer

private final IBeanProcessor transformer
the transformer used to product a bean from a list of Strings

Constructor Detail

ComplexPropertyProcessor

ComplexPropertyProcessor(IBeanProcessor transformer,
                         Class<B> beanClass,
                         String propertyName)
Parameters:
transformer - the transformer which products the value of the property to set
beanClass - the class of the bean to return. Must be not null
propertyName - the name of the property to set. Must be not null
Method Detail

transform

public B transform(Row line,
                   B bean)
            throws ParseException
Description copied from interface: IPropertyProcessor
Returns the bean after this transformer sets its property from a row.

Specified by:
transform in interface IPropertyProcessor<B>
Specified by:
transform in class AbstractPropertyProcessor<B>
Parameters:
line - the row. list of strings which represents the property of the bean
bean - the bean this transformer set property (or properties).
Returns:
the given bean.If the given bean is null a new instance is created and returned.
Throws:
ParseException - if error occurs during parsing


Copyright © 2014. All Rights Reserved.