Class AbstractBeanListProcessor<T,​C extends Context>

    • Constructor Detail

      • AbstractBeanListProcessor

        public AbstractBeanListProcessor​(java.lang.Class<T> beanType)
        Creates a processor that stores java beans of a given type into a list
        Parameters:
        beanType - the class with its attributes mapped to fields of records parsed by an AbstractParser or written by an AbstractWriter.
    • Method Detail

      • beanProcessed

        public void beanProcessed​(T bean,
                                  C context)
        Stores the generated java bean produced with a parsed record into a list.
        Specified by:
        beanProcessed in class AbstractBeanProcessor<T,​C extends Context>
        Parameters:
        bean - java bean generated 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
        See Also:
        BeanProcessor
      • getBeans

        public java.util.List<T> getBeans()
        Returns the list of generated java beans at the end of the parsing process.
        Returns:
        the list of generated java beans at the end of the parsing process.
      • 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<T>
        Overrides:
        processStarted in class AbstractBeanProcessor<T,​C extends Context>
        Parameters:
        context - A contextual object with information and controls over the current state of the parsing process
      • 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<T>
        Overrides:
        processEnded in class AbstractBeanProcessor<T,​C extends Context>
        Parameters:
        context - A contextual object with information and controls over the state of the parsing process
      • getHeaders

        public java.lang.String[] getHeaders()
        Returns the record headers. This can be either the headers defined in CommonSettings.getHeaders() or the headers parsed in the file when CommonSettings.getHeaders() equals true
        Returns:
        the headers of all records parsed.