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

java.lang.Object
  extended byorg.apache.commons.jxpath.ri.model.NodePointer
      extended byorg.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, Pointer, java.io.Serializable
Direct Known Subclasses:
BeanPointer, DynaBeanPointer, DynamicPointer, 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.19 $ $Date: 2004/04/04 22:06:36 $
Author:
Dmitri Plotnikov
See Also:
Serialized Form

Field Summary
private static java.lang.Object UNINITIALIZED
           
private  java.lang.Object value
           
 
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.
 NodeIterator createNodeIterator(java.lang.String property, boolean reverse, NodePointer startWith)
           
 java.lang.Object getImmediateNode()
          Returns the object the pointer points to; does not convert it to a "canonical" type.
abstract  QName getName()
          Returns the name of this node.
abstract  PropertyPointer getPropertyPointer()
           
 boolean isDynamicPropertyDeclarationSupported()
           
 void remove()
          If this is a root node pointer, throws an exception; otherwise forwards the call to the parent node.
 void setIndex(int index)
           
 void setValue(java.lang.Object value)
          Throws an exception if you try to change the root element, otherwise forwards the call to the parent pointer.
 
Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer
asPath, clone, compareTo, createAttribute, createChild, createChild, createPath, createPath, getBaseValue, getDefaultNamespaceURI, getImmediateParentPointer, getImmediateValuePointer, getIndex, getLength, getLocale, 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, setAttribute, setNamespaceResolver, testNode, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNINITIALIZED

private static final java.lang.Object UNINITIALIZED

value

private java.lang.Object value
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

createNodeIterator

public NodeIterator createNodeIterator(java.lang.String property,
                                       boolean reverse,
                                       NodePointer startWith)

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

setIndex

public void setIndex(int index)
Overrides:
setIndex in class NodePointer

getImmediateNode

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

Specified by:
getImmediateNode 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)
Throws an exception if you try to change the root element, otherwise forwards the call to the parent pointer.

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

remove

public void remove()
If this is a root node pointer, throws an exception; otherwise forwards the call to the parent node.

Overrides:
remove in class NodePointer

getPropertyPointer

public abstract PropertyPointer getPropertyPointer()

isDynamicPropertyDeclarationSupported

public boolean isDynamicPropertyDeclarationSupported()
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".

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