Interface DoclingProvider


public interface DoclingProvider
Adapter boundary for Docling execution.

Docling itself is deliberately not bundled. Consumers choose the official Docling MCP server or a locally installed docling executable. The factories return a null-object provider when no local runtime is available, so callers never branch on null and receive a clear checked failure.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    One rendered page image returned by a provider fallback.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether this provider can currently accept conversions.
    mcp(com.tnsai.mcp.client.McpClient client)
    Adapts an already connected and initialized TnsAI MCP client whose server shares access to the admitted source path.
    Returns the fail-loud null object used when Docling is not configured.
    parse(Path source)
    Converts one already-admitted local file.
    renderPages(Path source)
    Renders page images when the provider supports referenced page exports.
    subprocess(String command)
    Creates a lazy local CLI provider.
  • Method Details

    • available

      boolean available()
      Returns whether this provider can currently accept conversions.
    • parse

      DocumentResult parse(Path source) throws IOException
      Converts one already-admitted local file.
      Throws:
      IOException
    • renderPages

      default List<DoclingProvider.RenderedPage> renderPages(Path source) throws IOException
      Renders page images when the provider supports referenced page exports. Providers without that capability return an empty immutable list.
      Throws:
      IOException
    • mcp

      static DoclingProvider mcp(com.tnsai.mcp.client.McpClient client)
      Adapts an already connected and initialized TnsAI MCP client whose server shares access to the admitted source path.
    • subprocess

      static DoclingProvider subprocess(String command)
      Creates a lazy local CLI provider. The command is never evaluated by a shell.
    • noOp

      static DoclingProvider noOp()
      Returns the fail-loud null object used when Docling is not configured.