org.apache.commons.jxpath.ri.model.beans
Class PropertyPointer

java.lang.Object
  |
  +--org.apache.commons.jxpath.ri.model.NodePointer
        |
        +--org.apache.commons.jxpath.ri.model.beans.PropertyPointer
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Pointer
Direct Known Subclasses:
BeanPropertyPointer, DynamicPropertyPointer, NullPropertyPointer

public abstract class PropertyPointer
extends NodePointer

A pointer allocated by a PropertyOwnerPointer to represent the value of a property of the parent object.

Version:
$Revision: 1.4 $ $Date: 2002/05/29 00:40:58 $
Author:
Dmitri Plotnikov

Field Summary
protected  java.lang.Object bean
           
protected  int propertyIndex
           
static int UNSPECIFIED_PROPERTY
           
 
Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer
index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION
 
Constructor Summary
PropertyPointer(NodePointer parent)
          Takes a javabean, a descriptor of a property of that object and an offset within that property (starting with 0).
 
Method Summary
 int compareChildNodePointers(NodePointer pointer1, NodePointer pointer2)
          Compares two child NodePointers and returns a positive number, zero or a positive number according to the order of the pointers.
 boolean equals(java.lang.Object object)
           
 java.lang.Object getBean()
           
 QName getName()
          Returns the name of this node.
 java.lang.Object getNodeValue()
          Returns the object the pointer points to; does not convert it to a "canonical" type.
abstract  int getPropertyCount()
           
 int getPropertyIndex()
           
abstract  java.lang.String getPropertyName()
           
abstract  java.lang.String[] getPropertyNames()
           
 NodePointer getValuePointer()
          Returns a NodePointer that can be used to access the currently selected property value.
 int hashCode()
           
 boolean isActual()
          An actual pointer points to an existing part of an object graph, even if it is null.
protected abstract  boolean isActualProperty()
           
 boolean isCollection()
          Returns true if the value of the pointer is an array or a Collection.
 void setPropertyIndex(int index)
           
abstract  void setPropertyName(java.lang.String propertyName)
           
 
Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
asPath, attributeIterator, childIterator, clone, compareTo, createChild, createChild, createPath, createPath, getBaseValue, getDefaultNamespaceURI, getExpandedName, getIndex, getLength, getLocale, getNamespaceURI, getNamespaceURI, getParent, getPointerByID, getPointerByKey, getValue, isDefaultNamespace, isLanguage, isLeaf, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, remove, setIndex, setValue, testNode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNSPECIFIED_PROPERTY

public static int UNSPECIFIED_PROPERTY

propertyIndex

protected int propertyIndex

bean

protected java.lang.Object bean
Constructor Detail

PropertyPointer

public PropertyPointer(NodePointer parent)
Takes a javabean, a descriptor of a property of that object and an offset within that property (starting with 0).

Method Detail

isCollection

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

Overrides:
isCollection in class NodePointer

getPropertyIndex

public int getPropertyIndex()

setPropertyIndex

public void setPropertyIndex(int index)

getBean

public java.lang.Object getBean()

getName

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

Specified by:
getName in class NodePointer

getPropertyName

public abstract java.lang.String getPropertyName()

setPropertyName

public abstract void setPropertyName(java.lang.String propertyName)

getPropertyCount

public abstract int getPropertyCount()

getPropertyNames

public abstract java.lang.String[] getPropertyNames()

isActualProperty

protected abstract boolean isActualProperty()

isActual

public boolean isActual()
Description copied from class: NodePointer
An actual pointer points to an existing part of an object graph, even if it is null. A non-actual pointer represents a part that does not exist at all. For instance consider the pointer "/address/street". If both address and street are not null, the pointer is actual. If address is not null, but street is null, the pointer is still actual. If address is null, the pointer is not actual. (In JavaBeans) if address is not a property of the root bean, a Pointer for this path cannot be obtained at all - actual or otherwise.

Overrides:
isActual in class NodePointer

getNodeValue

public java.lang.Object getNodeValue()
Description copied from class: NodePointer
Returns the object the pointer points to; does not convert it to a "canonical" type.

Specified by:
getNodeValue in class NodePointer

getValuePointer

public NodePointer getValuePointer()
Returns a NodePointer that can be used to access the currently selected property value.

Overrides:
getValuePointer in class NodePointer

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

compareChildNodePointers

public int compareChildNodePointers(NodePointer pointer1,
                                    NodePointer pointer2)
Description copied from class: NodePointer
Compares two child NodePointers and returns a positive number, zero or a positive number according to the order of the pointers.

Specified by:
compareChildNodePointers in class NodePointer


Copyright (c) 2001 - Apache Software Foundation