Class AnnotatorRunner

java.lang.Object
org.coordinatekit.crf.annotator.AnnotatorRunner

@NullMarked public final class AnnotatorRunner extends Object
Parser-free invocation of the annotate flow.

This is the home of the annotate invocation logic, separated from the picocli command AnnotatorCommand (in the cli module). A caller that parses with its own command-line framework builds an AnnotatorConfiguration and calls run(AnnotatorConfiguration, AnnotatorFactory); this class performs the interactive-terminal precondition and maps exit codes, but does no argument parsing and imports no command-line parser. The shared terminal glue lives in TerminalSupport.

The interactive-terminal precondition rejects JLine "dumb" terminal types, which JLine returns when stdin/stdout are not attached to a real TTY — as happens under CI scripts, piped input, or nohup-style backgrounding. A non-interactive context is treated as a hard failure rather than a silent write of garbage to the output XML.

Exit codes:

  • Method Details

    • run

      public static int run(AnnotatorConfiguration configuration, AnnotatorRunner.AnnotatorFactory factory)
      Opens an interactive system terminal and runs the annotator produced by factory. Returns a process exit code suitable for System.exit(int).
      Parameters:
      configuration - the parser-free annotate configuration
      factory - the factory that constructs the annotator from the configuration and terminal
      Returns:
      the process exit code