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

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

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

Basic property transformer. Allows to set a property from a string.


Field Summary
private  AbstractGetter getter
          the getter.
private  AbstractParser parser
          The parser to product the property to set from a String.
 
Fields inherited from class olg.csv.bean.impl.AbstractPropertyProcessor
beanClass, method
 
Constructor Summary
PropertyProcessor(AbstractGetter getter, AbstractParser parser, String propertyName, Class<B> clazz)
           
 
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

getter

private final AbstractGetter getter
the getter. Allows to extract the property as string from a list of Strings.


parser

private final AbstractParser parser
The parser to product the property to set from a String.

Constructor Detail

PropertyProcessor

PropertyProcessor(AbstractGetter getter,
                  AbstractParser parser,
                  String propertyName,
                  Class<B> clazz)
Parameters:
getter - the getter that extracts the string value to parse as a property. . Must be not null
parser - the parser that parses the string as a property value. . Must be not null
propertyName - the name of the bean property.
clazz - the bean class.
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.