Package com.io7m.smfj.format.xml
Class SMFFormatXML
- java.lang.Object
-
- com.io7m.smfj.format.xml.SMFFormatXML
-
- All Implemented Interfaces:
SMFParserProviderType,SMFVersionProbeProviderType,SMFSerializerProviderType
public final class SMFFormatXML extends java.lang.Object implements SMFParserProviderType, SMFSerializerProviderType, SMFVersionProbeProviderType
A format provider for the XML format.
-
-
Constructor Summary
Constructors Constructor Description SMFFormatXML()Construct a format provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SMFParserRandomAccessTypeparserCreateRandomAccess(SMFParserEventsType events, java.net.URI uri, java.nio.channels.FileChannel file)SMFParserSequentialTypeparserCreateSequential(SMFParserEventsType events, java.net.URI uri, java.io.InputStream stream)SMFFormatDescriptionparserFormat()java.util.SortedSet<SMFFormatVersion>parserSupportedVersions()SMFPartialLogged<SMFVersionProbed>probe(java.io.InputStream stream)Attempt to probe the given file stream.SMFSerializerTypeserializerCreate(SMFFormatVersion version, java.net.URI uri, java.io.OutputStream stream)SMFFormatDescriptionserializerFormat()java.util.SortedSet<SMFFormatVersion>serializerSupportedVersions()
-
-
-
Method Detail
-
parserFormat
public SMFFormatDescription parserFormat()
- Specified by:
parserFormatin interfaceSMFParserProviderType- Returns:
- The format that this provider supports
-
parserSupportedVersions
public java.util.SortedSet<SMFFormatVersion> parserSupportedVersions()
- Specified by:
parserSupportedVersionsin interfaceSMFParserProviderType- Returns:
- The supported versions of the format
-
parserCreateSequential
public SMFParserSequentialType parserCreateSequential(SMFParserEventsType events, java.net.URI uri, java.io.InputStream stream) throws java.lang.UnsupportedOperationException
- Specified by:
parserCreateSequentialin interfaceSMFParserProviderType- Parameters:
events- The event receiveruri- The URI referred to by the input stream, for diagnostic messagesstream- An input stream- Returns:
- A new parser for the format
- Throws:
java.lang.UnsupportedOperationException- If sequential parsing is not supported- See Also:
SMFFormatDescription.randomAccess()
-
parserCreateRandomAccess
public SMFParserRandomAccessType parserCreateRandomAccess(SMFParserEventsType events, java.net.URI uri, java.nio.channels.FileChannel file) throws java.lang.UnsupportedOperationException
- Specified by:
parserCreateRandomAccessin interfaceSMFParserProviderType- Parameters:
events- The event receiveruri- The URI referred to by the input stream, for diagnostic messagesfile- A file channel- Returns:
- A new parser for the format
- Throws:
java.lang.UnsupportedOperationException- If random-access parsing is not supported- See Also:
SMFFormatDescription.randomAccess()
-
probe
public SMFPartialLogged<SMFVersionProbed> probe(java.io.InputStream stream)
Description copied from interface:SMFVersionProbeProviderTypeAttempt to probe the given file stream.- Specified by:
probein interfaceSMFVersionProbeProviderType- Parameters:
stream- The stream- Returns:
- A probed version or a list of errors
-
serializerFormat
public SMFFormatDescription serializerFormat()
- Specified by:
serializerFormatin interfaceSMFSerializerProviderType- Returns:
- The format that this provider supports
-
serializerSupportedVersions
public java.util.SortedSet<SMFFormatVersion> serializerSupportedVersions()
- Specified by:
serializerSupportedVersionsin interfaceSMFSerializerProviderType- Returns:
- The supported versions of the format
-
serializerCreate
public SMFSerializerType serializerCreate(SMFFormatVersion version, java.net.URI uri, java.io.OutputStream stream) throws java.lang.UnsupportedOperationException, java.io.IOException
- Specified by:
serializerCreatein interfaceSMFSerializerProviderType- Parameters:
version- The format versionuri- The URI referred to by the output stream, for diagnostic messagesstream- An output stream- Returns:
- A new serializer for the format
- Throws:
java.lang.UnsupportedOperationException- If the given version is not supportedjava.io.IOException- On I/O errors
-
-