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

Class BeanPointer

Implemented Interfaces:
Cloneable, Comparable, Pointer, Serializable

public class BeanPointer
extends PropertyOwnerPointer

A Pointer that points to a JavaBean or a collection. It is either the first element of a path or a pointer for a property value. Typically there is a BeanPropertyPointer between two BeanPointers in the chain.
Version:
$Revision: 1.13 $ $Date: 2004/02/29 14:17:41 $
Author:
Dmitri Plotnikov

Field Summary

Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer

UNKNOWN_NAMESPACE, WHOLE_COLLECTION, index, locale, parent

Constructor Summary

BeanPointer(QName name, Object bean, JXPathBeanInfo beanInfo, Locale locale)
BeanPointer(NodePointer parent, QName name, Object bean, JXPathBeanInfo beanInfo)

Method Summary

String
asPath()
If the pointer has a parent, then parent's path.
boolean
equals(Object object)
Object
getBaseValue()
Returns the bean itself
int
getLength()
Returns 1.
QName
getName()
PropertyPointer
getPropertyPointer()
int
hashCode()
boolean
isCollection()
Returns false
boolean
isLeaf()

Methods inherited from class org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer

attributeIterator, childIterator, compareChildNodePointers, createNodeIterator, getImmediateNode, getName, getPropertyPointer, isDynamicPropertyDeclarationSupported, remove, setIndex, setValue

Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer

asPath, attributeIterator, childIterator, clone, compareChildNodePointers, compareTo, createAttribute, createChild, createChild, createPath, createPath, getBaseValue, getDefaultNamespaceURI, getImmediateNode, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLength, getLocale, getName, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValue, getValuePointer, isActual, isAttribute, isCollection, isContainer, isDefaultNamespace, isLanguage, isLeaf, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, remove, setAttribute, setIndex, setNamespaceResolver, setValue, testNode, toString

Constructor Details

BeanPointer

public BeanPointer(QName name,
                   Object bean,
                   JXPathBeanInfo beanInfo,
                   Locale locale)

BeanPointer

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

Method Details

asPath

public String asPath()
If the pointer has a parent, then parent's path. If the bean is null, "null()". If the bean is a primitive value, the value itself. Otherwise - an empty string.
Specified by:
asPath in interface Pointer
Overrides:
asPath in interface NodePointer

equals

public boolean equals(Object object)

getBaseValue

public Object getBaseValue()
Returns the bean itself
Overrides:
getBaseValue in interface NodePointer

getLength

public int getLength()
Returns 1.
Overrides:
getLength in interface NodePointer

getName

public QName getName()
Overrides:
getName in interface PropertyOwnerPointer

getPropertyPointer

public PropertyPointer getPropertyPointer()
Overrides:
getPropertyPointer in interface PropertyOwnerPointer

hashCode

public int hashCode()

isCollection

public boolean isCollection()
Returns false
Overrides:
isCollection in interface NodePointer

isLeaf

public boolean isLeaf()
Overrides:
isLeaf in interface NodePointer