Interface TextStateParser.HeaderLine<M>

Type Parameters:
M - the type of the model object
Enclosing class:
TextStateParser<M>

public static interface TextStateParser.HeaderLine<M>
Matches a line as a header entry during the headers phase.

Implementations should inspect the given line and, if it represents a header record, update the model accordingly and return true. Returning false signals that this line is not a header, which causes the parser to exit the headers phase immediately. The line that caused the exit is then passed to the states phase.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    parse(String line, M model)
    Attempts to parse the given line as a header entry.
  • Method Details

    • parse

      boolean parse(String line, M model)
      Attempts to parse the given line as a header entry.
      Parameters:
      line - the trimmed, non-empty line to inspect
      model - the model to update if the line is accepted
      Returns:
      true if the line was recognised as a header and processed, false otherwise