Package com.hazelcast.config
Class YamlConfigBuilder
java.lang.Object
com.hazelcast.config.AbstractConfigBuilder
com.hazelcast.config.AbstractYamlConfigBuilder
com.hazelcast.config.YamlConfigBuilder
- All Implemented Interfaces:
ConfigBuilder
A YAML
ConfigBuilder
implementation.
This config builder is compatible with the YAML 1.2 specification and supports the JSON Schema.
Unlike Config.load()
and its variants, a configuration constructed via
YamlConfigBuilder
does not apply overrides found in environment variables/system properties.
-
Constructor Summary
ConstructorDescriptionConstructs a YamlConfigBuilder that tries to find a usable YAML configuration file.YamlConfigBuilder
(com.hazelcast.internal.config.YamlConfigLocator locator) Constructs aYamlConfigBuilder
that loads the configuration with the providedYamlConfigLocator
.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. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds Config object.protected String
setProperties
(Properties properties) Methods inherited from class com.hazelcast.config.AbstractYamlConfigBuilder
getProperties, importDocuments, replaceVariables, setPropertiesInternal
Methods inherited from class com.hazelcast.config.AbstractConfigBuilder
shouldValidateTheSchema
-
Constructor Details
-
YamlConfigBuilder
Constructs a YamlConfigBuilder that reads from the provided YAML file.- Parameters:
yamlFileName
- the name of the YAML file that the YamlConfigBuilder reads from- Throws:
FileNotFoundException
- if the file can't be found
-
YamlConfigBuilder
Constructs a YAMLConfigBuilder that reads from the given InputStream.- Parameters:
inputStream
- the InputStream containing the YAML configuration- Throws:
IllegalArgumentException
- if inputStream isnull
-
YamlConfigBuilder
Constructs a YamlConfigBuilder that reads from the given URL.- Parameters:
url
- the given url that the YamlConfigBuilder reads from- Throws:
IOException
- if URL is invalid
-
YamlConfigBuilder
public YamlConfigBuilder()Constructs a YamlConfigBuilder that tries to find a usable YAML configuration file. -
YamlConfigBuilder
Constructs aYamlConfigBuilder
that loads the configuration with the providedYamlConfigLocator
.If the provided
YamlConfigLocator
isnull
, a new instance is created and the config is located in every possible places. For these places, please seeYamlConfigLocator
.If the provided
YamlConfigLocator
is notnull
, 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.- Parameters:
locator
- the configured locator to use
-
-
Method Details
-
build
Description copied from interface:ConfigBuilder
Builds Config object.- Specified by:
build
in interfaceConfigBuilder
- Returns:
- Built Config object
-
setProperties
-
getConfigRoot
- Specified by:
getConfigRoot
in classAbstractYamlConfigBuilder
-