-
- All Known Implementing Classes:
HoconConfigParser,PropertiesConfigParser,YamlConfigParser
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.Parser is used by the config system and a config source provides data as an input stream.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceConfigParser.ContentConfig content to be parsed by aConfigParser.
-
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 ConfigNode.ObjectNodeparse(ConfigParser.Content content)Parses a specifiedConfigContentinto 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 when config system looks for appropriate parser based on media type of content.
ParsableSourceimplementations can useMediaTypesto probe for media type of content to provide it to config system throughConfigParser.Content.Builder.mediaType(String).- Returns:
- supported media types by the parser
-
parse
ConfigNode.ObjectNode parse(ConfigParser.Content content) throws ConfigParserException
Parses a specifiedConfigContentinto ahierarchical configuration representation.Never returns
null.- Parameters:
content- a content to be parsed- Returns:
- parsed hierarchical configuration representation
- Throws:
ConfigParserException- in case of problem to parse configuration from the source
-
-