Processor implementation for converting rows extracted from any implementation of AbstractParser into java objects.
The class types passed to the constructor of this class must contain the annotations provided in com..
For each row processed, one or more java bean instances of any given class will be created with their fields populated.
Each individual instance will then be sent to the AbstractMultiBeanProcessor#beanProcessed(Class, Object, Context) method, where the user can access the
beans parsed for each row.
AbstractParser, Processor, com.univocity.parsers.common.processor.BeanProcessor
| Modifier and Type | Field and Description |
|---|---|
| private final AbstractBeanProcessor | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | AbstractMultiBeanProcessor(Class<T>...
the classes with their attributes mapped to fields of records parsed by an beanTypes)AbstractParser or written by an AbstractWriter.Creates a processor for java beans of multiple types |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | beanProcessed(Class<?>
the type of the object created by the parser using the information collected for an individual record. beanType, Object java object created with the information extracted by the parser for an individual record. beanInstance, C A contextual object with information and controls over the current state of the parsing process context)Invoked by the processor after all values of a valid record have been processed and converted into a java object. |
| public void | convertAll(Conversion<I, O>...
The sequence of conversions to be executed in all elements of a record conversions)Implements com. Conversion objects over all elements of a record
|
| public FieldSet | convertFields(Conversion<I, O>...
The sequence of conversions to be executed in a set of field indexes. conversions)Implements com. Conversion objects over fields of a record by name.
|
| public FieldSet | convertIndexes(Conversion<I, O>...
The sequence of conversions to be executed in a set of field indexes. conversions)Implements com. Conversion objects over indexes of a record.
|
| public void | convertType(Class<?>
the type over which a sequence of conversions should be applied type, Conversion<I, O>... the sequence of conversions to apply over values of the given type. conversions)Implements com. |
| public final Class | |
| public < the type of java bean being processed T> AbstractBeanProcessor | Returns: thecom. that handles java beans of the given class.the type of java bean being processed type)Returns the |
| public void | processEnded(C
A contextual object with information and controls over the state of the parsing process context)Implements com. |
| public void | processStarted(C
A contextual object with information and controls over the current state of the parsing process context)Implements com. |
| public final void | rowProcessed(String[]
the data extracted by the parser for an individual record. Note that:
row, C
A contextual object with information and controls over the current state of the parsing process context)Implements com. |
| beanProcessors | back to summary |
|---|---|
| private final AbstractBeanProcessor<?, C>[] beanProcessors | |
| processorMap | back to summary |
|---|---|
| private final Map<Class<T>, AbstractBeanProcessor<T, C extends Context>> processorMap | |
| AbstractMultiBeanProcessor | back to summary |
|---|---|
| public AbstractMultiBeanProcessor(Class<T>... beanTypes) Creates a processor for java beans of multiple types
| |
| beanProcessed | back to summary |
|---|---|
| public abstract void beanProcessed(Class<?> beanType, Object beanInstance, C context) Invoked by the processor after all values of a valid record have been processed and converted into a java object.
| |
| convertAll | back to summary |
|---|---|
| public void convertAll(Conversion<I, O>... conversions) Implements com. Doc from com. Applies a set of
| |
| convertFields | back to summary |
|---|---|
| public FieldSet Implements com. Doc from com. Applies a set of The idiom to define which fields should have these conversions applied is as follows:
| |
| convertIndexes | back to summary |
|---|---|
| public FieldSet Implements com. Doc from com. Applies a set of The idiom to define which indexes should have these conversions applies is as follows: processor.convertIndexes(Conversions.trim(), Conversions.toUpperCase()).add(2, 5); // applies trim and uppercase conversions to fields in indexes 2 and 5
| |
| convertType | back to summary |
|---|---|
| public void convertType(Class<?> type, Conversion<I, O>... conversions) Implements com. Doc from com. Applies a sequence of conversions over values of a given type. Used for writing.
| |
| getBeanClasses | back to summary |
|---|---|
| public final Class | |
| getProcessorOfType | back to summary |
|---|---|
| public <T> AbstractBeanProcessor Returns the
| |
| processEnded | back to summary |
|---|---|
| public void processEnded(C context) Implements com. Doc from com. This method will by invoked by the parser once, after the parsing process stopped and all resources were closed. It will always be called by the parser: in case of errors, if the end of the input us reached, or if the user stopped the process manually using
| |
| processStarted | back to summary |
|---|---|
| public void processStarted(C context) Implements com. Doc from com. This method will by invoked by the parser once, when it is ready to start processing the input.
| |
| rowProcessed | back to summary |
|---|---|
| public final void rowProcessed(String[] row, C context) Implements com. Doc from com. Invoked by the parser after all values of a valid record have been processed.
| |