public interface ConfigParser
ConfigParser.Content
into a ConfigNode.ObjectNode
that
represents the original structure and values from the content.
The application can register parsers on a Builder
using the
Config.Builder.addParser(ConfigParser)
method. The
config system also locates parsers using the Java
ServiceLoader
mechanism and automatically adds them to
every Builder
unless the application disables this feature for a
given Builder
by invoking
Config.Builder.disableParserServices()
.
A parser can specify a Priority
. If no priority is
explicitly assigned, the value of 100 is assumed.
Modifier and Type | Interface | Description |
---|---|---|
static interface |
ConfigParser.Content<S> |
Modifier and Type | Field | Description |
---|---|---|
static int |
PRIORITY |
Default priority of the parser if registered by
Config.Builder automatically. |
Modifier and Type | Method | Description |
---|---|---|
java.util.Set<java.lang.String> |
getSupportedMediaTypes() |
Returns set of supported media types by the parser.
|
<S> ConfigNode.ObjectNode |
parse(ConfigParser.Content<S> content) |
Parses a specified
ConfigParser.Content into a hierarchical configuration representation . |
static final int PRIORITY
Config.Builder
automatically.java.util.Set<java.lang.String> getSupportedMediaTypes()
Set of supported media types is used while looking for appropriate parser
by ConfigSource
implementations.
ConfigSource
implementations usually use Files.probeContentType(Path)
method
to guess source media type, if not explicitly set.
<S> ConfigNode.ObjectNode parse(ConfigParser.Content<S> content) throws ConfigParserException
ConfigParser.Content
into a hierarchical configuration representation
.
Never returns null
.
S
- a type of data stampcontent
- a content to be parsedConfigParserException
- in case of problem to parse configuration from the sourceCopyright © 2018 Oracle Corporation. All rights reserved.