类 ConfigurationMetadataRepositoryJsonBuilder
- java.lang.Object
- org.springframework.boot.configurationmetadata.ConfigurationMetadataRepositoryJsonBuilder
public final class ConfigurationMetadataRepositoryJsonBuilder extends Object
Load aConfigurationMetadataRepository
from the content of arbitrary resource(s).- 从以下版本开始:
- 1.3.0
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 ConfigurationMetadataRepository
build()
Build aConfigurationMetadataRepository
with the current state of this builder.static ConfigurationMetadataRepositoryJsonBuilder
create()
Create a new builder instance usingUTF_8
as the default charset.static ConfigurationMetadataRepositoryJsonBuilder
create(InputStream... inputStreams)
Create a new builder instance usingUTF_8
as the default charset and the specified json resource.static ConfigurationMetadataRepositoryJsonBuilder
create(Charset defaultCharset)
Create a new builder instance using the specified defaultCharset
.ConfigurationMetadataRepositoryJsonBuilder
withJsonResource(InputStream inputStream)
Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the default charset.ConfigurationMetadataRepositoryJsonBuilder
withJsonResource(InputStream inputStream, Charset charset)
Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the specifiedCharset
.
方法详细资料
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.
- 参数:
inputStream
- the source input stream- 返回:
- this builder
- 抛出:
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.
- 参数:
inputStream
- the source input streamcharset
- the charset of the input- 返回:
- this builder
- 抛出:
IOException
- in case of I/O errors
build
public ConfigurationMetadataRepository build()
Build aConfigurationMetadataRepository
with the current state of this builder.- 返回:
- this builder
create
public static ConfigurationMetadataRepositoryJsonBuilder create(InputStream... inputStreams) throws IOException
Create a new builder instance usingUTF_8
as the default charset and the specified json resource.- 参数:
inputStreams
- the source input streams- 返回:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance. - 抛出:
IOException
- on error
create
public static ConfigurationMetadataRepositoryJsonBuilder create()
Create a new builder instance usingUTF_8
as the default charset.- 返回:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance.
create
public static ConfigurationMetadataRepositoryJsonBuilder create(Charset defaultCharset)
Create a new builder instance using the specified defaultCharset
.- 参数:
defaultCharset
- the default charset to use- 返回:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance.