|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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
public class NullPropertyPointer
| Field Summary |
|---|
| 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(NodePointer parent)
Create a new NullPropertyPointer. |
|
| Method Summary | |
|---|---|
String |
asPath()
Returns an XPath that maps to this Pointer. |
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,
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. |
NodePointer |
createPath(JXPathContext context)
Called by a child pointer when it needs to create a parent object. |
NodePointer |
createPath(JXPathContext context,
Object value)
Called directly by JXPathContext. |
Object |
getBaseValue()
Returns the value represented by the pointer before indexing. |
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. |
QName |
getName()
Returns the name of this node. |
int |
getPropertyCount()
Count the number of properties represented. |
String |
getPropertyName()
Get the property name. |
String[] |
getPropertyNames()
Get the names of the included properties. |
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()
Learn whether this pointer references an actual property. |
boolean |
isCollection()
Returns true if the value of the pointer is an array or
a Collection. |
boolean |
isContainer()
If true, this node is auxiliary 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(String attributeValue)
Set the name attribute. |
void |
setPropertyIndex(int index)
Set the property index. |
void |
setPropertyName(String propertyName)
Set the property name. |
void |
setValue(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, escape, getAbstractFactory, getDefaultNamespaceURI, getImmediateParentPointer, getIndex, getLocale, getNamespaceResolver, getNamespaceURI, getNamespaceURI, getNode, getNodeSetByKey, 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 |
| Constructor Detail |
|---|
public NullPropertyPointer(NodePointer parent)
parent - pointer| Method Detail |
|---|
public QName getName()
NodePointer
getName in class PropertyPointerpublic void setPropertyIndex(int index)
PropertyPointer
setPropertyIndex in class PropertyPointerindex - property indexpublic int getLength()
PropertyPointer
getLength in class PropertyPointerpublic Object getBaseValue()
NodePointer
getBaseValue in class NodePointerpublic Object getImmediateNode()
NodePointer
getImmediateNode in class PropertyPointerpublic boolean isLeaf()
NodePointer
isLeaf in class PropertyPointerpublic NodePointer getValuePointer()
NodePointergetValuePointer() directly. Override the
getImmediateValuePointer() method instead. The
getValuePointer() method is calls
getImmediateValuePointer() and, if the result is not
this, invokes getValuePointer() recursively.
The idea here is to open all nested containers. Let's say we have a
container within a container within a container. The
getValuePointer() method should then open all those
containers and return the pointer to the ultimate contents. It does so
with the above recursion.
getValuePointer in class NodePointerprotected boolean isActualProperty()
PropertyPointer
isActualProperty in class PropertyPointerpublic boolean isActual()
NodePointer
isActual in class PropertyPointerpublic boolean isContainer()
NodePointer
isContainer in class NodePointerpublic void setValue(Object value)
NodePointer
setValue in interface PointersetValue in class NodePointervalue - the value to setpublic NodePointer createPath(JXPathContext context)
NodePointer
createPath in class PropertyPointercontext - the owning JXPathContext
public NodePointer createPath(JXPathContext context,
Object value)
NodePointer
createPath in class PropertyPointercontext - the owning JXPathContextvalue - the new value to set
public NodePointer createChild(JXPathContext context,
QName name,
int index)
NodePointer
createChild in class PropertyPointercontext - the owning JXPathCOntextname - the QName at which a child should be createdindex - child index.
public NodePointer createChild(JXPathContext context,
QName name,
int index,
Object value)
NodePointer
createChild in class PropertyPointercontext - the owning JXPathCOntextname - the QName at which a child should be createdindex - child index.value - node value to set
public String getPropertyName()
PropertyPointer
getPropertyName in class PropertyPointerpublic void setPropertyName(String propertyName)
PropertyPointer
setPropertyName in class PropertyPointerpropertyName - property name to set.public void setNameAttributeValue(String attributeValue)
attributeValue - value to setpublic boolean isCollection()
NodePointertrue if the value of the pointer is an array or
a Collection.
isCollection in class PropertyPointerpublic int getPropertyCount()
PropertyPointer
getPropertyCount in class PropertyPointerpublic String[] getPropertyNames()
PropertyPointer
getPropertyNames in class PropertyPointerpublic String asPath()
NodePointer
asPath in interface PointerasPath in class NodePointer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||