Interface DocumentParsingObserver

All Superinterfaces:
AutoCloseable, Closeable

public interface DocumentParsingObserver extends Closeable
An interface to allow wrapping an XContentParser and observe the events emitted while parsing A default implementation returns a noop DocumentParsingObserver - does not wrap a XContentParser and does not do anything upon finishing parsing.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    a default noop implementation
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    An action to be performed upon finished parsing.
    void
    setIndexName(String indexName)
    Sets an indexName associated with parsed document.
    wrapParser(XContentParser xContentParser)
    Decorates a provided xContentParser with additional logic (gather some state).
  • Field Details

  • Method Details

    • wrapParser

      XContentParser wrapParser(XContentParser xContentParser)
      Decorates a provided xContentParser with additional logic (gather some state). The Decorator parser should use a state from DocumentParsingObserver in order to perform an action upon finished parsing which will be aware of the state gathered during parsing
      Parameters:
      xContentParser - to be decorated
      Returns:
      a decorator xContentParser
    • setIndexName

      void setIndexName(String indexName)
      Sets an indexName associated with parsed document.
      Parameters:
      indexName - an index name that is associated with the parsed document
    • close

      void close()
      An action to be performed upon finished parsing.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable