|
|||||||||
| Home >> All >> org >> apache >> commons >> jxpath >> ri >> model >> [ beans overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.commons.jxpath.ri.model.beans
Class NullPropertyPointer

java.lang.Objectorg.apache.commons.jxpath.ri.model.NodePointer
org.apache.commons.jxpath.ri.model.beans.PropertyPointer
org.apache.commons.jxpath.ri.model.beans.NullPropertyPointer
- All Implemented Interfaces:
- java.lang.Cloneable, java.lang.Comparable, org.apache.commons.jxpath.Pointer, java.io.Serializable
- public class NullPropertyPointer
- extends PropertyPointer
- Version:
- $Revision: 1.18 $ $Date: 2004/03/25 03:49:50 $
| Field Summary | |
private boolean |
byNameAttribute
|
private java.lang.String |
propertyName
|
| Fields inherited from class org.apache.commons.jxpath.ri.model.beans.PropertyPointer |
bean, propertyIndex, UNSPECIFIED_PROPERTY |
| Fields inherited from class org.apache.commons.jxpath.ri.model.NodePointer |
index, locale, parent, UNKNOWN_NAMESPACE, WHOLE_COLLECTION |
| Constructor Summary | |
NullPropertyPointer(org.apache.commons.jxpath.ri.model.NodePointer parent)
|
|
| Method Summary | |
java.lang.String |
asPath()
Returns an XPath that maps to this Pointer. |
org.apache.commons.jxpath.ri.model.NodePointer |
createChild(org.apache.commons.jxpath.JXPathContext context,
org.apache.commons.jxpath.ri.QName name,
int index)
Called by a child pointer when it needs to create a parent object for a non-existent collection element. |
org.apache.commons.jxpath.ri.model.NodePointer |
createChild(org.apache.commons.jxpath.JXPathContext context,
org.apache.commons.jxpath.ri.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. |
org.apache.commons.jxpath.ri.model.NodePointer |
createPath(org.apache.commons.jxpath.JXPathContext context)
Called by a child pointer when it needs to create a parent object. |
org.apache.commons.jxpath.ri.model.NodePointer |
createPath(org.apache.commons.jxpath.JXPathContext context,
java.lang.Object value)
Called directly by JXPathContext. |
private java.lang.String |
escape(java.lang.String string)
|
java.lang.Object |
getBaseValue()
Returns the value represented by the pointer before indexing. |
java.lang.Object |
getImmediateNode()
Returns the object the pointer points to; does not convert it to a "canonical" type. |
int |
getLength()
If the property contains a collection, then the length of that collection, otherwise - 1. |
org.apache.commons.jxpath.ri.QName |
getName()
Returns the name of this node. |
int |
getPropertyCount()
|
java.lang.String |
getPropertyName()
|
java.lang.String[] |
getPropertyNames()
|
org.apache.commons.jxpath.ri.model.NodePointer |
getValuePointer()
If this pointer manages a transparent container, like a variable, this method returns the pointer to the contents. |
boolean |
isActual()
An actual pointer points to an existing part of an object graph, even if it is null. |
protected boolean |
isActualProperty()
|
boolean |
isCollection()
Returns true if the value of the pointer is an array or
a Collection. |
boolean |
isContainer()
If true, this node is axiliary and can only be used as an intermediate in the chain of pointers. |
boolean |
isLeaf()
If true, this node does not have children |
void |
setNameAttributeValue(java.lang.String attributeValue)
|
void |
setPropertyIndex(int index)
|
void |
setPropertyName(java.lang.String propertyName)
|
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.beans.PropertyPointer |
compareChildNodePointers, equals, getBean, getImmediateValuePointer, getPropertyIndex, hashCode |
| Methods inherited from class org.apache.commons.jxpath.ri.model.NodePointer |
attributeIterator, childIterator, clone, compareTo, createAttribute, getDefaultNamespaceURI, getImmediateParentPointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeValue, getParent, getPointerByID, getPointerByKey, getRootNode, getValue, isAttribute, isDefaultNamespace, isLanguage, isNode, isRoot, namespaceIterator, namespacePointer, newChildNodePointer, newNodePointer, printPointerChain, remove, setAttribute, setIndex, setNamespaceResolver, testNode, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
propertyName
private java.lang.String propertyName
byNameAttribute
private boolean byNameAttribute
| Constructor Detail |
NullPropertyPointer
public NullPropertyPointer(org.apache.commons.jxpath.ri.model.NodePointer parent)
| Method Detail |
getName
public org.apache.commons.jxpath.ri.QName getName()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Returns the name of this node. Can be null.
- Overrides:
getNamein classPropertyPointer
setPropertyIndex
public void setPropertyIndex(int index)
- Overrides:
setPropertyIndexin classPropertyPointer
getLength
public int getLength()
- Description copied from class:
PropertyPointer - If the property contains a collection, then the length of that
collection, otherwise - 1.
- Overrides:
getLengthin classPropertyPointer
getBaseValue
public java.lang.Object getBaseValue()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Returns the value represented by the pointer before indexing.
So, if the node represents an element of a collection, this
method returns the collection itself.
getImmediateNode
public java.lang.Object getImmediateNode()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Returns the object the pointer points to; does not convert it
to a "canonical" type.
- Overrides:
getImmediateNodein classPropertyPointer
isLeaf
public boolean isLeaf()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - If true, this node does not have children
- Overrides:
isLeafin classPropertyPointer
getValuePointer
public org.apache.commons.jxpath.ri.model.NodePointer getValuePointer()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - If this pointer manages a transparent container, like a variable,
this method returns the pointer to the contents.
Only an auxiliary (non-node) pointer can (and should) return a
value pointer other than itself.
Note that you probably don't want to override
getValuePointer()directly. Override thegetImmediateValuePointer()method instead. ThegetValuePointer()method is callsgetImmediateValuePointer()and, if the result is notthis, invokesgetValuePointer()recursively. The idea here is to open all nested containers. Let's say we have a container within a container within a container. ThegetValuePointer()method should then open all those containers and return the pointer to the ultimate contents. It does so with the above recursion.
isActualProperty
protected boolean isActualProperty()
- Specified by:
isActualPropertyin classPropertyPointer
isActual
public boolean isActual()
- Description copied from class:
org.apache.commons.jxpath.ri.model.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:
isActualin classPropertyPointer
isContainer
public boolean isContainer()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - If true, this node is axiliary and can only be used as an intermediate in
the chain of pointers.
setValue
public void setValue(java.lang.Object value)
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Converts the value to the required type and changes the corresponding
object to that value.
createPath
public org.apache.commons.jxpath.ri.model.NodePointer createPath(org.apache.commons.jxpath.JXPathContext context)
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Called by a child pointer when it needs to create a parent object.
Must create an object described by this pointer and return
a new pointer that properly describes the new object.
- Overrides:
createPathin classPropertyPointer
createPath
public org.apache.commons.jxpath.ri.model.NodePointer createPath(org.apache.commons.jxpath.JXPathContext context, java.lang.Object value)
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Called directly by JXPathContext. Must create path and
set value.
- Overrides:
createPathin classPropertyPointer
createChild
public org.apache.commons.jxpath.ri.model.NodePointer createChild(org.apache.commons.jxpath.JXPathContext context, org.apache.commons.jxpath.ri.QName name, int index)
- Description copied from class:
org.apache.commons.jxpath.ri.model.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:
createChildin classPropertyPointer
createChild
public org.apache.commons.jxpath.ri.model.NodePointer createChild(org.apache.commons.jxpath.JXPathContext context, org.apache.commons.jxpath.ri.QName name, int index, java.lang.Object value)
- Description copied from class:
org.apache.commons.jxpath.ri.model.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 may have to expand the collection in order to assign
the element.
- Overrides:
createChildin classPropertyPointer
getPropertyName
public java.lang.String getPropertyName()
- Specified by:
getPropertyNamein classPropertyPointer
setPropertyName
public void setPropertyName(java.lang.String propertyName)
- Specified by:
setPropertyNamein classPropertyPointer
setNameAttributeValue
public void setNameAttributeValue(java.lang.String attributeValue)
isCollection
public boolean isCollection()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Returns
trueif the value of the pointer is an array or a Collection.- Overrides:
isCollectionin classPropertyPointer
getPropertyCount
public int getPropertyCount()
- Specified by:
getPropertyCountin classPropertyPointer
getPropertyNames
public java.lang.String[] getPropertyNames()
- Specified by:
getPropertyNamesin classPropertyPointer
asPath
public java.lang.String asPath()
- Description copied from class:
org.apache.commons.jxpath.ri.model.NodePointer - Returns an XPath that maps to this Pointer.
escape
private java.lang.String escape(java.lang.String string)
|
|||||||||
| Home >> All >> org >> apache >> commons >> jxpath >> ri >> model >> [ beans overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC