|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.configuration.ConfigurationKey
DefaultConfigurationKey
instead. It is associated with a DefaultExpressionEngine
and thus
can produce correct keys even if key separators have been changed.
@Deprecated public class ConfigurationKey
A simple class that supports creation of and iteration on complex configuration keys.
For key creation the class works similar to a StringBuilder: There are
several appendXXXX()
methods with which single parts
of a key can be constructed. All these methods return a reference to the
actual object so they can be written in a chain. When using this methods
the exact syntax for keys need not be known.
This class also defines a specialized iterator for configuration keys. With such an iterator a key can be tokenized into its single parts. For each part it can be checked whether it has an associated index.
Nested Class Summary | |
---|---|
class |
ConfigurationKey.KeyIterator
Deprecated. A specialized iterator class for tokenizing a configuration key. |
Field Summary | |
---|---|
static java.lang.String |
ESCAPED_DELIMITER
Deprecated. Constant for an escaped delimiter. |
static char |
PROPERTY_DELIMITER
Deprecated. Constant for a property delimiter. |
Constructor Summary | |
---|---|
ConfigurationKey()
Deprecated. Creates a new, empty instance of ConfigurationKey . |
|
ConfigurationKey(java.lang.String key)
Deprecated. Creates a new instance of ConfigurationKey and
initializes it with the given key. |
Method Summary | |
---|---|
ConfigurationKey |
append(java.lang.String property)
Deprecated. Appends the name of a property to this key. |
ConfigurationKey |
appendAttribute(java.lang.String attr)
Deprecated. Appends an attribute to this configuration key. |
ConfigurationKey |
appendIndex(int index)
Deprecated. Appends an index to this configuration key. |
static java.lang.String |
attributeName(java.lang.String key)
Deprecated. Extracts the name of the attribute from the given attribute key. |
ConfigurationKey |
commonKey(ConfigurationKey other)
Deprecated. Returns a configuration key object that is initialized with the part of the key that is common to this key and the passed in key. |
static java.lang.String |
constructAttributeKey(java.lang.String key)
Deprecated. Decorates the given key so that it represents an attribute. |
ConfigurationKey |
differenceKey(ConfigurationKey other)
Deprecated. Returns the "difference key" to a given key. |
boolean |
equals(java.lang.Object c)
Deprecated. Checks if two ConfigurationKey objects are equal. |
int |
hashCode()
Deprecated. Returns the hash code for this object. |
boolean |
isAttributeKey()
Deprecated. Checks if this key is an attribute key. |
static boolean |
isAttributeKey(java.lang.String key)
Deprecated. Checks if the passed in key is an attribute key. |
ConfigurationKey.KeyIterator |
iterator()
Deprecated. Returns an iterator for iterating over the single components of this configuration key. |
int |
length()
Deprecated. Returns the actual length of this configuration key. |
void |
setLength(int len)
Deprecated. Sets the new length of this configuration key. |
java.lang.String |
toString()
Deprecated. Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char PROPERTY_DELIMITER
public static final java.lang.String ESCAPED_DELIMITER
Constructor Detail |
---|
public ConfigurationKey()
ConfigurationKey
.
public ConfigurationKey(java.lang.String key)
ConfigurationKey
and
initializes it with the given key.
key
- the key as a stringMethod Detail |
---|
public ConfigurationKey append(java.lang.String property)
property
- the name of the property to be added
public ConfigurationKey appendIndex(int index)
index
- the index to be appended
public ConfigurationKey appendAttribute(java.lang.String attr)
attr
- the name of the attribute to be appended
public boolean isAttributeKey()
public static boolean isAttributeKey(java.lang.String key)
key
- the key (part) to be checked
public static java.lang.String constructAttributeKey(java.lang.String key)
key
- the key to be decorated
public static java.lang.String attributeName(java.lang.String key)
key
- the attribute key
public java.lang.String toString()
toString
in class java.lang.Object
public ConfigurationKey.KeyIterator iterator()
public int length()
public void setLength(int len)
append()
methods. The semantic is the same as
the setLength()
method of StringBuilder
.
len
- the new length of the keypublic boolean equals(java.lang.Object c)
ConfigurationKey
objects are equal. The
method can be called with strings or other objects, too.
equals
in class java.lang.Object
c
- the object to compare
public int hashCode()
hashCode
in class java.lang.Object
public ConfigurationKey commonKey(ConfigurationKey other)
other
- the other key
public ConfigurationKey differenceKey(ConfigurationKey other)
other = key.commonKey(other) + key.differenceKey(other)
for an arbitrary configuration key key
.
other
- the key for which the difference is to be calculated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |