Processor implementation for converting rows extracted from any implementation of AbstractParser into java objects, storing
them into lists. This processor stores beans in separate lists, one for each type of bean processed.
All lists of all types will have the same number of entries as the number of records in the input.
When an object of a particular type can't be generated from a row, null will be added to the list. This ensures all lists are the same size,
and each element of each list contains the exact information parsed from each row.
The class types passed to the constructor of this class must contain the annotations provided in com..
AbstractParser, Processor, AbstractBeanProcessor, AbstractMultiBeanProcessor
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final Class | |
| private final int | |
| private String[] |
| Access | Constructor and Description |
|---|---|
| public | AbstractMultiBeanListProcessor(int
expected number of rows to be parsed from the input which will be converted into java beans.
Used to pre-allocate the size of the output expectedBeanCount, Class<T>... List returned by getBeans()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 |
| public | AbstractMultiBeanListProcessor(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 < the type of bean processed T> List | |
| public Map | Returns: all beans processed from the input.Returns a map of all beans processed from the input. |
| public final String[] | |
| public final void | processEnded(C
A contextual object with information and controls over the state of the parsing process context)Overrides com. Implements com. |
| public final void | processStarted(C
A contextual object with information and controls over the current state of the parsing process context)Overrides com. Implements com. |
| protected final void | rowProcessed(Map<Class<?>, Object>
a map containing all object instances generated from an input row. The map is reused internally. Make a copy if you want to keep the map. row, C A contextual object with information and controls over the current state of the parsing process context)Implements abstract com. |
| beans | back to summary |
|---|---|
| private final List<E>[] beans | |
| beanTypes | back to summary |
|---|---|
| private final Class<T>[] beanTypes | |
| expectedBeanCount | back to summary |
|---|---|
| private final int expectedBeanCount | |
| headers | back to summary |
|---|---|
| private String[] headers | |
| AbstractMultiBeanListProcessor | back to summary |
|---|---|
| public AbstractMultiBeanListProcessor(int expectedBeanCount, Class<T>... beanTypes) Creates a processor for java beans of multiple types
| |
| AbstractMultiBeanListProcessor | back to summary |
|---|---|
| public AbstractMultiBeanListProcessor(Class<T>... beanTypes) Creates a processor for java beans of multiple types
| |
| getBeans | back to summary |
|---|---|
| public <T> List Returns the beans of a given type processed from the input. | |
| getBeans | back to summary |
|---|---|
| public Map Returns a map of all beans processed from the input. | |
| getHeaders | back to summary |
|---|---|
| public final String[] getHeaders() Returns the record headers. This can be either the headers defined in
| |
| processEnded | back to summary |
|---|---|
| public final void processEnded(C context) Overrides com. 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 final void processStarted(C context) Overrides com. 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 |
|---|---|
| protected final void rowProcessed(Map<Class<?>, Object> row, C context) Implements abstract com. Doc from com. Invoked by the processor after all beans of a valid record have been processed.
| |