Class YamlConfigBuilder

All Implemented Interfaces:
ConfigBuilder

public class YamlConfigBuilder extends AbstractYamlConfigBuilder implements 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 Details

    • YamlConfigBuilder

      public YamlConfigBuilder(String yamlFileName) throws FileNotFoundException
      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

      public YamlConfigBuilder(InputStream inputStream)
      Constructs a YAMLConfigBuilder that reads from the given InputStream.
      Parameters:
      inputStream - the InputStream containing the YAML configuration
      Throws:
      IllegalArgumentException - if inputStream is null
    • YamlConfigBuilder

      public YamlConfigBuilder(URL url) throws IOException
      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

      @PrivateApi public YamlConfigBuilder(com.hazelcast.internal.config.YamlConfigLocator locator)
      Constructs a 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.

      Parameters:
      locator - the configured locator to use
  • Method Details