|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.DefaultConversionProcessor
com.univocity.parsers.common.processor.core.BeanConversionProcessor<T>
T - the annotated class type.public class BeanConversionProcessor<T>
The base class for Processor and RowWriterProcessor implementations that support java beans annotated with the annotations provided in com.univocity.parsers.annotations.
Processor,
RowWriterProcessor| Field Summary | |
|---|---|
protected boolean |
initialized
|
protected Set<FieldMapping> |
parsedFields
|
| Constructor Summary | |
|---|---|
BeanConversionProcessor(Class<T> beanType)
Initializes the BeanConversionProcessor with the annotated bean class |
|
| Method Summary | |
|---|---|
protected void |
addConversion(Conversion conversion,
FieldMapping mapping)
Associates a conversion to a field of the java bean class. |
T |
createBean(String[] row,
Context context)
Converts a record with values extracted from the parser into a java bean instance. |
Class<T> |
getBeanClass()
Returns the class of the annotated java bean instances that will be manipulated by this processor. |
void |
initialize()
Identifies and extracts fields annotated with the Parsed annotation |
boolean |
isStrictHeaderValidationEnabled()
Returns a flag indicating whether all headers declared in the annotated class must be present in the input. |
protected boolean |
processField(FieldMapping field)
Determines whether or not an annotated field should be processed. |
Object[] |
reverseConversions(T bean,
String[] headers,
int[] indexesToWrite)
Converts a java bean instance into a sequence of values for writing. |
void |
setStrictHeaderValidationEnabled(boolean strictHeaderValidationEnabled)
Defines whether all headers declared in the annotated class must be present in the input. |
| Methods inherited from class com.univocity.parsers.common.DefaultConversionProcessor |
|---|
applyConversions, convertAll, convertFields, convertIndexes, convertType, handleConversionError, initializeConversions, reverseConversions, toDataProcessingException |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Set<FieldMapping> parsedFields
protected boolean initialized
| Constructor Detail |
|---|
public BeanConversionProcessor(Class<T> beanType)
beanType - the class annotated with one or more of the annotations provided in com.univocity.parsers.annotations.| Method Detail |
|---|
public boolean isStrictHeaderValidationEnabled()
public final void initialize()
Parsed annotation
public void setStrictHeaderValidationEnabled(boolean strictHeaderValidationEnabled)
strictHeaderValidationEnabled - flag indicating whether strict validation of headers is enabled.protected boolean processField(FieldMapping field)
field - the field to be processed
true if the given field should be processed, otherwise false.
protected void addConversion(Conversion conversion,
FieldMapping mapping)
conversion - The conversion object that must be executed against the given fieldmapping - the helper object that contains information about how a field is mapped.
public T createBean(String[] row,
Context context)
row - The values extracted from the parsercontext - The current state of the parsing process
public final Object[] reverseConversions(T bean,
String[] headers,
int[] indexesToWrite)
bean - an instance of the type defined in this class constructor.headers - All field names used to produce records in a given destination. May be null if no headers have been defined in CommonSettings.getHeaders()indexesToWrite - The indexes of the headers that are actually being written. May be null if no fields have been selected using CommonSettings.selectFields(String...) or CommonSettings.selectIndexes(Integer...)
public Class<T> getBeanClass()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||