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

java.lang.Object
  |
  +--org.apache.commons.jxpath.ri.model.NodePointer
        |
        +--org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
              |
              +--org.apache.commons.jxpath.ri.model.beans.BeanPointer
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Pointer

public class BeanPointer
extends PropertyOwnerPointer

A Pointer that points to a JavaBean or a collection. It is the first element of a path, following elements will by of type PropertyPointer.

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

Field Summary
 
Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer
index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION
 
Constructor Summary
BeanPointer(NodePointer parent, QName name, java.lang.Object bean, JXPathBeanInfo beanInfo)
           
BeanPointer(QName name, java.lang.Object bean, JXPathBeanInfo beanInfo, java.util.Locale locale)
           
 
Method Summary
 java.lang.String asPath()
          Empty string
 boolean equals(java.lang.Object object)
           
 java.lang.Object getBaseValue()
          Returns the bean itself
 int getLength()
          If the bean is a collection, returns the length of that collection, otherwise returns 1.
 QName getName()
          Returns the name of this node.
 PropertyPointer getPropertyPointer()
           
 int hashCode()
           
 void remove()
          Remove the node of the object graph this pointer points to.
 void setValue(java.lang.Object value)
          Throws an exception if you try to change the root element.
 
Methods inherited from class org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
attributeIterator, childIterator, compareChildNodePointers, createChild, createChild, getNodeValue, isCollection, setIndex
 
Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
clone, compareTo, createPath, createPath, getDefaultNamespaceURI, getExpandedName, getIndex, getLocale, getNamespaceURI, getNamespaceURI, getParent, getPointerByID, getPointerByKey, getValue, getValuePointer, isActual, isDefaultNamespace, isLanguage, isLeaf, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, testNode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanPointer

public BeanPointer(QName name,
                   java.lang.Object bean,
                   JXPathBeanInfo beanInfo,
                   java.util.Locale locale)

BeanPointer

public BeanPointer(NodePointer parent,
                   QName name,
                   java.lang.Object bean,
                   JXPathBeanInfo beanInfo)
Parameters:
name - is the name given to the first node
Method Detail

getPropertyPointer

public PropertyPointer getPropertyPointer()
Specified by:
getPropertyPointer 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

getBaseValue

public java.lang.Object getBaseValue()
Returns the bean itself

Specified by:
getBaseValue in class NodePointer

setValue

public void setValue(java.lang.Object value)
Throws an exception if you try to change the root element.

Specified by:
setValue in interface Pointer
Overrides:
setValue in class PropertyOwnerPointer

remove

public void remove()
Description copied from class: NodePointer
Remove the node of the object graph this pointer points to.

Overrides:
remove in class NodePointer

getLength

public int getLength()
If the bean is a collection, returns the length of that collection, otherwise returns 1.

Overrides:
getLength 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

asPath

public java.lang.String asPath()
Empty string

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


Copyright (c) 2001 - Apache Software Foundation