olg.csv.bean.annotations.processor
Class RowBeanProcessor<T>

java.lang.Object
  extended by olg.csv.bean.annotations.processor.RowBeanProcessor<T>
Type Parameters:
T - the type this processor deals with

public final class RowBeanProcessor<T>
extends Object

This class is responsible for processing the @RowBean annotation.

Author:
Olivier Godineau

Constructor Summary
RowBeanProcessor(Class<T> clazz)
          Constructor.
 
Method Summary
 IBeanProcessor<T> getBeanProcessor()
          Build a BeanProcessor from annotations setted on the class this processor deals with.
 CSVSettings getReadingCSVSettings()
          Returns CSVSettings for reading identified from the RowBean annotation of the class otherwise default Reading CSV settings.
 ODSSettings getReadingODSSettings()
          Returns ODSSettings for reading identified from the RowBean annotation of the class otherwise default Reading ODS settings.
protected  boolean getReadingProcessor(int translate, List<IPropertyProcessor<T>> processors, Map<Integer,Integer> map)
          Collect the property processors identified by annotation setted on the fields (@Column and @Embedded) of the class and its super class (if annoted with @RowBean).
 IRowProcessor<T> getRowProcessor()
          Build a RowProcessor from annotations setted on the class this processor deals with.
 CSVSettings getWritingCSVSettings()
          Returns CSVSettings for writing identified from the RowBean annotation of the class otherwise default writing CSV settings.
 ODSSettings getWritingODSSettings()
          Returns ODSSettings for writing identified from the RowBean annotation of the class otherwise default writing ODS settings.
protected  boolean getWritingProcessor(Map<Integer,List<CellProcessor<T>>> map)
          Complete a map with the cell Processors identified on the annotated fields of the class (and superclass).
 boolean hasRowBeanAnnotation()
          Returns if T has RowBean annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowBeanProcessor

public RowBeanProcessor(Class<T> clazz)
Constructor.

Parameters:
clazz - the T class.
Method Detail

hasRowBeanAnnotation

public boolean hasRowBeanAnnotation()
Returns if T has RowBean annotation.

Returns:
true if the T class has RowBean annotation.

getReadingODSSettings

public ODSSettings getReadingODSSettings()
                                  throws AnnotationProcessorException
Returns ODSSettings for reading identified from the RowBean annotation of the class otherwise default Reading ODS settings.

Returns:
the ODSSettings
Throws:
AnnotationProcessorException - if error occurs during annotation processing.

getWritingODSSettings

public ODSSettings getWritingODSSettings()
                                  throws AnnotationProcessorException
Returns ODSSettings for writing identified from the RowBean annotation of the class otherwise default writing ODS settings.

Returns:
the ODSSettings
Throws:
AnnotationProcessorException - if an error occurs during settings identification.

getReadingCSVSettings

public CSVSettings getReadingCSVSettings()
                                  throws AnnotationProcessorException
Returns CSVSettings for reading identified from the RowBean annotation of the class otherwise default Reading CSV settings.

Returns:
the CSVSettings
Throws:
AnnotationProcessorException - if an error occurs during settings identification.

getWritingCSVSettings

public CSVSettings getWritingCSVSettings()
                                  throws AnnotationProcessorException
Returns CSVSettings for writing identified from the RowBean annotation of the class otherwise default writing CSV settings.

Returns:
the CSVSettings
Throws:
AnnotationProcessorException - if an error occurs during settings identification.

getBeanProcessor

public IBeanProcessor<T> getBeanProcessor()
                                   throws AnnotationProcessorException
Build a BeanProcessor from annotations setted on the class this processor deals with.

Returns:
the beanProcessor
Throws:
AnnotationProcessorException - if error occurs during annotation processing.

getRowProcessor

public IRowProcessor<T> getRowProcessor()
                                 throws AnnotationProcessorException
Build a RowProcessor from annotations setted on the class this processor deals with.

Returns:
the RowProcessor
Throws:
AnnotationProcessorException - if error occurs during annotation processing.

getWritingProcessor

protected boolean getWritingProcessor(Map<Integer,List<CellProcessor<T>>> map)
Complete a map with the cell Processors identified on the annotated fields of the class (and superclass).

Parameters:
map - the map to complete with the CellProcessor built from column annotation setted on the class fields. the keys are the cell num target of the cellProcessor.
Returns:
true if no error occurs.

getReadingProcessor

protected boolean getReadingProcessor(int translate,
                                      List<IPropertyProcessor<T>> processors,
                                      Map<Integer,Integer> map)
Collect the property processors identified by annotation setted on the fields (@Column and @Embedded) of the class and its super class (if annoted with @RowBean).

Parameters:
translate - index from which begin the column numerotation
processors - the processor 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 error occurs.


Copyright © 2014. All rights reserved.