Class DynamicPointer
- java.lang.Object
-
- org.apache.commons.jxpath.ri.model.NodePointer
-
- org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
-
- org.apache.commons.jxpath.ri.model.dynamic.DynamicPointer
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
,Pointer
public class DynamicPointer extends PropertyOwnerPointer
A Pointer that points to an object with Dynamic Properties. It is used for the first element of a path; following elements will by of typePropertyPointer
.- Version:
- $Revision: 652884 $ $Date: 2008-05-02 15:02:00 -0500 (Fri, 02 May 2008) $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
bean
private DynamicPropertyHandler
handler
private QName
name
private static long
serialVersionUID
-
Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer
index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION
-
-
Constructor Summary
Constructors Constructor Description DynamicPointer(NodePointer parent, QName name, java.lang.Object bean, DynamicPropertyHandler handler)
Create a new DynamicPointer.DynamicPointer(QName name, java.lang.Object bean, DynamicPropertyHandler handler, java.util.Locale locale)
Create a new DynamicPointer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asPath()
Returns an XPath that maps to this Pointer.NodeIterator
attributeIterator(QName name)
Returns a NodeIterator that iterates over all attributes of the current node matching the supplied node name (could have a wildcard).NodeIterator
createNodeIterator(java.lang.String property, boolean reverse, NodePointer startWith)
Create a NodeIterator.boolean
equals(java.lang.Object object)
java.lang.Object
getBaseValue()
Returns the DP object iself.int
getLength()
Returns 1.QName
getName()
Returns the name of this node.PropertyPointer
getPropertyPointer()
Get a PropertyPointer for this PropertyOwnerPointer.int
hashCode()
boolean
isCollection()
Returnstrue
if the value of the pointer is an array or a Collection.boolean
isDynamicPropertyDeclarationSupported()
Learn whether dynamic property declaration is supported.boolean
isLeaf()
If true, this node does not have children-
Methods inherited from class org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
childIterator, compareChildNodePointers, getImmediateNode, isValidProperty, remove, setIndex, setValue
-
Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
clone, compareTo, createAttribute, createChild, createChild, createPath, createPath, escape, getAbstractFactory, getDefaultNamespaceURI, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeSetByKey, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValue, getValuePointer, isActual, isAttribute, isContainer, isDefaultNamespace, isLanguage, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, setAttribute, setNamespaceResolver, testNode, toString
-
-
-
-
Field Detail
-
name
private QName name
-
bean
private java.lang.Object bean
-
handler
private DynamicPropertyHandler handler
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DynamicPointer
public DynamicPointer(QName name, java.lang.Object bean, DynamicPropertyHandler handler, java.util.Locale locale)
Create a new DynamicPointer.- Parameters:
name
- property namebean
- owning beanhandler
- DynamicPropertyHandlerlocale
- Locale
-
DynamicPointer
public DynamicPointer(NodePointer parent, QName name, java.lang.Object bean, DynamicPropertyHandler handler)
Create a new DynamicPointer.- Parameters:
parent
- parent pointername
- property namebean
- owning beanhandler
- DynamicPropertyHandler
-
-
Method Detail
-
getPropertyPointer
public PropertyPointer getPropertyPointer()
Description copied from class:PropertyOwnerPointer
Get a PropertyPointer for this PropertyOwnerPointer.- Specified by:
getPropertyPointer
in classPropertyOwnerPointer
- Returns:
- PropertyPointer
-
createNodeIterator
public NodeIterator createNodeIterator(java.lang.String property, boolean reverse, NodePointer startWith)
Description copied from class:PropertyOwnerPointer
Create a NodeIterator.- Overrides:
createNodeIterator
in classPropertyOwnerPointer
- Parameters:
property
- property namereverse
- whether to iterate in reversestartWith
- first pointer to return- Returns:
- NodeIterator
-
attributeIterator
public NodeIterator attributeIterator(QName name)
Description copied from class:NodePointer
Returns a NodeIterator that iterates over all attributes of the current node matching the supplied node name (could have a wildcard). May return null if the object does not support the attributes.- Overrides:
attributeIterator
in classPropertyOwnerPointer
- Parameters:
name
- the attribute name to test- Returns:
- NodeIterator
-
getName
public QName getName()
Description copied from class:NodePointer
Returns the name of this node. Can be null.- Specified by:
getName
in classPropertyOwnerPointer
- Returns:
- QName
-
isDynamicPropertyDeclarationSupported
public boolean isDynamicPropertyDeclarationSupported()
Description copied from class:PropertyOwnerPointer
Learn whether dynamic property declaration is supported.- Overrides:
isDynamicPropertyDeclarationSupported
in classPropertyOwnerPointer
- Returns:
- true if the property owner can set a property "does not exist". A good example is a Map. You can always assign a value to any key even if it has never been "declared".
-
getBaseValue
public java.lang.Object getBaseValue()
Returns the DP object iself.- Specified by:
getBaseValue
in classNodePointer
- Returns:
- Object
-
isLeaf
public boolean isLeaf()
Description copied from class:NodePointer
If true, this node does not have children- Specified by:
isLeaf
in classNodePointer
- Returns:
- boolean
-
isCollection
public boolean isCollection()
Description copied from class:NodePointer
Returnstrue
if the value of the pointer is an array or a Collection.- Specified by:
isCollection
in classNodePointer
- Returns:
- boolean
-
getLength
public int getLength()
Returns 1.- Specified by:
getLength
in classNodePointer
- Returns:
- int
-
asPath
public java.lang.String asPath()
Description copied from class:NodePointer
Returns an XPath that maps to this Pointer.- Specified by:
asPath
in interfacePointer
- Overrides:
asPath
in classNodePointer
- Returns:
- String xpath expression
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
-