public class XmlConfigBuilder extends AbstractXmlConfigBuilder implements ConfigBuilder
ConfigBuilder
implementation.
Unlike Config.load()
and its variants, a configuration constructed via
XmlConfigBuilder
does not apply overrides found in environment variables/system properties.
AbstractXmlConfigBuilder.ConfigType
domLevel3
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.
|
XmlConfigBuilder(com.hazelcast.internal.config.XmlConfigLocator locator)
Constructs a
XmlConfigBuilder that loads the configuration
with the provided XmlConfigLocator . |
Modifier and Type | Method and Description |
---|---|
Config |
build()
Builds Config object.
|
protected AbstractXmlConfigBuilder.ConfigType |
getConfigType() |
protected Document |
parse(InputStream is)
Reads XML from InputStream and parses.
|
XmlConfigBuilder |
setProperties(Properties properties)
Sets the used properties.
|
getProperties, process, setPropertiesInternal
appendToken, getNamespaceType, getReleaseVersion, loadSchemaFile, schemaValidation, xmlToJavaName
shouldValidateTheSchema
public XmlConfigBuilder(String xmlFileName) throws FileNotFoundException
xmlFileName
- the name of the XML file that the XmlConfigBuilder reads fromFileNotFoundException
- if the file can't be foundpublic XmlConfigBuilder(InputStream inputStream)
inputStream
- the InputStream containing the XML configurationIllegalArgumentException
- if inputStream is null
public XmlConfigBuilder(URL url) throws IOException
url
- the given url that the XMLConfigBuilder reads fromIOException
- if URL is invalidpublic XmlConfigBuilder()
@PrivateApi public XmlConfigBuilder(com.hazelcast.internal.config.XmlConfigLocator locator)
XmlConfigBuilder
that loads the configuration
with the provided XmlConfigLocator
.
If the provided XmlConfigLocator
is null
, a new
instance is created and the config is located in every possible
places. For these places, please see XmlConfigLocator
.
If the provided XmlConfigLocator
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.
locator
- the configured locator to usepublic XmlConfigBuilder setProperties(Properties properties)
Properties are used to resolve ${variable} occurrences in the XML file.
properties
- the new propertiesprotected AbstractXmlConfigBuilder.ConfigType getConfigType()
getConfigType
in class AbstractXmlConfigBuilder
public Config build()
ConfigBuilder
build
in interface ConfigBuilder
protected Document parse(InputStream is) throws Exception
AbstractXmlConfigBuilder
parse
in class AbstractXmlConfigBuilder
is
- InputStream
to read fromException
- if the XML configuration cannot be parsed or is invalidCopyright © 2023 Hazelcast, Inc.. All rights reserved.