Configuration implementation.
| Modifier and Type | Field and Description |
|---|---|
| protected static final Configuration[] | EMPTY_ARRAY
An empty (length zero) array of configuration objects. |
| private HashMap | |
| private ArrayList | |
| private final String | |
| private final String | |
| private final String | |
| private final String | |
| private boolean | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | DefaultConfiguration(Configuration
the config, boolean Configuration to copytrue will cause clones of the children to be added,
false will add the original instances and is thus
faster. deepCopy)Copy constructor, to create a clone of another configuration. |
| public | DefaultConfiguration(Configuration
the config)Configuration to copyShallow copy constructor, suitable for craeting a writable clone of a read-only configuration. |
| public | |
| public | DefaultConfiguration(final String
a name, final String String valuea location)String valueCreate a new |
| public | DefaultConfiguration(final String
config node name name, final String Builder-specific locator string location, final String Namespace string (typically a URI). Should not be null; use ""
if no namespace. ns, final String A short string prefixed to element names, associating
elements with a longer namespace string. Should not be null; use "" if no
namespace. prefix)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAll(final Configuration
the other, final boolean Configuration elementtrue will cause clones of the children to be added,
false will add the original instances and is thus
faster.
throws ConfigurationException If there are any problems cloning the
children. deepCopy)Add all the attributes, children and value from specified configuration element to current configuration element. |
| public void | addAll(final Configuration
the other)Configuration elementImplements org. |
| public void | addAllAttributes(final Configuration
the other)Configuration elementImplements org. |
| public void | addAllChildren(final Configuration
the other other, final boolean Configuration value
throws ConfigurationException If there are any problems cloning the
children.true will cause clones of the children to be added,
false will add the original instances and is thus
faster. deepCopy)Add all child |
| public void | addAllChildren(final Configuration
the other other)Configuration valueImplements org. Configuration objects from specified
configuration element to current configuration element.
|
| public String | Returns: aString valuea name, String String valuea value)String value
Deprecated
Use setAttribute() instead
Add an attribute to this configuration element, returning its old
value or null.
|
| public void | addChild(final Configuration
a configuration)Configuration valueImplements org. Configuration to this configuration element.
|
| public void | appendValueData(final String
a value)String value
Deprecated
Use setValue() instead
Append data to the value of this configuration element.
|
| private boolean | |
| protected final void | |
| public boolean | Returns: true if they are the same.The other configuration other)Overrides java. |
| public String | Returns: aString valuea name)String valueImplements org. String.
|
| public String[] | Returns: aString[] valueImplements org. |
| public Configuration | Returns: aConfiguration valuea name, final boolean String valuea createNew)boolean valueOverrides org. Implements org. Configuration object child of this
associated with the given name.
|
| public int | |
| public Configuration[] | Returns: The child nodes with nameImplements org. Configuration
elements containing all node children.
|
| public Configuration[] | Returns: aConfiguration[] valueThe name of the required children name)Configuration.Implements org. Configuration objects
children of this associated with the given name.
|
| public String | Returns: aString valueImplements org. |
| public MutableConfiguration | getMutableChild(final String name)
Implements org. getMutableChild( name, true )
|
| public MutableConfiguration | getMutableChild(final String
the name of the child. name, boolean set to true to create the child node if it doesn't exist. autoCreate)Implements org. |
| public MutableConfiguration[] | getMutableChildren()
Implements org. |
| public MutableConfiguration[] | getMutableChildren(final String name)
Implements org. |
| public String | Returns: aString valueImplements org. |
| public String | Returns: aString valueImplements org. |
| protected String | Returns: aString valueImplements abstract org. |
| public String | Returns: aString valuethe default value to return if value malformed or empty defaultValue)Overrides org. Implements org. String.
|
| public String | Returns: aString valueImplements org. String.
|
| public int | Returns: the hashcode.Overrides java. |
| protected final boolean | |
| public void | |
| public void | removeChild(final Configuration
a configuration)Configuration valueImplements org. Configuration to this configuration element.
|
| public void | setAttribute(final String
name of the attribute to set name, final String a value)String valueImplements org. |
| public void | setAttribute(final String
name of the attribute to set name, final int an value)int valueImplements org. |
| public void | setAttribute(final String
name of the attribute to set name, final long an value)long valueImplements org. |
| public void | setAttribute(final String
name of the attribute to set name, final boolean an value)boolean valueImplements org. |
| public void | setAttribute(final String
name of the attribute to set name, final float an value)float valueImplements org. |
| public void | setAttribute(final String
name of the attribute to set name, final double an value)double valueImplements org. |
| public void | setValue(final String
a value)String valueImplements org. Configuration object to the specified string.
|
| public void | setValue(final int
a value)int valueImplements org. Configuration object to the specified int.
|
| public void | setValue(final long
a value)long valueImplements org. Configuration object to the specified long.
|
| public void | setValue(final boolean
a value)boolean valueImplements org. Configuration object to the specified boolean.
|
| public void | setValue(final float
a value)float valueImplements org. Configuration object to the specified float.
|
| public void | setValue(final double
a value)double valueImplements org. Configuration object to the specified double.
|
| private MutableConfiguration |
| EMPTY_ARRAY | back to summary |
|---|---|
| protected static final Configuration[] EMPTY_ARRAY An empty (length zero) array of configuration objects. | |
| m_attributes | back to summary |
|---|---|
| private HashMap<K, V> m_attributes | |
| m_children | back to summary |
|---|---|
| private ArrayList<E> m_children | |
| m_location | back to summary |
|---|---|
| private final String m_location | |
| m_name | back to summary |
|---|---|
| private final String m_name | |
| m_namespace | back to summary |
|---|---|
| private final String m_namespace | |
| m_prefix | back to summary |
|---|---|
| private final String m_prefix | |
| m_readOnly | back to summary |
|---|---|
| private boolean m_readOnly | |
| m_value | back to summary |
|---|---|
| private String m_value | |
| DefaultConfiguration | back to summary |
|---|---|
| public DefaultConfiguration(Configuration config, boolean deepCopy) throws ConfigurationException Copy constructor, to create a clone of another configuration.
To modify children, use
| |
| DefaultConfiguration | back to summary |
|---|---|
| public DefaultConfiguration(Configuration config) throws ConfigurationException Shallow copy constructor, suitable for craeting a writable clone of
a read-only configuration. To modify children, use
| |
| DefaultConfiguration | back to summary |
|---|---|
| public DefaultConfiguration(final String name) Create a new
| |
| DefaultConfiguration | back to summary |
|---|---|
| public DefaultConfiguration(final String name, final String location) Create a new | |
| DefaultConfiguration | back to summary |
|---|---|
| public DefaultConfiguration(final String name, final String location, final String ns, final String prefix) Create a new
| |
| addAll | back to summary |
|---|---|
| public void addAll(final Configuration other, final boolean deepCopy) throws ConfigurationException Add all the attributes, children and value from specified configuration element to current configuration element.
| |
| addAll | back to summary |
|---|---|
| public void addAll(final Configuration other) Implements org. Add all the attributes, children and value from specified configuration element to current configuration element.
| |
| addAllAttributes | back to summary |
|---|---|
| public void addAllAttributes(final Configuration other) Implements org. Add all attributes from specified configuration element to current configuration element.
| |
| addAllChildren | back to summary |
|---|---|
| public void addAllChildren(final Configuration other, final boolean deepCopy) throws ConfigurationException Add all child
| |
| addAllChildren | back to summary |
|---|---|
| public void addAllChildren(final Configuration other) Implements org. Add all child
| |
| addAttribute | back to summary |
|---|---|
| public String addAttribute(final String name, String value)
Deprecated Use setAttribute() instead Add an attribute to this configuration element, returning its old value or null. | |
| addChild | back to summary |
|---|---|
| public void addChild(final Configuration configuration) Implements org. Add a child
| |
| appendValueData | back to summary |
|---|---|
| public void appendValueData(final String value)
Deprecated Use setValue() instead Append data to the value of this configuration element.
| |
| check | back to summary |
|---|---|
| private boolean check(Object one, Object two) | |
| checkWriteable | back to summary |
|---|---|
| protected final void checkWriteable() throws IllegalStateException heck if this configuration is writeable.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Compare if this configuration is equal to another.
| |
| getAttribute | back to summary |
|---|---|
| public String getAttribute(final String name) throws ConfigurationException Implements org. Returns the value of the attribute specified by its name as a
| |
| getAttributeNames | back to summary |
|---|---|
| public String[] getAttributeNames() Implements org. Return an array of all attribute names.
| |
| getChild | back to summary |
|---|---|
| public Configuration getChild(final String name, final boolean createNew) Overrides org. Implements org. Return the first
| |
| getChildCount | back to summary |
|---|---|
| public int getChildCount() Return count of children.
| |
| getChildren | back to summary |
|---|---|
| public Configuration[] getChildren() Implements org. Return an array of
| |
| getChildren | back to summary |
|---|---|
| public Configuration[] getChildren(final String name) Implements org. Return an array of
| |
| getLocation | back to summary |
|---|---|
| public String getLocation() Implements org. Returns a description of location of element.
| |
| getMutableChild | back to summary |
|---|---|
| public MutableConfiguration getMutableChild(final String name) throws ConfigurationException Implements org. Doc from org. Equivalent to | |
| getMutableChild | back to summary |
|---|---|
| public MutableConfiguration getMutableChild(final String name, boolean autoCreate) throws ConfigurationException Implements org. Doc from org. Gets a child node of this configuration. If a mutable child with the
given name exists, it is returned. If an immutable child with the
given name exists, it is converted into a mutable child and returned.
In this case, the immutable child will be replaced with the mutable
child in this configuration (that is, it will be as if the child
node always had been mutable).
If no child with the given name exists, and
| |
| getMutableChildren | back to summary |
|---|---|
| public MutableConfiguration[] getMutableChildren() throws ConfigurationException Implements org. Doc from org. Returns an array of mutable children. Immutable children
are converted just as for
| |
| getMutableChildren | back to summary |
|---|---|
| public MutableConfiguration[] getMutableChildren(final String name) throws ConfigurationException Implements org. Doc from org. Returns an array of mutable children with the given name. Immutable children
are converted just as for
| |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Returns the name of this configuration element.
| |
| getNamespace | back to summary |
|---|---|
| public String getNamespace() throws ConfigurationException Implements org. Returns the namespace of this configuration element
| |
| getPrefix | back to summary |
|---|---|
| protected String getPrefix() throws ConfigurationException Implements abstract org. Returns the prefix of the namespace
| |
| getValue | back to summary |
|---|---|
| public String getValue(final String defaultValue) Overrides org. Implements org. Returns the value of the configuration element as a | |
| getValue | back to summary |
|---|---|
| public String getValue() throws ConfigurationException Implements org. Returns the value of the configuration element as a
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Obtaine the hashcode for this configuration.
| |
| isReadOnly | back to summary |
|---|---|
| protected final boolean isReadOnly() Returns true iff this DefaultConfiguration has been made read-only. | |
| makeReadOnly | back to summary |
|---|---|
| public void makeReadOnly() Make this configuration read-only. | |
| removeChild | back to summary |
|---|---|
| public void removeChild(final Configuration configuration) Implements org. Remove a child
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final String value) Implements org. Set the value of the specified attribute to the specified string. | |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final int value) Implements org. Set the value of the specified attribute to the specified int.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final long value) Implements org. Set the value of the specified attribute to the specified long.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final boolean value) Implements org. Set the value of the specified attribute to the specified boolean.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final float value) Implements org. Set the value of the specified attribute to the specified float.
| |
| setAttribute | back to summary |
|---|---|
| public void setAttribute(final String name, final double value) Implements org. Set the value of the specified attribute to the specified double.
| |
| setValue | back to summary |
|---|---|
| public void setValue(final String value) Implements org. Set the value of this
| |
| setValue | back to summary |
|---|---|
| public void setValue(final int value) Implements org. Set the value of this
| |
| setValue | back to summary |
|---|---|
| public void setValue(final long value) Implements org. Set the value of this
| |
| setValue | back to summary |
|---|---|
| public void setValue(final boolean value) Implements org. Set the value of this
| |
| setValue | back to summary |
|---|---|
| public void setValue(final float value) Implements org. Set the value of this
| |
| setValue | back to summary |
|---|---|
| public void setValue(final double value) Implements org. Set the value of this
| |
| toMutable | back to summary |
|---|---|
| private MutableConfiguration toMutable(Configuration child) throws ConfigurationException Convenience function to convert a child to a mutable configuration. If the child is-a MutableConfiguration, and it isn't a read-only DefaultConfiguration (which isn't really mutable), the child is cast to MutableConfiguration and returned. If not, the child is replaced in the m_children array with a new writable DefaultConfiguration that is a shallow copy of the child, and the new child is returned. | |