com.hazelcast.config

## Class XmlConfigBuilder

- java.lang.Object
- - com.hazelcast.config.AbstractXmlConfigHelper
  - - com.hazelcast.config.AbstractConfigBuilder
    - - com.hazelcast.config.XmlConfigBuilder

- All Implemented Interfaces:
    ConfigBuilder

      public class XmlConfigBuilder
      extends AbstractConfigBuilder
      implements ConfigBuilder

  A XML `ConfigBuilder` implementation.

- - ### Nested Class Summary

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

      `AbstractConfigBuilder.ConfigType`

  - ### Field Summary

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

      `domLevel3`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlConfigBuilder()` Constructs a XmlConfigBuilder that tries to find a usable XML configuration file.
    `XmlConfigBuilder(InputStream inputStream)` Constructs a XmlConfigBuilder that reads from the given InputStream.
    `XmlConfigBuilder(String xmlFileName)` Constructs a XmlConfigBuilder that reads from the provided XML file.
    `XmlConfigBuilder(URL url)` Constructs a XMLConfigBuilder that reads from the given URL.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Config` | `build()` Builds Config object.
    `Properties` | `getProperties()` Gets the current used properties.
    `protected AbstractConfigBuilder.ConfigType` | `getXmlType()`
    `protected Document` | `parse(InputStream is)` Reads XML from InputStream and parses.
    `XmlConfigBuilder` | `setProperties(Properties properties)` Sets the used properties.

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

      `process`

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

      `appendToken, asElementIterable, childElements, cleanNodeName, fillDataSerializableFactories, fillNativeMemoryConfig, fillPortableFactories, fillProperties, fillProperties, fillSerializers, getAttribute, getBooleanValue, getDoubleValue, getDoubleValue, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getNamespaceType, getReleaseVersion, getTextContent, hasTextContent, loadSchemaFile, parseSerialization, parseSocketInterceptorConfig, schemaValidation, xmlToJavaName`

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

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

- - ### Constructor Detail

    - #### XmlConfigBuilder

          public XmlConfigBuilder(String xmlFileName)
                           throws FileNotFoundException

      Constructs a XmlConfigBuilder that reads from the provided XML file.
      Parameters:
        `xmlFileName` - the name of the XML file that the XmlConfigBuilder reads from
      Throws:
        `FileNotFoundException` - if the file can't be found

    - #### XmlConfigBuilder

          public XmlConfigBuilder(InputStream inputStream)

      Constructs a XmlConfigBuilder that reads from the given InputStream.
      Parameters:
        `inputStream` - the InputStream containing the XML configuration
      Throws:
        `IllegalArgumentException` - if inputStream is `null`

    - #### XmlConfigBuilder

          public XmlConfigBuilder(URL url)
                           throws IOException

      Constructs a XMLConfigBuilder that reads from the given URL.
      Parameters:
        `url` - the given url that the XMLConfigBuilder reads from
      Throws:
        `IOException` - if URL is invalid

    - #### XmlConfigBuilder

          public XmlConfigBuilder()

      Constructs a XmlConfigBuilder that tries to find a usable XML configuration file.

  - ### Method Detail

    - #### getProperties

          public Properties getProperties()

      Gets the current used properties. Can be null if no properties are set.
      Specified by:
        `getProperties` in class `AbstractConfigBuilder`
      Returns:
        the current used properties
      See Also:
        `setProperties(java.util.Properties)`

    - #### setProperties

          public XmlConfigBuilder setProperties(Properties properties)

      Sets the used properties. Can be null if no properties should be used.

      Properties are used to resolve ${variable} occurrences in the XML file.

      Parameters:
        `properties` - the new properties
      Returns:
        the XmlConfigBuilder

    - #### getXmlType

          protected AbstractConfigBuilder.ConfigType getXmlType()

      Specified by:
        `getXmlType` in class `AbstractConfigBuilder`
      Returns:
        ConfigType of current config class as enum value

    - #### build

          public Config build()

      Description copied from interface: `ConfigBuilder`
      Builds Config object.
      Specified by:
        `build` in interface `ConfigBuilder`
      Returns:
        Built Config object

    - #### parse

          protected Document parse(InputStream is)
                            throws Exception

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

Copyright © 2018. All rights reserved.