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