Class CoffeePickParsers
- java.lang.Object
-
- com.io7m.coffeepick.runtime.parser.api.CoffeePickParsers
-
- All Implemented Interfaces:
CoffeePickParsersType
public final class CoffeePickParsers extends java.lang.Object implements CoffeePickParsersType
The default implementation of theCoffeePickParsersTypeinterface.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CoffeePickParsersTypecreateFrom(java.util.List<SPIParserProviderType> in_providers)Create a new parser provider, using parsers from the given list of providers.static CoffeePickParsersTypecreateFromServiceLoader()Create a new parser provider, loading parsers viaServiceLoader.CoffeePickParserTypecreateParser(CoffeePickParseRequest request)Create a parser for the given request, probing the input stream for format information and using this to pick an appropriate parser implementation.
-
-
-
Method Detail
-
createFromServiceLoader
public static CoffeePickParsersType createFromServiceLoader()
Create a new parser provider, loading parsers viaServiceLoader.- Returns:
- A new parser provider
-
createFrom
public static CoffeePickParsersType createFrom(java.util.List<SPIParserProviderType> in_providers)
Create a new parser provider, using parsers from the given list of providers.- Parameters:
in_providers- The list of providers- Returns:
- A new parser provider
-
createParser
public CoffeePickParserType createParser(CoffeePickParseRequest request) throws java.io.IOException, ParserFailureException
Description copied from interface:CoffeePickParsersTypeCreate a parser for the given request, probing the input stream for format information and using this to pick an appropriate parser implementation.- Specified by:
createParserin interfaceCoffeePickParsersType- Parameters:
request- The parse request- Returns:
- A parser
- Throws:
java.io.IOException- On I/O errorsParserFailureException- On parser configuration problems, such as there not being an available provider for the detected format
-
-