Class ChunkTarget

java.lang.Object
org.apache.tika.inference.ChunkTarget

public final class ChunkTarget extends Object
Where the chunks produced for a unit land and how they name where they came from. The dispatcher decides the destination (InferenceUnit.getDestination()); when that is not the unit's own document, an EmbeddedLocator names the child the chunks came from. The in-parse form is for a parser that writes during its own document's parse.
  • Method Details

    • of

      public static ChunkTarget of(InferenceUnit unit)
      The unit's destination, with a locator naming the unit's document when lifted off it.
    • resolve

      public static ChunkTarget resolve(Metadata target, ParseContext context)
      During a parse: the parent for an inline part or a page render the wrapper numbered, the document itself otherwise.
    • self

      public static ChunkTarget self(Metadata target)
      The target keeps its own chunks.
    • getMetadata

      public Metadata getMetadata()
    • getLocator

      public EmbeddedLocator getLocator()
      Names the child the chunks came from; null when they stay on that child.
    • write

      public void write(List<Chunk> chunks, String field) throws IOException
      Tags the chunks with the locator, if any, and appends them to the field.
      Throws:
      IOException