|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.common.processor.core.AbstractMultiBeanProcessor<C>
com.univocity.parsers.common.processor.core.AbstractMultiBeanRowProcessor<C>
public abstract class AbstractMultiBeanRowProcessor<C extends Context>
A 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.univocity.parsers.annotations.
For each row processed, one or more java bean instances of any given class will be created with their fields populated.
Once all beans are populated from an individual input record, they will be sent to through the rowProcessed(Map, Context) method,
where the user can access all beans parsed for that row.
AbstractParser,
Processor,
AbstractBeanProcessor,
AbstractMultiBeanProcessor| Constructor Summary | |
|---|---|
AbstractMultiBeanRowProcessor(Class... beanTypes)
Creates a processor for java beans of multiple types |
|
| Method Summary | |
|---|---|
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. |
void |
processEnded(C context)
This method will by invoked by the parser once, after the parsing process stopped and all resources were closed. |
void |
processStarted(C context)
This method will by invoked by the parser once, when it is ready to start processing the input. |
protected abstract void |
rowProcessed(Map<Class<?>,Object> row,
C context)
Invoked by the processor after all beans of a valid record have been processed. |
| Methods inherited from class com.univocity.parsers.common.processor.core.AbstractMultiBeanProcessor |
|---|
convertAll, convertFields, convertIndexes, convertType, getBeanClasses, getProcessorOfType, rowProcessed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractMultiBeanRowProcessor(Class... beanTypes)
beanTypes - the classes with their attributes mapped to fields of records parsed by an AbstractParser or written by an AbstractWriter.| Method Detail |
|---|
public void processStarted(C context)
Processor
processStarted in interface Processor<C extends Context>processStarted in class AbstractMultiBeanProcessor<C extends Context>context - A contextual object with information and controls over the current state of the parsing process
public final void beanProcessed(Class<?> beanType,
Object beanInstance,
C context)
AbstractMultiBeanProcessor
beanProcessed in class AbstractMultiBeanProcessor<C extends Context>beanType - the type of the object created by the parser using the information collected for an individual record.beanInstance - java object created with the information extracted by the parser for an individual record.context - A contextual object with information and controls over the current state of the parsing processpublic void processEnded(C context)
Processor 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 Context.stop().
processEnded in interface Processor<C extends Context>processEnded in class AbstractMultiBeanProcessor<C extends Context>context - A contextual object with information and controls over the state of the parsing process
protected abstract void rowProcessed(Map<Class<?>,Object> row,
C context)
row - 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.context - A contextual object with information and controls over the current state of the parsing process
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||