- All Superinterfaces:
Source
- All Known Implementing Classes:
ClasspathConfigSource
,EtcdConfigSource
,FileConfigSource
,GitConfigSource
,UrlConfigSource
An eager source that can read all data from the underlying origin as a stream that can be
parsed based on its media type (or using an explicit
ConfigParser
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
ParsableSource.Builder<B extends ParsableSource.Builder<B>>
A builder for a parsable source. -
Method Summary
Modifier and TypeMethodDescriptionload()
Loads the underlying source data.If media type is configured on this source, or can be guessed from the underlying origin, return it.parser()
If a parser is configured with this source, return it.default Function
<String, Optional<InputStream>> Resolve relative resource to the current resource.Methods inherited from interface io.helidon.config.spi.Source
description, exists, optional, retryPolicy
-
Method Details
-
load
Loads the underlying source data. This method is only called when the sourceSource.exists()
.The method can be invoked repeatedly, for example during retries. In case the underlying data is gone or does not exist, return an empty optional.
- Returns:
- An instance of
T
as read from the underlying origin of the data (if it exists) - Throws:
ConfigException
- in case of errors loading from the underlying origin
-
parser
Optional<ConfigParser> parser()If a parser is configured with this source, return it. The source implementation does not need to handle config parser.- Returns:
- content parser if one is configured on this source
-
mediaType
If media type is configured on this source, or can be guessed from the underlying origin, return it. The media type may be used to locate aConfigParser
if one is not explicitly configured.- Returns:
- media type if configured or detected from content
-
relativeResolver
Resolve relative resource to the current resource.- Returns:
- a function to resolve resource name into an input stream
-