Package org.jreleaser.config
Interface JReleaserConfigParser
- All Known Implementing Classes:
AbstractJReleaserConfigParser
public interface JReleaserConfigParser
Allows external configuration to be parsed with a custom format.
- Since:
- 0.1.0
- Author:
- Andres Almiray
-
Method Summary
Modifier and TypeMethodDescriptionReturns the preferred file extension supported by this parser.<T> Tload(Class<T> type, InputStream inputStream) Loads a resource into a given type.parse(InputStream inputStream) Reads and parses external configuration into aJReleaserModelinstance.properties(InputStream inputStream) Reads and parses external configuration into aMapinstance.booleanWhether the given resource format is supported or not.booleanWhether the given config file format is supported or not.voidChecks the contents of the config file for syntax compliance.
-
Method Details
-
getPreferredFileExtension
String getPreferredFileExtension()Returns the preferred file extension supported by this parser.- Returns:
- the preferred file extension supported by this parser, should never return
null.
-
supports
Whether the given config file format is supported or not. Implementors would typically look at the file extension.- Parameters:
configFile- the configuration file to inspect- Returns:
trueif the given format is supported,falseotherwise.
-
supports
Whether the given resource format is supported or not. Implementors would typically look at the file extension.- Parameters:
resource- the resource to inspect- Returns:
trueif the given format is supported,falseotherwise.
-
validate
Checks the contents of the config file for syntax compliance.- Parameters:
configFile- the configuration file to inspect- Throws:
IOException
-
parse
Reads and parses external configuration into aJReleaserModelinstance.- Parameters:
inputStream- the configuration's input source- Returns:
- a configured
JReleaserModelinstance, should never returnnull. - Throws:
IOException- if an error occurs while reading from theInputStream.
-
load
Loads a resource into a given type.- Parameters:
inputStream- the resources' input source- Returns:
- the parsed instance, should never return
null. - Throws:
IOException- if an error occurs while reading from theInputStream.
-
properties
Reads and parses external configuration into aMapinstance. The input sorce defines key/values as an alternative to the Java properties format.- Parameters:
inputStream- the configuration's input source- Returns:
- a
Mapinstance, should never returnnull. - Throws:
IOException- if an error occurs while reading from theInputStream.- Since:
- 0.2.0
-