Class DefaultParser

java.lang.Object
com.norconex.importer.handler.parser.impl.DefaultParser
All Implemented Interfaces:
Configurable<DefaultParserConfig>, ConfigurableDocHandler<DefaultParserConfig>, DocHandler

public class DefaultParser extends Object implements ConfigurableDocHandler<DefaultParserConfig>
Parser class when no other handlers are specified. The importer uses Apache Tika parser in its own way with default settings common for most senarios. If you want to use and configure Tika yourself, use TikaParser.
  • Constructor Details

    • DefaultParser

      public DefaultParser()
  • Method Details

    • init

      public void init() throws IOException
      Description copied from interface: DocHandler
      Initialize any required resources. Invoked once per Importer instance, by the Importer.
      Specified by:
      init in interface DocHandler
      Throws:
      IOException - An I/O exception of some sort has occurred
    • close

      public void close()
      Description copied from interface: DocHandler
      Closes any required resources. Invoked once per Importer instance, by the Importer.
      Specified by:
      close in interface DocHandler
    • handle

      public boolean handle(DocHandlerContext ctx) throws IOException
      Description copied from interface: DocHandler
      Perform any operations on a document.
      Specified by:
      handle in interface DocHandler
      Parameters:
      ctx - the document handling context
      Returns:
      false to stop processing and reject a document or true to proceed to the next configured handler.
      Throws:
      IOException - An I/O exception of some sort has occurred
    • createRecursiveParser

      protected org.apache.tika.parser.Parser createRecursiveParser(DocHandlerContext docCtx, Writer output, List<Doc> embeddedDocs)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getConfiguration

      public DefaultParserConfig getConfiguration()
      Specified by:
      getConfiguration in interface Configurable<DefaultParserConfig>