Class AbstractMultiBeanRowProcessor<C extends Context>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long record  
      private java.util.HashMap<java.lang.Class<?>,​java.lang.Object> row  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractMultiBeanRowProcessor​(java.lang.Class... beanTypes)
      Creates a processor for java beans of multiple types
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void beanProcessed​(java.lang.Class<?> beanType, java.lang.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​(java.util.Map<java.lang.Class<?>,​java.lang.Object> row, C context)
      Invoked by the processor after all beans of a valid record have been processed.
      private void submitRow​(C context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • row

        private final java.util.HashMap<java.lang.Class<?>,​java.lang.Object> row
      • record

        private long record
    • Constructor Detail

      • AbstractMultiBeanRowProcessor

        public AbstractMultiBeanRowProcessor​(java.lang.Class... beanTypes)
        Creates a processor for java beans of multiple types
        Parameters:
        beanTypes - the classes with their attributes mapped to fields of records parsed by an AbstractParser or written by an AbstractWriter.
    • Method Detail

      • processStarted

        public void processStarted​(C context)
        Description copied from interface: Processor
        This method will by invoked by the parser once, when it is ready to start processing the input.
        Specified by:
        processStarted in interface Processor<C extends Context>
        Overrides:
        processStarted in class AbstractMultiBeanProcessor<C extends Context>
        Parameters:
        context - A contextual object with information and controls over the current state of the parsing process
      • beanProcessed

        public final void beanProcessed​(java.lang.Class<?> beanType,
                                        java.lang.Object beanInstance,
                                        C context)
        Description copied from class: AbstractMultiBeanProcessor
        Invoked by the processor after all values of a valid record have been processed and converted into a java object.
        Specified by:
        beanProcessed in class AbstractMultiBeanProcessor<C extends Context>
        Parameters:
        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 process
      • submitRow

        private void submitRow​(C context)
      • processEnded

        public void processEnded​(C context)
        Description copied from interface: Processor
        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 Context.stop().

        Specified by:
        processEnded in interface Processor<C extends Context>
        Overrides:
        processEnded in class AbstractMultiBeanProcessor<C extends Context>
        Parameters:
        context - A contextual object with information and controls over the state of the parsing process
      • rowProcessed

        protected abstract void rowProcessed​(java.util.Map<java.lang.Class<?>,​java.lang.Object> row,
                                             C context)
        Invoked by the processor after all beans of a valid record have been processed.
        Parameters:
        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