public class XmlMultiConfiguration
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
XmlMultiConfiguration.Builder
An
XmlMultiConfiguration builder. |
static interface |
XmlMultiConfiguration.Variant
A variant configuration builder.
|
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Document |
asDocument()
Return this configuration as an XML
Document . |
java.lang.String |
asRenderedDocument()
Return this configuration as a rendered XML string.
|
Configuration |
configuration(java.lang.String identity)
Retrieve the singular configuration for
identity . |
Configuration |
configuration(java.lang.String identity,
java.lang.String variant)
Retrieve the singular configuration for
identity and variant . |
static XmlMultiConfiguration.Builder |
from(java.net.URL xml)
Create a builder seeded from an XML configuration.
|
static XmlMultiConfiguration.Builder |
from(java.net.URL xml,
java.lang.ClassLoader classLoader)
Create a builder seeded from an XML configuration using the supplier class loader.
|
static XmlMultiConfiguration.Builder |
from(XmlMultiConfiguration config)
Create a builder seeded from an existing
XmlMultiConfiguration . |
static XmlMultiConfiguration.Builder |
fromNothing()
Create an initially empty builder.
|
java.util.Set<java.lang.String> |
identities()
Return the set of identities defined in this multi-configuration.
|
java.lang.String |
toString() |
java.util.Set<java.lang.String> |
variants(java.lang.String identity)
Return the set of variants defined for the given configuration.
|
public Configuration configuration(java.lang.String identity) throws java.lang.IllegalArgumentException
identity
.
If the given identity is associated with multiple variant configurations then an IllegalStateException
will
be thrown. In this case the configuration(String, String)
method must be used to select a specific
variant.
identity
- identity to retrievenull
if the identity is not in this configurationjava.lang.IllegalArgumentException
- if the identity is associated with multiple variant configurationspublic Configuration configuration(java.lang.String identity, java.lang.String variant)
identity
and variant
.
If the given identity is associated only with a singular configuration then that configuration will be returned for all variants.
identity
- identity to retrievevariant
- variant to retrievenull
if the identity is not in this configurationjava.lang.IllegalArgumentException
- if the given variant does not existpublic java.util.Set<java.lang.String> variants(java.lang.String identity) throws java.lang.IllegalArgumentException
If the given identity does not exist then an IllegalArgumentException
is thrown. If the given identity is
not variant-ed then an empty set is returned.
java.lang.IllegalArgumentException
- if the identity does not existpublic java.util.Set<java.lang.String> identities()
public org.w3c.dom.Document asDocument()
Document
.public java.lang.String asRenderedDocument()
public java.lang.String toString()
toString
in class java.lang.Object
public static XmlMultiConfiguration.Builder from(java.net.URL xml)
Enclosed configurations will parsed using XmlConfiguration.XmlConfiguration(Document)
.
xml
- xml seed resourceXmlConfiguration.XmlConfiguration(Document)
public static XmlMultiConfiguration.Builder from(java.net.URL xml, java.lang.ClassLoader classLoader)
Enclosed configurations will parsed using XmlConfiguration.XmlConfiguration(Document, ClassLoader)
, which
will be passed the classloader provided to this method.
xml
- xml seed resourceclassLoader
- loader for the cache managersXmlConfiguration.XmlConfiguration(Document, ClassLoader)
public static XmlMultiConfiguration.Builder from(XmlMultiConfiguration config)
XmlMultiConfiguration
.config
- existing configuration seedpublic static XmlMultiConfiguration.Builder fromNothing()