# Class CLNParsers

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

public final class CLNParsers extends Object
The main parser factory.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CLNParsers()`
  The main parser factory.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CLNParserType`
  `createParser(CLNParseRequest request)`
  Create a parser for the given request.
  `Optional<CLNParserFactoryType>`
  `findParserFactoryFor(CLNVersion version)`
  Find a parser factory for the given file version.
  `Optional<CLNParserFactoryType>`
  `findParserFactoryFor(SeekableByteChannel channel, URI source)`
  Find a parser factory for the given file.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 CLNException
    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:
      `CLNException` - On errors

  - ### createParser

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