Interface ConfigurationParser
- All Known Implementing Classes:
ConfigurationParser.IniConfigurationParser
,ConfigurationParser.XmlConfigurationParser
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ConfigurationParser
Parser for various configuration formats.
Supported formats:
- XML
- INI / Properties
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ConfigurationParser.IniConfigurationParser
static class
ConfigurationParser.XmlConfigurationParser
-
Method Summary
Modifier and Type Method Description static ConfigurationParser
Ini()
Creates a newConfigurationParser
which reads ini, or property files.static ConfigurationParser
Ini(ConfigurationPropertyParser propertyParser)
Creates a newConfigurationParser
which reads ini, or property files.default Configuration
parse(String data)
Parses the configuration from the given input.Configuration
parse(Configuration configuration, String data)
Parses the configuration from the given input.static ConfigurationParser
Xml()
Creates a newConfigurationParser
which reads xml files.static ConfigurationParser
Xml(ConfigurationPropertyParser propertyParser)
Creates a newConfigurationParser
which reads xml files.
-
Method Details
-
parse
Parses the configuration from the given input.- Parameters:
data
- the input to parse- Returns:
- the parsed configuration
- Throws:
StorageConfigurationException
- if an error occurs while parsing
-
parse
Parses the configuration from the given input.- Parameters:
configuration
- the configuration to populatedata
- the input to parse- Returns:
- the given configuration
- Throws:
StorageConfigurationException
- if an error occurs while parsing
-
Ini
Creates a newConfigurationParser
which reads ini, or property files. -
Ini
Creates a newConfigurationParser
which reads ini, or property files.- Parameters:
propertyParser
- a custom property parser
-
Xml
Creates a newConfigurationParser
which reads xml files. -
Xml
Creates a newConfigurationParser
which reads xml files.- Parameters:
propertyParser
- a custom property parser
-