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 and Description |
|---|---|
static interface |
ConfigParser.Content<S>
|
| Modifier and Type | Field and Description |
|---|---|
static int |
PRIORITY
Default priority of the parser if registered by
Config.Builder automatically. |
| Modifier and Type | Method and Description |
|---|---|
<S> ConfigNode.ObjectNode |
parse(ConfigParser.Content<S> content)
Parses a specified
ConfigParser.Content into a hierarchical configuration representation. |
Set<String> |
supportedMediaTypes()
Returns set of supported media types by the parser.
|
static final int PRIORITY
Config.Builder automatically.Set<String> supportedMediaTypes()
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–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.