Class CLNParsers

java.lang.Object
com.io7m.calino.parser.api.CLNParsers

public final class CLNParsers extends Object
The main parser factory.
  • Constructor Details

    • CLNParsers

      public CLNParsers()
      The main parser factory.
  • Method Details

    • findParserFactoryFor

      public Optional<CLNParserFactoryType> findParserFactoryFor(CLNVersion version)
      Find a parser factory for the given file version.
      Parameters:
      version - The file version
      Returns:
      A parser factory
    • findParserFactoryFor

      public Optional<CLNParserFactoryType> findParserFactoryFor(SeekableByteChannel channel, URI source) throws IOException
      Find a parser factory for the given file. The file will be probed to determine which file version is present.
      Parameters:
      channel - The file channel
      source - The file source
      Returns:
      A parser factory
      Throws:
      IOException - On errors
    • createParser

      public CLNParserType createParser(CLNParseRequest request) throws IOException
      Create a parser for the given request.
      Parameters:
      request - The request
      Returns:
      A parser
      Throws:
      IOException - On errors