|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.avalon.framework.configuration.AbstractConfiguration
org.apache.avalon.framework.configuration.DefaultConfiguration
This is the default Configuration implementation.
| Field Summary | |
protected static Configuration[] |
EMPTY_ARRAYAn empty (length zero) array of configuration objects. |
private java.util.HashMap |
m_attributes |
private java.util.ArrayList |
m_children |
private java.lang.String |
m_location |
private java.lang.String |
m_name |
private java.lang.String |
m_namespace |
private java.lang.String |
m_prefix |
private boolean |
m_readOnly |
private java.lang.String |
m_value |
| Constructor Summary | |
DefaultConfiguration(java.lang.String name)Create a new DefaultConfiguration instance. |
|
DefaultConfiguration(java.lang.String name, java.lang.String location)Create a new DefaultConfiguration instance. |
|
DefaultConfiguration(java.lang.String name, java.lang.String location, java.lang.String ns, java.lang.String prefix)Create a new DefaultConfiguration instance. |
|
| Method Summary | |
void |
addAll(Configuration other)Add all the attributes, children and value from specified configuration element to current configuration element. |
void |
addAllAttributes(Configuration other)Add all attributes from specified configuration element to current configuration element. |
void |
addAllChildren(Configuration other)Add all child Configuration objects from specified configuration element to current configuration element. |
java.lang.String |
addAttribute(java.lang.String name, java.lang.String value)Deprecated. Use setAttribute() instead |
void |
addChild(Configuration configuration)Add a child Configuration to this configuration element. |
void |
appendValueData(java.lang.String value)Deprecated. Use setValue() instead |
protected void |
checkWriteable()heck if this configuration is writeable. |
boolean |
equals(java.lang.Object other)Compare if this configuration is equal to another. |
java.lang.String |
getAttribute(java.lang.String name)Returns the value of the attribute specified by its name as a String. |
java.lang.String[] |
getAttributeNames()Return an array of all attribute names. |
Configuration |
getChild(java.lang.String name, boolean createNew)Return the first Configuration object child of this associated with the given name. |
int |
getChildCount()Return count of children. |
Configuration[] |
getChildren()Return an array of Configuration elements containing all node children. |
Configuration[] |
getChildren(java.lang.String name)Return an array of Configuration objects children of this associated with the given name. |
java.lang.String |
getLocation()Returns a description of location of element. |
java.lang.String |
getName()Returns the name of this configuration element. |
java.lang.String |
getNamespace()Returns the namespace of this configuration element |
protected java.lang.String |
getPrefix()Returns the prefix of the namespace |
java.lang.String |
getValue()Returns the value of the configuration element as a String. |
java.lang.String |
getValue(java.lang.String defaultValue)Returns the value of the configuration element as a String. |
int |
hashCode()Obtaine the hashcode for this configuration. |
void |
makeReadOnly()Make this configuration read-only. |
void |
removeChild(Configuration configuration)Remove a child Configuration to this configuration element. |
void |
setAttribute(java.lang.String name, java.lang.String value)Set the value of the specified attribute to the specified string. |
void |
setValue(java.lang.String value)Set the value of this Configuration object to the specified string. |
| Methods inherited from class org.apache.avalon.framework.configuration.AbstractConfiguration |
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getChild, getValueAsBoolean, getValueAsBoolean, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final Configuration[] EMPTY_ARRAY
private final java.lang.String m_name
private final java.lang.String m_location
private final java.lang.String m_namespace
private final java.lang.String m_prefix
private java.util.HashMap m_attributes
private java.util.ArrayList m_children
private java.lang.String m_value
private boolean m_readOnly
| Constructor Detail |
public DefaultConfiguration(java.lang.String name)
DefaultConfiguration instance.
name - a String value
public DefaultConfiguration(java.lang.String name,
java.lang.String location)
DefaultConfiguration instance.
name - a String valuelocation - a String value
public DefaultConfiguration(java.lang.String name,
java.lang.String location,
java.lang.String ns,
java.lang.String prefix)
DefaultConfiguration instance.
name - config node namelocation - Builder-specific locator stringns - Namespace string (typically a URI). Should not be null; use "" if no namespace.prefix - A short string prefixed to element names, associating elements with a longer namespace string. Should not be null; use "" if no namespace.| Method Detail |
public java.lang.String getName()
getName in interface ConfigurationString value
public java.lang.String getNamespace()
throws ConfigurationException
getNamespace in interface ConfigurationString valueConfigurationException - if an error occurs
protected java.lang.String getPrefix()
throws ConfigurationException
getPrefix in class AbstractConfigurationString valueConfigurationException - if prefix is not present (null).public java.lang.String getLocation()
getLocation in interface ConfigurationString valuepublic java.lang.String getValue(java.lang.String defaultValue)
String.
getValue in interface ConfigurationgetValue in class AbstractConfigurationdefaultValue - the default value to return if value malformed or emptyString value
public java.lang.String getValue()
throws ConfigurationException
String.
getValue in interface ConfigurationString valueConfigurationException - If the value is not present.public java.lang.String[] getAttributeNames()
getAttributeNames in interface ConfigurationString[] valuepublic Configuration[] getChildren()
Configuration elements containing all node children.
getChildren in interface Configuration
public java.lang.String getAttribute(java.lang.String name)
throws ConfigurationException
String.
getAttribute in interface Configurationname - a String valueString valueConfigurationException - If the attribute is not present.
public Configuration getChild(java.lang.String name,
boolean createNew)
Configuration object child of this associated with the given name.
getChild in interface ConfigurationgetChild in class AbstractConfigurationname - a String valuecreateNew - a boolean valueConfiguration valuepublic Configuration[] getChildren(java.lang.String name)
Configuration objects children of this associated with the given name.null.
getChildren in interface Configurationname - The name of the required children Configuration.Configuration[] valuepublic void appendValueData(java.lang.String value)
value - a String valuepublic void setValue(java.lang.String value)
Configuration object to the specified string.
value - a String value
public void setAttribute(java.lang.String name,
java.lang.String value)
name - name of the attribute to setvalue - a String value
public java.lang.String addAttribute(java.lang.String name,
java.lang.String value)
name - a String valuevalue - a String valueString valuepublic void addChild(Configuration configuration)
Configuration to this configuration element.
configuration - a Configuration valuepublic void addAll(Configuration other)
other - the Configuration elementpublic void addAllAttributes(Configuration other)
other - the Configuration elementpublic void addAllChildren(Configuration other)
Configuration objects from specified configuration element to current configuration element.
other - the other Configuration valuepublic void removeChild(Configuration configuration)
Configuration to this configuration element.
configuration - a Configuration valuepublic int getChildCount()
int valuepublic void makeReadOnly()
protected final void checkWriteable()
throws java.lang.IllegalStateException
java.lang.IllegalStateException - if this configuration s read-onlypublic boolean equals(java.lang.Object other)
other - The other configurationtrue if they are the same.public int hashCode()
|
Keel 2.1RC2 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||