|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object olg.csv.bean.annotations.processor.RowBeanProcessor<T>
T
- the type this processor deals withpublic final class RowBeanProcessor<T>
This class is responsible for processing the @RowBean annotation.
Nested Class Summary | |
---|---|
private static class |
RowBeanProcessor.CSVPropertyType
CSV Property list. |
private static class |
RowBeanProcessor.ODSPropertyType
ODS Property list. |
Field Summary | |
---|---|
private Class<T> |
clazz
The class of the type. |
private ColumnProcessor<T> |
columnProcessor
Processor responsible for processing @Column annotations placed on the fields of the class. |
private RowBeanProcessor.CSVPropertyType[] |
CSVReadingProperties
CSV Properties allowed on Reading. |
private RowBeanProcessor.CSVPropertyType[] |
CSVWritingProperties
CSV Properties allowed on Writing. |
private EmbeddedProcessor<T> |
embeddedProcessor
Processor responsible for processing @Embedded annotations placed on the fields of the class. |
private static org.slf4j.Logger |
LOGGER
Class logger. |
private RowBeanProcessor.ODSPropertyType[] |
ODSReadingProperties
ODSProperties allowed on Reading process. |
private RowBeanProcessor.ODSPropertyType[] |
ODSWritingProperties
ODS Properties allowed on Writing process. |
Constructor Summary | |
---|---|
RowBeanProcessor(Class<T> clazz)
Constructor. |
Method Summary | |
---|---|
private boolean |
checkField(Field field,
Class<? super T> beanClass)
Check if a field hasn't both column annotation and Embedded annotation. |
IBeanProcessor<T> |
getBeanProcessor()
Build a BeanProcessor from annotations setted on the class this processor deals with. |
private CSVSettings |
getCSVSettings(Param[] csvParams,
RowBeanProcessor.CSVPropertyType[] properties,
String type)
Products the CSVSettings corresponding to params of a process. |
private ODSSettings |
getODSSettings(Param[] odsParams,
RowBeanProcessor.ODSPropertyType[] properties,
String type)
Returns ODSSettings corresponding to ODS params of a process. |
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. |
private boolean |
getReadingProcessor(Class<? super T> beanClass,
int translate,
List<IPropertyProcessor<T>> processors,
Map<Integer,Integer> map)
Find the property processors identified on a class if annoted with @RowBean and from its super class if annoted with @RowBean. |
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. |
private boolean |
getWritingProcessor(Class<? super T> beanClass,
Map<Integer,List<CellProcessor<T>>> map)
Collects cell processors from column and embedded annotation setted on a class if annoted with RowBean annotation. |
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. |
private RowBeanProcessor.CSVPropertyType |
identifyPermittedProperty(Param param,
RowBeanProcessor.CSVPropertyType[] permittedProperties)
Identifies a param as an allowed CSVPropertyType. |
private RowBeanProcessor.ODSPropertyType |
identifyPermittedProperty(Param param,
RowBeanProcessor.ODSPropertyType[] permittedProperties)
Identifies a param as an allowed ODSPropertyType. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.slf4j.Logger LOGGER
private RowBeanProcessor.ODSPropertyType[] ODSReadingProperties
private RowBeanProcessor.ODSPropertyType[] ODSWritingProperties
private RowBeanProcessor.CSVPropertyType[] CSVReadingProperties
private RowBeanProcessor.CSVPropertyType[] CSVWritingProperties
private Class<T> clazz
private ColumnProcessor<T> columnProcessor
private EmbeddedProcessor<T> embeddedProcessor
Constructor Detail |
---|
public RowBeanProcessor(Class<T> clazz)
clazz
- the T class.Method Detail |
---|
public boolean hasRowBeanAnnotation()
public ODSSettings getReadingODSSettings() throws AnnotationProcessorException
AnnotationProcessorException
- if error occurs during annotation processing.public ODSSettings getWritingODSSettings() throws AnnotationProcessorException
AnnotationProcessorException
- if an error occurs during settings identification.public CSVSettings getReadingCSVSettings() throws AnnotationProcessorException
AnnotationProcessorException
- if an error occurs during settings identification.public CSVSettings getWritingCSVSettings() throws AnnotationProcessorException
AnnotationProcessorException
- if an error occurs during settings identification.public IBeanProcessor<T> getBeanProcessor() throws AnnotationProcessorException
AnnotationProcessorException
- if error occurs during annotation processing.public IRowProcessor<T> getRowProcessor() throws AnnotationProcessorException
AnnotationProcessorException
- if error occurs during annotation processing.protected boolean getWritingProcessor(Map<Integer,List<CellProcessor<T>>> map)
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.
protected boolean getReadingProcessor(int translate, List<IPropertyProcessor<T>> processors, Map<Integer,Integer> map)
translate
- index from which begin the column numerotationprocessors
- the processor list to completemap
- the map to complete. this map shows for each cell num the count of the property processors setted on.
private boolean getWritingProcessor(Class<? super T> beanClass, Map<Integer,List<CellProcessor<T>>> map)
beanClass
- the bean class.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.
private boolean getReadingProcessor(Class<? super T> beanClass, int translate, List<IPropertyProcessor<T>> processors, Map<Integer,Integer> map)
beanClass
- the bean class.translate
- index from which begin the column numerotationprocessors
- the list to completemap
- the map to complete. this map shows for each cell num the count of the property processors setted on.
private boolean checkField(Field field, Class<? super T> beanClass)
field
- the fieldbeanClass
- the class declaring the field.
private RowBeanProcessor.ODSPropertyType identifyPermittedProperty(Param param, RowBeanProcessor.ODSPropertyType[] permittedProperties)
param
- the param.permittedProperties
- allowed ODSPropertyTypes.
private ODSSettings getODSSettings(Param[] odsParams, RowBeanProcessor.ODSPropertyType[] properties, String type) throws AnnotationProcessorException
odsParams
- the ODS Paramsproperties
- the ODS Properties which are allowed for the processtype
- String identifying the process
AnnotationProcessorException
- if errors occurprivate RowBeanProcessor.CSVPropertyType identifyPermittedProperty(Param param, RowBeanProcessor.CSVPropertyType[] permittedProperties)
param
- the param.permittedProperties
- allowed CSVPropertyTypes.
private CSVSettings getCSVSettings(Param[] csvParams, RowBeanProcessor.CSVPropertyType[] properties, String type) throws AnnotationProcessorException
csvParams
- the params to translate as CSVSettingsproperties
- the CSVProperties which are allowed for the specifig processtype
- String identifying the process
AnnotationProcessorException
- if errors occur.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |