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

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

public abstract class PropertyOwnerPointer
extends NodePointer

A pointer describing a node that has properties, each of which could be a collection.

Version:
$Revision: 1.5 $ $Date: 2002/06/18 00:01:15 $
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
protected PropertyOwnerPointer(NodePointer parent)
           
protected PropertyOwnerPointer(NodePointer parent, java.util.Locale locale)
           
 
Method Summary
 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 childIterator(NodeTest test, boolean reverse, NodePointer startWith)
          Returns a NodeIterator that iterates over all children or all children that match the given NodeTest, starting with the specified one.
 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.
 NodePointer createChild(JXPathContext context, QName name, int index)
          Called by a child pointer when it needs to create a parent object for a non-existent collection element.
 NodePointer createChild(JXPathContext context, QName name, int index, java.lang.Object value)
          Called by a child pointer if that child needs to assign the value supplied in the createPath(context, value) call to a non-existent node.
abstract  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  PropertyPointer getPropertyPointer()
           
 boolean isCollection()
          Returns true if the value of the pointer is an array or a Collection.
 void setIndex(int index)
           
 void setValue(java.lang.Object value)
          Converts the value to the required type and changes the corresponding object to that value.
 
Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
asPath, clone, compareTo, createPath, createPath, getBaseValue, getDefaultNamespaceURI, getExpandedName, getIndex, getLength, getLocale, getNamespaceURI, getNamespaceURI, getParent, getPointerByID, getPointerByKey, getValue, getValuePointer, isActual, isDefaultNamespace, isLanguage, isLeaf, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, remove, testNode, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyOwnerPointer

protected PropertyOwnerPointer(NodePointer parent,
                               java.util.Locale locale)

PropertyOwnerPointer

protected PropertyOwnerPointer(NodePointer parent)
Method Detail

childIterator

public NodeIterator childIterator(NodeTest test,
                                  boolean reverse,
                                  NodePointer startWith)
Description copied from class: NodePointer
Returns a NodeIterator that iterates over all children or all children that match the given NodeTest, starting with the specified one.

Overrides:
childIterator in class NodePointer

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 NodePointer

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

setIndex

public void setIndex(int index)
Overrides:
setIndex 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

getName

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

Specified by:
getName in class NodePointer

setValue

public void setValue(java.lang.Object value)
Description copied from class: NodePointer
Converts the value to the required type and changes the corresponding object to that value.

Specified by:
setValue in interface Pointer
Specified by:
setValue in class NodePointer

getPropertyPointer

public abstract PropertyPointer getPropertyPointer()

createChild

public NodePointer createChild(JXPathContext context,
                               QName name,
                               int index,
                               java.lang.Object value)
Description copied from class: NodePointer
Called by a child pointer if that child needs to assign the value supplied in the createPath(context, value) call to a non-existent node. This method must may have to expand the collection in order to assign the element.

Overrides:
createChild in class NodePointer

createChild

public NodePointer createChild(JXPathContext context,
                               QName name,
                               int index)
Description copied from class: NodePointer
Called by a child pointer when it needs to create a parent object for a non-existent collection element. It may have to expand the collection, then create an element object and return a new pointer describing the newly created element.

Overrides:
createChild in class NodePointer

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