Interface ResourceFormatParser
-
- All Known Implementing Classes:
ResourceJsonFormatParser
,ResourceXMLFormatParser
,ResourceYamlFormatParser
public interface ResourceFormatParser
ResourceFormatParser is ...
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Set<java.lang.String>
getFileExtensions()
java.util.Set<java.lang.String>
getMIMETypes()
default java.lang.String
getPreferredFileExtension()
default java.lang.String
getPreferredMimeType()
INodeSet
parseDocument(java.io.File file)
Parse a fileINodeSet
parseDocument(java.io.InputStream input)
Parse an input stream
-
-
-
Method Detail
-
getFileExtensions
java.util.Set<java.lang.String> getFileExtensions()
- Returns:
- the list of file extensions that this format parser can parse.
-
getPreferredFileExtension
default java.lang.String getPreferredFileExtension()
- Returns:
- the single preferred file extension, or null
-
getMIMETypes
java.util.Set<java.lang.String> getMIMETypes()
- Returns:
- the list of MIME types that this format parser can parse. This may include wildcards such as "*/xml".
-
getPreferredMimeType
default java.lang.String getPreferredMimeType()
- Returns:
- the single preferred mime type, or null
-
parseDocument
INodeSet parseDocument(java.io.File file) throws ResourceFormatParserException
Parse a file- Parameters:
file
- input file- Returns:
- nodes
- Throws:
ResourceFormatParserException
- on parse error
-
parseDocument
INodeSet parseDocument(java.io.InputStream input) throws ResourceFormatParserException
Parse an input stream- Parameters:
input
- input stream- Returns:
- nodes
- Throws:
ResourceFormatParserException
- on parse error
-
-