Interface ResourceFormatParser
-
- All Known Implementing Classes:
ResourceJsonFormatParser,ResourceXMLFormatParser,ResourceYamlFormatParser
public interface ResourceFormatParserResourceFormatParser 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.StringgetPreferredFileExtension()default java.lang.StringgetPreferredMimeType()INodeSetparseDocument(java.io.File file)Parse a fileINodeSetparseDocument(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
-
-