com.hazelcast.client.config

## Class XmlClientConfigBuilder

- java.lang.Object
- - com.hazelcast.config.AbstractXmlConfigHelper
  - - com.hazelcast.config.AbstractXmlConfigBuilder
    - - com.hazelcast.client.config.XmlClientConfigBuilder

-     public class XmlClientConfigBuilder
      extends AbstractXmlConfigBuilder

  Loads the `ClientConfig` using XML.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.hazelcast.config.AbstractXmlConfigBuilder

      `AbstractXmlConfigBuilder.ConfigType`

  - ### Field Summary

    - ### Fields inherited from class com.hazelcast.config.AbstractXmlConfigHelper

      `domLevel3`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlClientConfigBuilder()` Loads the client config using the following resolution mechanism: first it checks if a system property 'hazelcast.client.config' is set.
    `XmlClientConfigBuilder(File file)`
    `XmlClientConfigBuilder(InputStream in)`
    `XmlClientConfigBuilder(String resource)`
    `XmlClientConfigBuilder(URL url)`
    `XmlClientConfigBuilder(XmlClientConfigLocator locator)` Constructs a `XmlClientConfigBuilder` that loads the configuration with the provided `XmlClientConfigLocator`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientConfig` | `build()`
    `ClientConfig` | `build(ClassLoader classLoader)`
    `protected AbstractXmlConfigBuilder.ConfigType` | `getConfigType()`
    `protected Document` | `parse(InputStream inputStream)` Reads XML from InputStream and parses.
    `XmlClientConfigBuilder` | `setProperties(Properties properties)`

    - ### Methods inherited from class com.hazelcast.config.AbstractXmlConfigBuilder

      `getProperties, process, setPropertiesInternal`

    - ### Methods inherited from class com.hazelcast.config.AbstractXmlConfigHelper

      `appendToken, getNamespaceType, getReleaseVersion, loadSchemaFile, schemaValidation, xmlToJavaName`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XmlClientConfigBuilder

          public XmlClientConfigBuilder(String resource)
                                 throws IOException

      Throws:
        `IOException`

    - #### XmlClientConfigBuilder

          public XmlClientConfigBuilder(File file)
                                 throws IOException

      Throws:
        `IOException`

    - #### XmlClientConfigBuilder

          public XmlClientConfigBuilder(URL url)
                                 throws IOException

      Throws:
        `IOException`

    - #### XmlClientConfigBuilder

          public XmlClientConfigBuilder(InputStream in)

    - #### XmlClientConfigBuilder

          public XmlClientConfigBuilder()

      Loads the client config using the following resolution mechanism:
      1. first it checks if a system property 'hazelcast.client.config' is set. If it exist and it begins with 'classpath:', then a classpath resource is loaded. Else it will assume it is a file reference. The configuration file or resource will be loaded only if the postfix of its name ends with `.xml`.
      2. it checks if a hazelcast-client.xml is available in the working dir
      3. it checks if a hazelcast-client.xml is available on the classpath
      4. it loads the hazelcast-client-default.xml

    - #### XmlClientConfigBuilder

          public XmlClientConfigBuilder(XmlClientConfigLocator locator)

      Constructs a `XmlClientConfigBuilder` that loads the configuration with the provided `XmlClientConfigLocator`.

      If the provided `XmlClientConfigLocator` is `null`, a new instance is created and the config is located in every possible places. For these places, please see `XmlClientConfigLocator`.

      If the provided `XmlClientConfigLocator` is not `null`, it is expected that it already located the configuration XML to load from. No further attempt to locate the configuration XML is made if the configuration XML is not located already.
      Parameters:
        `locator` - the configured locator to use

  - ### Method Detail

    - #### parse

          protected Document parse(InputStream inputStream)
                            throws Exception

      Description copied from class: `AbstractXmlConfigBuilder`
      Reads XML from InputStream and parses.
      Specified by:
        `parse` in class `AbstractXmlConfigBuilder`
      Parameters:
        `inputStream` - `InputStream` to read from
      Returns:
        Document after parsing XML
      Throws:
        `Exception` - if the XML configuration cannot be parsed or is invalid

    - #### setProperties

          public XmlClientConfigBuilder setProperties(Properties properties)

    - #### getConfigType

          protected AbstractXmlConfigBuilder.ConfigType getConfigType()

      Specified by:
        `getConfigType` in class `AbstractXmlConfigBuilder`
      Returns:
        ConfigType of current config class as enum value

    - #### build

          public ClientConfig build()

    - #### build

          public ClientConfig build(ClassLoader classLoader)

Copyright © 2019. All rights reserved.