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 extends Object implements Serializable
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.
Modifier and Type | Class and Description |
---|---|
class |
ConfigurationKey.KeyIterator
Deprecated.
A specialized iterator class for tokenizing a configuration key.
|
Modifier and Type | Field and Description |
---|---|
static String |
ESCAPED_DELIMITER
Deprecated.
Constant for an escaped delimiter.
|
static char |
PROPERTY_DELIMITER
Deprecated.
Constant for a property delimiter.
|
Constructor and Description |
---|
ConfigurationKey()
Deprecated.
Creates a new, empty instance of
ConfigurationKey . |
ConfigurationKey(String key)
Deprecated.
Creates a new instance of
ConfigurationKey and
initializes it with the given key. |
Modifier and Type | Method and Description |
---|---|
ConfigurationKey |
append(String property)
Deprecated.
Appends the name of a property to this key.
|
ConfigurationKey |
appendAttribute(String attr)
Deprecated.
Appends an attribute to this configuration key.
|
ConfigurationKey |
appendIndex(int index)
Deprecated.
Appends an index to this configuration key.
|
static String |
attributeName(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 String |
constructAttributeKey(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(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(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.
|
String |
toString()
Deprecated.
Returns a string representation of this object.
|
public static final char PROPERTY_DELIMITER
public static final String ESCAPED_DELIMITER
public ConfigurationKey()
ConfigurationKey
.public ConfigurationKey(String key)
ConfigurationKey
and
initializes it with the given key.key
- the key as a stringpublic ConfigurationKey append(String property)
property
- the name of the property to be addedpublic ConfigurationKey appendIndex(int index)
index
- the index to be appendedpublic ConfigurationKey appendAttribute(String attr)
attr
- the name of the attribute to be appendedpublic boolean isAttributeKey()
public static boolean isAttributeKey(String key)
key
- the key (part) to be checkedpublic static String constructAttributeKey(String key)
key
- the key to be decoratedpublic static String attributeName(String key)
key
- the attribute keypublic String toString()
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(Object c)
ConfigurationKey
objects are equal. The
method can be called with strings or other objects, too.public int hashCode()
public ConfigurationKey commonKey(ConfigurationKey other)
other
- the other keypublic 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 calculatedCopyright © 2001–2013 The Apache Software Foundation. All rights reserved.