Package io.helidon.config.spi
Interface ConfigParser
-
public interface ConfigParserTransforms configConfigParser.Contentinto aConfigNode.ObjectNodethat represents the original structure and values from the content.The application can register parsers on a
Builderusing theConfig.Builder.addParser(ConfigParser)method. The config system also locates parsers using the JavaServiceLoadermechanism and automatically adds them to everyBuilderunless the application disables this feature for a givenBuilderby 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 interfaceConfigParser.Content<S>
-
Field Summary
Fields Modifier and Type Field Description static intPRIORITYDefault priority of the parser if registered byConfig.Builderautomatically.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <S> ConfigNode.ObjectNodeparse(ConfigParser.Content<S> content)Parses a specifiedConfigParser.Contentinto 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.Builderautomatically.- 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 parserbyConfigSourceimplementations.ConfigSourceimplementations 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.Contentinto 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
-
-