Class ConfigurationMetadataRepositoryJsonBuilder
java.lang.Object
org.springframework.boot.configurationmetadata.ConfigurationMetadataRepositoryJsonBuilder
Load a
ConfigurationMetadataRepository
from the content of arbitrary
resource(s).- Since:
- 1.3.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build aConfigurationMetadataRepository
with the current state of this builder.create()
Create a new builder instance usingStandardCharsets.UTF_8
as the default charset.create
(InputStream... inputStreams) Create a new builder instance usingStandardCharsets.UTF_8
as the default charset and the specified json resource.Create a new builder instance using the specified defaultCharset
.withJsonResource
(InputStream inputStream) Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the default charset.withJsonResource
(InputStream inputStream, Charset charset) Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the specifiedCharset
.
-
Method Details
-
withJsonResource
public ConfigurationMetadataRepositoryJsonBuilder withJsonResource(InputStream inputStream) throws IOException Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the default charset. If this metadata repository holds items that were loaded previously, these are ignored.Leaves the stream open when done.
- Parameters:
inputStream
- the source input stream- Returns:
- this builder
- Throws:
IOException
- in case of I/O errors
-
withJsonResource
public ConfigurationMetadataRepositoryJsonBuilder withJsonResource(InputStream inputStream, Charset charset) throws IOException Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the specifiedCharset
. If this metadata repository holds items that were loaded previously, these are ignored.Leaves the stream open when done.
- Parameters:
inputStream
- the source input streamcharset
- the charset of the input- Returns:
- this builder
- Throws:
IOException
- in case of I/O errors
-
build
Build aConfigurationMetadataRepository
with the current state of this builder.- Returns:
- this builder
-
create
public static ConfigurationMetadataRepositoryJsonBuilder create(InputStream... inputStreams) throws IOException Create a new builder instance usingStandardCharsets.UTF_8
as the default charset and the specified json resource.- Parameters:
inputStreams
- the source input streams- Returns:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance. - Throws:
IOException
- on error
-
create
Create a new builder instance usingStandardCharsets.UTF_8
as the default charset.- Returns:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance.
-
create
Create a new builder instance using the specified defaultCharset
.- Parameters:
defaultCharset
- the default charset to use- Returns:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance.
-