Interface Collector<I,​E>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void commit​(E extractor)
      Try to add an extractor to the collection
      I extract​(E extractor)
      Try to extract the item from an extractor without adding it to the collection
      java.util.List<java.lang.Throwable> getErrors()
      Get all errors
      java.util.List<I> getItems()
      Get all items
      void reset()
      Reset all collected items and errors
    • Method Detail

      • commit

        void commit​(E extractor)
        Try to add an extractor to the collection
        Parameters:
        extractor - the extractor to add
      • extract

        I extract​(E extractor)
           throws ParsingException
        Try to extract the item from an extractor without adding it to the collection
        Parameters:
        extractor - the extractor to use
        Returns:
        the item
        Throws:
        ParsingException - thrown if there is an error extracting the required fields of the item.
      • getItems

        java.util.List<I> getItems()
        Get all items
        Returns:
        the items
      • getErrors

        java.util.List<java.lang.Throwable> getErrors()
        Get all errors
        Returns:
        the errors
      • reset

        void reset()
        Reset all collected items and errors