Class CoffeePickSerializers
java.lang.Object
com.io7m.coffeepick.runtime.parser.api.CoffeePickSerializers
- All Implemented Interfaces:
CoffeePickSerializersType
public final class CoffeePickSerializers extends java.lang.Object implements CoffeePickSerializersType
The default serializers implementation.
-
Method Summary
Modifier and Type Method Description static CoffeePickSerializersType
createFrom(java.util.List<SPISerializerProviderType> in_providers)
Create a new parser provider, using parsers from the given list of providers.static CoffeePickSerializersType
createFromServiceLoader()
Create a new parser provider, loading parsers viaServiceLoader
.CoffeePickSerializerType
createSerializer(FormatDescription format, FormatVersion version, java.io.OutputStream output)
Create a new serializer.java.util.Optional<FormatDescription>
findFormat(java.net.URI format)
Find the format with the given name.java.util.SortedSet<FormatVersion>
findSupportedVersions(FormatDescription format)
-
Method Details
-
createFromServiceLoader
Create a new parser provider, loading parsers viaServiceLoader
.- Returns:
- A new parser provider
-
createFrom
public static CoffeePickSerializersType createFrom(java.util.List<SPISerializerProviderType> 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
-
findSupportedVersions
- Specified by:
findSupportedVersions
in interfaceCoffeePickSerializersType
- Parameters:
format
- The output format- Returns:
- The supported versions of the given format, if any
-
findFormat
Description copied from interface:CoffeePickSerializersType
Find the format with the given name.- Specified by:
findFormat
in interfaceCoffeePickSerializersType
- Parameters:
format
- The format name- Returns:
- The format description if one exists
-
createSerializer
public CoffeePickSerializerType createSerializer(FormatDescription format, FormatVersion version, java.io.OutputStream output) throws java.io.IOExceptionDescription copied from interface:CoffeePickSerializersType
Create a new serializer.- Specified by:
createSerializer
in interfaceCoffeePickSerializersType
- Parameters:
format
- The output formatversion
- The output format versionoutput
- The output stream- Returns:
- A new serializer
- Throws:
java.io.IOException
- On I/O errors
-