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
ConstructorsConstructorDescriptionConstructs a YamlConfigBuilder that tries to find a usable YAML configuration file.YamlConfigBuilder(com.hazelcast.internal.config.YamlConfigLocator locator) Constructs aYamlConfigBuilderthat 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 StringsetProperties(Properties properties) Methods inherited from class com.hazelcast.config.AbstractYamlConfigBuilder
getProperties, importDocuments, replaceVariables, setPropertiesInternalMethods 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 aYamlConfigBuilderthat loads the configuration with the providedYamlConfigLocator.If the provided
YamlConfigLocatorisnull, a new instance is created and the config is located in every possible places. For these places, please seeYamlConfigLocator.If the provided
YamlConfigLocatoris 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:ConfigBuilderBuilds Config object.- Specified by:
buildin interfaceConfigBuilder- Returns:
- Built Config object
-
setProperties
-
getConfigRoot
- Specified by:
getConfigRootin classAbstractYamlConfigBuilder
-