-
- 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 Default Methods Deprecated Methods Modifier and Type Method Description ConfigNode.ObjectNodeparse(ConfigParser.Content content)Deprecated.default ConfigNode.ObjectNodeparse(ConfigParser.Content content, Function<String,Optional<InputStream>> relativeResolver)Parses a specifiedConfigContentinto ahierarchical configuration representation.Set<String>supportedMediaTypes()Returns set of supported media types by the parser.default List<String>supportedSuffixes()Config parser can define supported file suffixes.
-
-
-
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
@Deprecated ConfigNode.ObjectNode parse(ConfigParser.Content content) throws ConfigParserException
Deprecated.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
-
parse
default ConfigNode.ObjectNode parse(ConfigParser.Content content, Function<String,Optional<InputStream>> relativeResolver)
Parses a specifiedConfigContentinto ahierarchical configuration representation.Never returns
null.- Parameters:
content- a content to be parsedrelativeResolver- function to resolve relative resources to this resource (if supported by the source)- Returns:
- parsed hierarchical configuration representation
- Throws:
ConfigParserException- in case of problem to parse configuration from the source
-
supportedSuffixes
default List<String> supportedSuffixes()
Config parser can define supported file suffixes. If such are defined, Helidon will use these to discover default configuration sources. For example if there is aConfigParserthat returnsxml, config would look formeta-config.xmlto discover meta configuration, and forapplication.xmlon file system and on classpath to discover configuration files.Note that the suffixes must resolve into a media type supported by a config parser (see
MediaTypes.detectExtensionType(String)).- Returns:
- a set of file suffixes supported by this config parser.
-
-