org.apache.commons.jxpath.ri.model.dynamic
Class DynamicPointer

java.lang.Object
  extended byorg.apache.commons.jxpath.ri.model.NodePointer
      extended byorg.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
          extended byorg.apache.commons.jxpath.ri.model.dynamic.DynamicPointer
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Pointer, java.io.Serializable

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 type PropertyPointer.

Version:
$Revision: 1.6 $ $Date: 2004/02/29 14:17:44 $
Author:
Dmitri Plotnikov
See Also:
Serialized Form

Field Summary
private  java.lang.Object bean
           
private  DynamicPropertyHandler handler
           
private  QName name
           
private  java.lang.String[] names
           
 
Fields inherited from class org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
 
Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer
index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION
 
Constructor Summary
DynamicPointer(NodePointer parent, QName name, java.lang.Object bean, DynamicPropertyHandler handler)
           
DynamicPointer(QName name, java.lang.Object bean, DynamicPropertyHandler handler, java.util.Locale locale)
           
 
Method Summary
 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)
           
 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()
           
 int hashCode()
           
 boolean isCollection()
          Returns true if the value of the pointer is an array or a Collection.
 boolean isDynamicPropertyDeclarationSupported()
           
 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, remove, setIndex, setValue
 
Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
clone, compareTo, createAttribute, createChild, createChild, createPath, createPath, getDefaultNamespaceURI, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValue, getValuePointer, isActual, isAttribute, isContainer, isDefaultNamespace, isLanguage, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, setAttribute, setNamespaceResolver, testNode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private QName name

bean

private java.lang.Object bean

handler

private DynamicPropertyHandler handler

names

private java.lang.String[] names
Constructor Detail

DynamicPointer

public DynamicPointer(QName name,
                      java.lang.Object bean,
                      DynamicPropertyHandler handler,
                      java.util.Locale locale)

DynamicPointer

public DynamicPointer(NodePointer parent,
                      QName name,
                      java.lang.Object bean,
                      DynamicPropertyHandler handler)
Method Detail

getPropertyPointer

public PropertyPointer getPropertyPointer()
Specified by:
getPropertyPointer in class PropertyOwnerPointer

createNodeIterator

public NodeIterator createNodeIterator(java.lang.String property,
                                       boolean reverse,
                                       NodePointer startWith)
Overrides:
createNodeIterator in class PropertyOwnerPointer

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 class PropertyOwnerPointer

getName

public QName getName()
Description copied from class: NodePointer
Returns the name of this node. Can be null.

Specified by:
getName in class PropertyOwnerPointer

isDynamicPropertyDeclarationSupported

public boolean isDynamicPropertyDeclarationSupported()
Overrides:
isDynamicPropertyDeclarationSupported in class PropertyOwnerPointer
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 class NodePointer

isLeaf

public boolean isLeaf()
Description copied from class: NodePointer
If true, this node does not have children

Specified by:
isLeaf in class NodePointer

isCollection

public boolean isCollection()
Description copied from class: NodePointer
Returns true if the value of the pointer is an array or a Collection.

Specified by:
isCollection in class NodePointer

getLength

public int getLength()
Returns 1.

Specified by:
getLength in class NodePointer

asPath

public java.lang.String asPath()
Description copied from class: NodePointer
Returns an XPath that maps to this Pointer.

Specified by:
asPath in interface Pointer
Overrides:
asPath in class NodePointer

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object object)