Package com.io7m.calino.parser.api
Class CLNParsers
java.lang.Object
com.io7m.calino.parser.api.CLNParsers
The main parser factory.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateParser
(CLNParseRequest request) Create a parser for the given request.findParserFactoryFor
(CLNVersion version) Find a parser factory for the given file version.findParserFactoryFor
(SeekableByteChannel channel, URI source) Find a parser factory for the given file.
-
Constructor Details
-
CLNParsers
public CLNParsers()The main parser factory.
-
-
Method Details
-
findParserFactoryFor
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 channelsource
- The file source- Returns:
- A parser factory
- Throws:
IOException
- On errors
-
createParser
Create a parser for the given request.- Parameters:
request
- The request- Returns:
- A parser
- Throws:
IOException
- On errors
-