Class ConfigurationAttributePointer<T>
java.lang.Object
org.apache.commons.jxpath.ri.model.NodePointer
org.apache.commons.configuration2.tree.xpath.ConfigurationAttributePointer<T>
- Type Parameters:
T- the type of the nodes this pointer deals with
- All Implemented Interfaces:
Serializable,Cloneable,Comparable,org.apache.commons.jxpath.Pointer
final class ConfigurationAttributePointer<T>
extends org.apache.commons.jxpath.ri.model.NodePointer
A specialized NodePointer implementation for the attributes of a configuration node.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final QueryResult<T> Stores information about the represented attribute.private static final longThe serial version UID.Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer
index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationAttributePointer(ConfigurationNodePointer<T> parent, String attrName) Creates a new instance ofConfigurationAttributePointer. -
Method Summary
Modifier and TypeMethodDescriptionintcompareChildNodePointers(org.apache.commons.jxpath.ri.model.NodePointer p1, org.apache.commons.jxpath.ri.model.NodePointer p2) Compares two child node pointers.Gets the base value.Gets the immediate node.intGets the length of the represented node.org.apache.commons.jxpath.ri.QNamegetName()Gets the name of this node.private NodeHandler<T> Returns a reference to the current node handler.Gets a reference to the parent node pointer.getValue()Returns the value of this node.booleanReturns a flag whether this node is an attribute.booleanReturns a flag whether the represented node is a collection.booleanisLeaf()Returns a flag whether the represented node is a leaf.voidSets the value of this node.booleantestNode(org.apache.commons.jxpath.ri.compiler.NodeTest test) Tests if this node matches the given test.Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
asPath, attributeIterator, childIterator, clone, compareTo, createAttribute, createChild, createChild, createPath, createPath, escape, getAbstractFactory, getDefaultNamespaceURI, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeSetByKey, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValuePointer, isActual, isContainer, isDefaultNamespace, isLanguage, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, remove, setAttribute, setIndex, setNamespaceResolver, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDThe serial version UID.- See Also:
-
attributeResult
Stores information about the represented attribute.
-
-
Constructor Details
-
ConfigurationAttributePointer
Creates a new instance ofConfigurationAttributePointer.- Parameters:
parent- the parent node pointerattrName- the name of the managed attribute
-
-
Method Details
-
compareChildNodePointers
public int compareChildNodePointers(org.apache.commons.jxpath.ri.model.NodePointer p1, org.apache.commons.jxpath.ri.model.NodePointer p2) Compares two child node pointers. Attributes do not have any children, so this is just a dummy implementation.- Specified by:
compareChildNodePointersin classorg.apache.commons.jxpath.ri.model.NodePointer- Parameters:
p1- the first pointerp2- the second pointer- Returns:
- the order of these pointers
-
getBaseValue
Gets the base value. We return the value.- Specified by:
getBaseValuein classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- the base value
-
getImmediateNode
Gets the immediate node. This is actually aQueryResultobject describing the represented attribute.- Specified by:
getImmediateNodein classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- the immediate node
-
getLength
public int getLength()Gets the length of the represented node. This is always 1.- Specified by:
getLengthin classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- the length
-
getName
public org.apache.commons.jxpath.ri.QName getName()Gets the name of this node. This is the attribute name.- Specified by:
getNamein classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- the name of this node
-
getNodeHandler
Returns a reference to the current node handler. The handler is obtained from the parent pointer.- Returns:
- the node handler
-
getParentPointer
Gets a reference to the parent node pointer.- Returns:
- the parent pointer
-
getValue
Returns the value of this node.- Specified by:
getValuein interfaceorg.apache.commons.jxpath.Pointer- Overrides:
getValuein classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- this node's value
-
isAttribute
public boolean isAttribute()Returns a flag whether this node is an attribute. Of course, this is the case.- Overrides:
isAttributein classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- the attribute flag
-
isCollection
public boolean isCollection()Returns a flag whether the represented node is a collection. This is not the case.- Specified by:
isCollectionin classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- the collection flag
-
isLeaf
public boolean isLeaf()Returns a flag whether the represented node is a leaf. This is the case for attributes.- Specified by:
isLeafin classorg.apache.commons.jxpath.ri.model.NodePointer- Returns:
- the leaf flag
-
setValue
Sets the value of this node. This is not supported because the classes of theXPathExpressionEngineare only used for queries. This implementation always throws an exception.- Specified by:
setValuein interfaceorg.apache.commons.jxpath.Pointer- Specified by:
setValuein classorg.apache.commons.jxpath.ri.model.NodePointer- Parameters:
value- the new value
-
testNode
public boolean testNode(org.apache.commons.jxpath.ri.compiler.NodeTest test) Tests if this node matches the given test. Attribute nodes are text nodes, too, because they can contain a value.- Overrides:
testNodein classorg.apache.commons.jxpath.ri.model.NodePointer- Parameters:
test- the test object- Returns:
- a flag if this node corresponds to the test
-