|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectolg.csv.bean.impl.AbstractPropertyProcessor<B>
B - dedicated bean the Propertytransformer deals withpublic abstract class AbstractPropertyProcessor<B>
In reading process, Class responsible of bean properties instantiation from
list of Strings. This class seems to be the same as BeanProcessor
class. But its motivation is different : We want to instantiate a
characteristic of a bean while Transformer allows to product bean completed
with its properties set by PropertyTransformers
| Field Summary | |
|---|---|
protected Class<B> |
beanClass
The class of the bean this transformer deals with. |
protected Method |
method
the method used to set the property of a <B> bean. |
| Constructor Summary | |
|---|---|
AbstractPropertyProcessor()
|
|
| Method Summary | ||
|---|---|---|
Class<B> |
getBeanClass()
Returns the class of the bean this transformer deals with. |
|
static
|
getComplexPropertyTransformer(IBeanProcessor<P> transformer,
Class<T> beanClass,
String propertyName)
Returns a property processor which set a property of a bean with the help of a transformer. |
|
static
|
getSimplePropertyTransformer(AbstractGetter getter,
AbstractParser<X> parser,
String propertyName,
Class<T> clazz)
Returns a simple property processor which set a property of bean with the help of a getter and a parser. |
|
protected B |
invoke(Object field,
B bean)
allows to set field of a bean. |
|
abstract B |
transform(Row line,
B bean)
Returns the bean after this transformer sets its property from a row. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Class<B> beanClass
protected Method method
| Constructor Detail |
|---|
public AbstractPropertyProcessor()
| Method Detail |
|---|
public final Class<B> getBeanClass()
public abstract B transform(Row line,
B bean)
IPropertyProcessor
transform in interface IPropertyProcessor<B>line - the row. list of strings which represents the property of the
beanbean - the bean this transformer set property (or properties).
null a new
instance is created and returned.
protected final B invoke(Object field,
B bean)
field - the value of the fieldbean - the bean to set its field
null return a new bean
with its field setted.
public static final <T,X> IPropertyProcessor<T> getSimplePropertyTransformer(AbstractGetter getter,
AbstractParser<X> parser,
String propertyName,
Class<T> clazz)
T - the bean typeX - the property typegetter - the getter. Allows to extract a sting corresponding to the
property to set. Must be not null.parser - the parser. Allows to instantiate the property from a String.
Must be not null.propertyName - the name of the property to set. Must be not null
.clazz - the bean class. Must be not null.
transform(Row, Object)
public static final <T,P> IPropertyProcessor<T> getComplexPropertyTransformer(IBeanProcessor<P> transformer,
Class<T> beanClass,
String propertyName)
T - the bean typeP - th property typetransformer - the transformer which products the value of the property to
set. Must not be null.beanClass - the class of the bean to return. Must not be null
.propertyName - the name of the property to set. Must not be null
.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||