olg.csv.bean.annotations.processor
Class ColumnProcessor<B>

java.lang.Object
  extended by olg.csv.bean.annotations.processor.ColumnProcessor<B>
Type Parameters:
B - the bean on which research its fields annoted with column annotation

public final class ColumnProcessor<B>
extends Object

This class is responsible for processing the @Column annotation.

Author:
Olivier Godineau

Constructor Summary
ColumnProcessor(Class<B> clazz)
          Constructor.
 
Method Summary
 boolean getReadingProcessor(int translate, Field field, List<IPropertyProcessor<B>> propertyProcessors, Map<Integer,Integer> map)
          Complete a list with the propertyProcessor built from the column annotation setted on a field.
 boolean getWritingProcessor(Field field, Map<Integer,List<CellProcessor<B>>> map)
          Complete a map with the cellprocessor built from the column annotation setted on a field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnProcessor

public ColumnProcessor(Class<B> clazz)
Constructor.

Parameters:
clazz - the class of the bean.
Method Detail

getWritingProcessor

public boolean getWritingProcessor(Field field,
                                   Map<Integer,List<CellProcessor<B>>> map)
Complete a map with the cellprocessor built from the column annotation setted on a field.

Parameters:
field - the field (of the beanClass) from which build the cell processor.
map - the map to complete with the CellProcessor built from column annotation setted on the field. the keys are the cell num target of the cellProcessor.
Returns:
true if no error happens during this operation.

getReadingProcessor

public boolean getReadingProcessor(int translate,
                                   Field field,
                                   List<IPropertyProcessor<B>> propertyProcessors,
                                   Map<Integer,Integer> map)
Complete a list with the propertyProcessor built from the column annotation setted on a field.

Parameters:
translate - column index to add to the column num found on the field. Useful to define the index of a field herited by an embedded attribute.
field - the field (of the beanClass) from which read the Column annotation
propertyProcessors - the list to complete
map - the map to complete. this map shows for each cell num the count of the property processors setted on.
Returns:
true if no errors occurs.


Copyright © 2014. All rights reserved.