Class SimpleTextExtractionStrategy

All Implemented Interfaces:
IEventListener, ITextExtractionStrategy

public class SimpleTextExtractionStrategy extends Object implements ITextExtractionStrategy
  • Constructor Details

    • SimpleTextExtractionStrategy

      public SimpleTextExtractionStrategy()
  • Method Details

    • eventOccurred

      public void eventOccurred (IEventData data, EventType type)
      Description copied from interface: IEventListener
      Called when some event occurs during parsing a content stream.
      Specified by:
      eventOccurred in interface IEventListener
      data - Combines the data required for processing corresponding event type.
      type - Event type.
    • getSupportedEvents

      public Set<EventType> getSupportedEvents()
      Description copied from interface: IEventListener
      Provides the set of event types this listener supports. Returns null if all possible event types are supported.
      Specified by:
      getSupportedEvents in interface IEventListener
      Set of event types supported by this listener or null if all possible event types are supported.
    • getResultantText

      public String getResultantText()
      Returns the result so far.
      Specified by:
      getResultantText in interface ITextExtractionStrategy
      a String with the resulting text.
    • appendTextChunk

      protected final void appendTextChunk (CharSequence text)
      Used to actually append text to the text results. Subclasses can use this to insert text that wouldn't normally be included in text parsing (e.g. result of OCR performed against image content)
      text - the text to append to the text results accumulated so far