|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.util.config.AbstractConfigurationHelper
org.compass.core.util.config.PlainConfigurationHelper
public class PlainConfigurationHelper
This is the default ConfigurationHelper implementation.
| Field Summary | |
|---|---|
protected static ConfigurationHelper[] |
EMPTY_ARRAY
An empty (length zero) array of configuration objects. |
| Constructor Summary | |
|---|---|
PlainConfigurationHelper(String name)
Create a new DefaultConfiguration instance. |
|
PlainConfigurationHelper(String name,
String location)
Create a new DefaultConfiguration instance. |
|
PlainConfigurationHelper(String name,
String location,
String ns,
String prefix)
Create a new DefaultConfiguration instance. |
|
| Method Summary | |
|---|---|
void |
addAll(ConfigurationHelper other)
Add all the attributes, children and value from specified configuration element to current configuration element. |
void |
addAllAttributes(ConfigurationHelper other)
Add all attributes from specified configuration element to current configuration element. |
void |
addAllChildren(ConfigurationHelper other)
Add all child Configuration objects from specified
configuration element to current configuration element. |
void |
addAllChildrenBefore(ConfigurationHelper other)
Add all child Configuration objects from specified
configuration element to current configuration element. |
void |
addChild(ConfigurationHelper configuration)
Add a child Configuration to this configuration element. |
protected void |
checkWriteable()
heck if this configuration is writeable. |
boolean |
equals(Object other)
Compare if this configuration is equal to another. |
String |
getAttribute(String name)
Returns the value of the attribute specified by its name as a String. |
String[] |
getAttributeNames()
Return an array of all attribute names. |
String |
getAttributeOrValue(String paramName)
First tries to get the attribute based on hte parameter, and there is none, will return the value. |
ConfigurationHelper |
getChild(String name,
boolean createNew)
Return the first Configuration object child of this
associated with the given name. |
int |
getChildCount()
Return count of children. |
ConfigurationHelper[] |
getChildren()
Return an array of Configuration elements containing all
node children. |
ConfigurationHelper[] |
getChildren(String... names)
|
ConfigurationHelper[] |
getChildren(String name)
Return an array of Configuration objects children of this
associated with the given name. |
String |
getLocation()
Returns a description of location of element. |
String |
getName()
Returns the name of this configuration element. |
String |
getNamespace()
Returns the namespace of this configuration element |
protected String |
getPrefix()
Returns the prefix of the namespace |
String |
getValue()
Returns the value of the configuration element as a String. |
String |
getValue(String defaultValue)
Returns the value of the configuration element as a String. |
int |
hashCode()
Obtaine the hashcode for this configuration. |
protected boolean |
isReadOnly()
Returns true iff this DefaultConfiguration has been made read-only. |
void |
makeReadOnly()
Make this configuration read-only. |
void |
removeChild(ConfigurationHelper configuration)
Remove a child Configuration to this configuration
element. |
void |
setAttribute(String name,
boolean value)
Set the value of the specified attribute to the specified boolean. |
void |
setAttribute(String name,
float value)
Set the value of the specified attribute to the specified float. |
void |
setAttribute(String name,
int value)
Set the value of the specified attribute to the specified int. |
void |
setAttribute(String name,
long value)
Set the value of the specified attribute to the specified long. |
void |
setAttribute(String name,
String value)
Set the value of the specified attribute to the specified string. |
void |
setValue(boolean value)
Set the value of this Configuration object to the
specified boolean. |
void |
setValue(float value)
Set the value of this Configuration object to the
specified float. |
void |
setValue(int value)
Set the value of this Configuration object to the
specified int. |
void |
setValue(long value)
Set the value of this Configuration object to the
specified long. |
void |
setValue(String value)
Set the value of this Configuration object to the
specified string. |
| Methods inherited from class org.compass.core.util.config.AbstractConfigurationHelper |
|---|
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 |
| Methods inherited from interface org.compass.core.util.config.ConfigurationHelper |
|---|
getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsInteger, getAttributeAsLong, getAttributeAsLong, getChild, getValueAsBoolean, getValueAsBoolean, getValueAsFloat, getValueAsFloat, getValueAsInteger, getValueAsInteger, getValueAsLong, getValueAsLong |
| Field Detail |
|---|
protected static final ConfigurationHelper[] EMPTY_ARRAY
| Constructor Detail |
|---|
public PlainConfigurationHelper(String name)
DefaultConfiguration instance.
public PlainConfigurationHelper(String name,
String location)
DefaultConfiguration instance.
public PlainConfigurationHelper(String name,
String location,
String ns,
String prefix)
DefaultConfiguration instance.
| Method Detail |
|---|
public String getName()
getName in interface ConfigurationHelper
public String getNamespace()
throws ConfigurationException
ConfigurationException
protected String getPrefix()
throws ConfigurationException
getPrefix in class AbstractConfigurationHelperConfigurationException - if no prefix was defined (prefix is null.public String getLocation()
getLocation in interface ConfigurationHelperpublic String getValue(String defaultValue)
String.
getValue in interface ConfigurationHelpergetValue in class AbstractConfigurationHelperpublic String getAttributeOrValue(String paramName)
ConfigurationHelper
getAttributeOrValue in interface ConfigurationHelper
public String getValue()
throws ConfigurationException
String.
getValue in interface ConfigurationHelperConfigurationExceptionpublic String[] getAttributeNames()
getAttributeNames in interface ConfigurationHelperpublic ConfigurationHelper[] getChildren()
Configuration elements containing all
node children.
getChildren in interface ConfigurationHelper
public String getAttribute(String name)
throws ConfigurationException
String.
getAttribute in interface ConfigurationHelperConfigurationException
public ConfigurationHelper getChild(String name,
boolean createNew)
Configuration object child of this
associated with the given name.
getChild in interface ConfigurationHelpergetChild in class AbstractConfigurationHelperpublic ConfigurationHelper[] getChildren(String name)
Configuration objects children of this
associated with the given name. null.
getChildren in interface ConfigurationHelperpublic ConfigurationHelper[] getChildren(String... names)
getChildren in interface ConfigurationHelperpublic void setValue(String value)
Configuration object to the
specified string.
public void setValue(int value)
Configuration object to the
specified int.
public void setValue(long value)
Configuration object to the
specified long.
public void setValue(boolean value)
Configuration object to the
specified boolean.
public void setValue(float value)
Configuration object to the
specified float.
public void setAttribute(String name,
String value)
public void setAttribute(String name,
int value)
public void setAttribute(String name,
long value)
public void setAttribute(String name,
boolean value)
public void setAttribute(String name,
float value)
public void addChild(ConfigurationHelper configuration)
Configuration to this configuration element.
public void addAll(ConfigurationHelper other)
public void addAllAttributes(ConfigurationHelper other)
public void addAllChildren(ConfigurationHelper other)
Configuration objects from specified
configuration element to current configuration element.
public void addAllChildrenBefore(ConfigurationHelper other)
Configuration objects from specified
configuration element to current configuration element.
public void removeChild(ConfigurationHelper configuration)
Configuration to this configuration
element.
public int getChildCount()
public void makeReadOnly()
makeReadOnly in interface ConfigurationHelper
protected final void checkWriteable()
throws IllegalStateException
IllegalStateExceptionprotected final boolean isReadOnly()
public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||