public class YamlConfigBuilder extends AbstractYamlConfigBuilder implements ConfigBuilder
ConfigBuilder
implementation.
This config builder is compatible with the YAML 1.2 specification and
supports the JSON Schema.Constructor and Description |
---|
YamlConfigBuilder()
Constructs a YamlConfigBuilder that tries to find a usable YAML configuration file.
|
YamlConfigBuilder(InputStream inputStream)
Constructs a YAMLConfigBuilder that reads from the given InputStream.
|
YamlConfigBuilder(String yamlFileName)
Constructs a YamlConfigBuilder that reads from the provided YAML file.
|
YamlConfigBuilder(URL url)
Constructs a YamlConfigBuilder that reads from the given URL.
|
YamlConfigBuilder(YamlConfigLocator locator)
Constructs a
YamlConfigBuilder that loads the configuration
with the provided YamlConfigLocator . |
Modifier and Type | Method and Description |
---|---|
Config |
build()
Builds Config object.
|
protected String |
getConfigRoot() |
YamlConfigBuilder |
setProperties(Properties properties) |
getProperties, importDocuments, replaceVariables, setPropertiesInternal
public YamlConfigBuilder(String yamlFileName) throws FileNotFoundException
yamlFileName
- the name of the YAML file that the YamlConfigBuilder reads fromFileNotFoundException
- if the file can't be foundpublic YamlConfigBuilder(InputStream inputStream)
inputStream
- the InputStream containing the YAML configurationIllegalArgumentException
- if inputStream is null
public YamlConfigBuilder(URL url) throws IOException
url
- the given url that the YamlConfigBuilder reads fromIOException
- if URL is invalidpublic YamlConfigBuilder()
public YamlConfigBuilder(YamlConfigLocator locator)
YamlConfigBuilder
that loads the configuration
with the provided YamlConfigLocator
.
If the provided YamlConfigLocator
is null
, a new
instance is created and the config is located in every possible
places. For these places, please see YamlConfigLocator
.
If the provided YamlConfigLocator
is not null
, it
is expected that it already located the configuration YAML to load
from. No further attempt to locate the configuration YAML is made
if the configuration YAML is not located already.locator
- the configured locator to usepublic Config build()
ConfigBuilder
build
in interface ConfigBuilder
public YamlConfigBuilder setProperties(Properties properties)
protected String getConfigRoot()
getConfigRoot
in class AbstractYamlConfigBuilder
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.