Package io.helidon.config.spi
Interface ConfigParser
-
public interface ConfigParser
Transforms configConfigParser.Content
into aConfigNode.ObjectNode
that represents the original structure and values from the content.The application can register parsers on a
Builder
using theConfig.Builder.addParser(ConfigParser)
method. The config system also locates parsers using the JavaServiceLoader
mechanism and automatically adds them to everyBuilder
unless the application disables this feature for a givenBuilder
by invokingConfig.Builder.disableParserServices()
.A parser can specify a
Priority
. If no priority is explicitly assigned, the value of 100 is assumed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ConfigParser.Content<S>
-
Field Summary
Fields Modifier and Type Field Description static int
PRIORITY
Default priority of the parser if registered byConfig.Builder
automatically.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <S> ConfigNode.ObjectNode
parse(ConfigParser.Content<S> content)
Parses a specifiedConfigParser.Content
into ahierarchical configuration representation
.Set<String>
supportedMediaTypes()
Returns set of supported media types by the parser.
-
-
-
Field Detail
-
PRIORITY
static final int PRIORITY
Default priority of the parser if registered byConfig.Builder
automatically.- See Also:
- Constant Field Values
-
-
Method Detail
-
supportedMediaTypes
Set<String> supportedMediaTypes()
Returns set of supported media types by the parser.Set of supported media types is used while
looking for appropriate parser
byConfigSource
implementations.ConfigSource
implementations usually useFiles.probeContentType(Path)
method to guess source media type, if not explicitly set.- Returns:
- supported media types by the parser
-
parse
<S> ConfigNode.ObjectNode parse(ConfigParser.Content<S> content) throws ConfigParserException
Parses a specifiedConfigParser.Content
into ahierarchical configuration representation
.Never returns
null
.- Type Parameters:
S
- a type of data stamp- Parameters:
content
- a content to be parsed- Returns:
- parsed hierarchical configuration representation
- Throws:
ConfigParserException
- in case of problem to parse configuration from the source
-
-