Java Doc for NodePointer.java in  » Library » Apache-commons-jxpath-1.2-src » org » apache » commons » jxpath » ri » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Library » Apache commons jxpath 1.2 src » org.apache.commons.jxpath.ri.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.jxpath.ri.model.NodePointer

All known Subclasses:   org.apache.commons.jxpath.ri.model.jdom.JDOMNodePointer,  org.apache.commons.jxpath.ri.model.jdom.JDOMNamespacePointer,  org.apache.commons.jxpath.ri.model.dom.NamespacePointer,  org.apache.commons.jxpath.ri.model.beans.PropertyPointer,  org.apache.commons.jxpath.ri.model.dom.DOMAttributePointer,  org.apache.commons.jxpath.ri.model.beans.LangAttributePointer,  org.apache.commons.jxpath.ri.model.container.ContainerPointer,  org.apache.commons.jxpath.ri.model.jdom.JDOMAttributePointer,  org.apache.commons.jxpath.ri.model.dom.DOMNodePointer,  org.apache.commons.jxpath.ri.model.beans.PropertyOwnerPointer,  org.apache.commons.jxpath.ri.model.VariablePointer,  org.apache.commons.jxpath.ri.model.beans.CollectionPointer,
NodePointer
abstract public class NodePointer implements Pointer(Code)
Common superclass for Pointers of all kinds. A NodePointer maps to a deterministic XPath that represents the location of a node in an object graph. This XPath uses only simple axes: child, namespace and attribute and only simple, context-independent predicates.
author:
   Dmitri Plotnikov
version:
   $Revision: 1.25 $ $Date: 2004/04/01 02:55:32 $


Field Summary
final public static  StringUNKNOWN_NAMESPACE
    
final public static  intWHOLE_COLLECTION
    
protected  intindex
    
protected  Localelocale
    
protected  NodePointerparent
    

Constructor Summary
protected  NodePointer(NodePointer parent)
    
protected  NodePointer(NodePointer parent, Locale locale)
    

Method Summary
public  StringasPath()
     Returns an XPath that maps to this Pointer.
public  NodeIteratorattributeIterator(QName qname)
     Returns a NodeIterator that iterates over all attributes of the current node matching the supplied node name (could have a wildcard).
public  NodeIteratorchildIterator(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.
public  Objectclone()
    
abstract public  intcompareChildNodePointers(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.
public  intcompareTo(Object object)
    
public  NodePointercreateAttribute(JXPathContext context, QName name)
    
public  NodePointercreateChild(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.
public  NodePointercreateChild(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.
public  NodePointercreatePath(JXPathContext context, Object value)
     Called directly by JXPathContext.
public  NodePointercreatePath(JXPathContext context)
     Called by a child pointer when it needs to create a parent object.
abstract public  ObjectgetBaseValue()
     Returns the value represented by the pointer before indexing.
protected  StringgetDefaultNamespaceURI()
    
abstract public  ObjectgetImmediateNode()
     Returns the object the pointer points to; does not convert it to a "canonical" type.
public  NodePointergetImmediateParentPointer()
    
public  NodePointergetImmediateValuePointer()
    
public  intgetIndex()
     If the pointer represents a collection, the index identifies an element of that collection.
abstract public  intgetLength()
     If the pointer represents a collection (or collection element), returns the length of the collection.
public  LocalegetLocale()
     If the Pointer has a parent, returns the parent's locale; otherwise returns the locale specified when this Pointer was created.
abstract public  QNamegetName()
     Returns the name of this node.
public  NamespaceResolvergetNamespaceResolver()
    
public  StringgetNamespaceURI(String prefix)
     Decodes a namespace prefix to the corresponding URI.
public  StringgetNamespaceURI()
     Returns the namespace URI associated with this Pointer.
public  ObjectgetNode()
     Returns the object the pointer points to; does not convert it to a "canonical" type.
public  ObjectgetNodeValue()
     Returns the object the pointer points to; does not convert it to a "canonical" type.
public  NodePointergetParent()
    
public  PointergetPointerByID(JXPathContext context, String id)
     Locates a node by ID.
public  PointergetPointerByKey(JXPathContext context, String key, String value)
     Locates a node by key and value.
public  ObjectgetRootNode()
    
public  ObjectgetValue()
     By default, returns getNode(), can be overridden to return a "canonical" value, like for instance a DOM element should return its string value.
public  NodePointergetValuePointer()
     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.
public  booleanisActual()
     An actual pointer points to an existing part of an object graph, even if it is null.
public  booleanisAttribute()
     Returns true if the pointer represents the "attribute::" axis.
abstract public  booleanisCollection()
     Returns true if the value of the pointer is an array or a Collection.
public  booleanisContainer()
     If true, this node is axiliary and can only be used as an intermediate in the chain of pointers.
protected  booleanisDefaultNamespace(String prefix)
     Returns true if the supplied prefix represents the default namespace in the context of the current node.
public  booleanisLanguage(String lang)
     Returns true if the selected locale name starts with the specified prefix lang, case-insensitive.
abstract public  booleanisLeaf()
    
public  booleanisNode()
    
public  booleanisRoot()
     Returns true if this Pointer has no parent.
public  NodeIteratornamespaceIterator()
     Returns a NodeIterator that iterates over all namespaces of the value currently pointed at.
public  NodePointernamespacePointer(String namespace)
     Returns a NodePointer for the specified namespace.
public static  NodePointernewChildNodePointer(NodePointer parent, QName name, Object bean)
     Allocates an new child NodePointer by iterating through all installed NodePointerFactories until it finds one that can create a pointer.
public static  NodePointernewNodePointer(QName name, Object bean, Locale locale)
     Allocates an entirely new NodePointer by iterating through all installed NodePointerFactories until it finds one that can create a pointer.
public  voidprintPointerChain()
    
public  voidremove()
     Remove the node of the object graph this pointer points to.
public  voidsetAttribute(boolean attribute)
     Set to true if the pointer represents the "attribute::" axis.
public  voidsetIndex(int index)
    
public  voidsetNamespaceResolver(NamespaceResolver namespaceResolver)
    
abstract public  voidsetValue(Object value)
     Converts the value to the required type and changes the corresponding object to that value.
public  booleantestNode(NodeTest test)
     Checks if this Pointer matches the supplied NodeTest.
public  StringtoString()
    

Field Detail
UNKNOWN_NAMESPACE
final public static String UNKNOWN_NAMESPACE(Code)



WHOLE_COLLECTION
final public static int WHOLE_COLLECTION(Code)



index
protected int index(Code)



locale
protected Locale locale(Code)



parent
protected NodePointer parent(Code)




Constructor Detail
NodePointer
protected NodePointer(NodePointer parent)(Code)



NodePointer
protected NodePointer(NodePointer parent, Locale locale)(Code)




Method Detail
asPath
public String asPath()(Code)
Returns an XPath that maps to this Pointer.



attributeIterator
public NodeIterator attributeIterator(QName qname)(Code)
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.



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



clone
public Object clone()(Code)



compareChildNodePointers
abstract public int compareChildNodePointers(NodePointer pointer1, NodePointer pointer2)(Code)
Compares two child NodePointers and returns a positive number, zero or a positive number according to the order of the pointers.



compareTo
public int compareTo(Object object)(Code)



createAttribute
public NodePointer createAttribute(JXPathContext context, QName name)(Code)
Called to create a non-existing attribute



createChild
public NodePointer createChild(JXPathContext context, QName name, int index, Object value)(Code)
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.



createChild
public NodePointer createChild(JXPathContext context, QName name, int index)(Code)
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.



createPath
public NodePointer createPath(JXPathContext context, Object value)(Code)
Called directly by JXPathContext. Must create path and set value.



createPath
public NodePointer createPath(JXPathContext context)(Code)
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.



getBaseValue
abstract public Object getBaseValue()(Code)
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.



getDefaultNamespaceURI
protected String getDefaultNamespaceURI()(Code)



getImmediateNode
abstract public Object getImmediateNode()(Code)
Returns the object the pointer points to; does not convert it to a "canonical" type.



getImmediateParentPointer
public NodePointer getImmediateParentPointer()(Code)



getImmediateValuePointer
public NodePointer getImmediateValuePointer()(Code)

See Also:   NodePointer.getValuePointer() NodePointer is either this or a pointerfor the immediately contained value.



getIndex
public int getIndex()(Code)
If the pointer represents a collection, the index identifies an element of that collection. The default value of index is WHOLE_COLLECTION, which just means that the pointer is not indexed at all. Note: the index on NodePointer starts with 0, not 1.



getLength
abstract public int getLength()(Code)
If the pointer represents a collection (or collection element), returns the length of the collection. Otherwise returns 1 (even if the value is null).



getLocale
public Locale getLocale()(Code)
If the Pointer has a parent, returns the parent's locale; otherwise returns the locale specified when this Pointer was created.



getName
abstract public QName getName()(Code)
Returns the name of this node. Can be null.



getNamespaceResolver
public NamespaceResolver getNamespaceResolver()(Code)



getNamespaceURI
public String getNamespaceURI(String prefix)(Code)
Decodes a namespace prefix to the corresponding URI.



getNamespaceURI
public String getNamespaceURI()(Code)
Returns the namespace URI associated with this Pointer.



getNode
public Object getNode()(Code)
Returns the object the pointer points to; does not convert it to a "canonical" type. Opens containers, properties etc and returns the ultimate contents.



getNodeValue
public Object getNodeValue()(Code)
Returns the object the pointer points to; does not convert it to a "canonical" type.



getParent
public NodePointer getParent()(Code)



getPointerByID
public Pointer getPointerByID(JXPathContext context, String id)(Code)
Locates a node by ID.



getPointerByKey
public Pointer getPointerByKey(JXPathContext context, String key, String value)(Code)
Locates a node by key and value.



getRootNode
public Object getRootNode()(Code)



getValue
public Object getValue()(Code)
By default, returns getNode(), can be overridden to return a "canonical" value, like for instance a DOM element should return its string value.



getValuePointer
public NodePointer getValuePointer()(Code)
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 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.



isActual
public boolean isActual()(Code)
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.



isAttribute
public boolean isAttribute()(Code)
Returns true if the pointer represents the "attribute::" axis.



isCollection
abstract public boolean isCollection()(Code)
Returns true if the value of the pointer is an array or a Collection.



isContainer
public boolean isContainer()(Code)
If true, this node is axiliary and can only be used as an intermediate in the chain of pointers.



isDefaultNamespace
protected boolean isDefaultNamespace(String prefix)(Code)
Returns true if the supplied prefix represents the default namespace in the context of the current node.



isLanguage
public boolean isLanguage(String lang)(Code)
Returns true if the selected locale name starts with the specified prefix lang, case-insensitive.



isLeaf
abstract public boolean isLeaf()(Code)
If true, this node does not have children



isNode
public boolean isNode()(Code)



isRoot
public boolean isRoot()(Code)
Returns true if this Pointer has no parent.



namespaceIterator
public NodeIterator namespaceIterator()(Code)
Returns a NodeIterator that iterates over all namespaces of the value currently pointed at. May return null if the object does not support the namespaces.



namespacePointer
public NodePointer namespacePointer(String namespace)(Code)
Returns a NodePointer for the specified namespace. Will return null if namespaces are not supported. Will return UNKNOWN_NAMESPACE if there is no such namespace.



newChildNodePointer
public static NodePointer newChildNodePointer(NodePointer parent, QName name, Object bean)(Code)
Allocates an new child NodePointer by iterating through all installed NodePointerFactories until it finds one that can create a pointer.



newNodePointer
public static NodePointer newNodePointer(QName name, Object bean, Locale locale)(Code)
Allocates an entirely new NodePointer by iterating through all installed NodePointerFactories until it finds one that can create a pointer.



printPointerChain
public void printPointerChain()(Code)
Print internal structure of a pointer for debugging



remove
public void remove()(Code)
Remove the node of the object graph this pointer points to.



setAttribute
public void setAttribute(boolean attribute)(Code)
Set to true if the pointer represents the "attribute::" axis.



setIndex
public void setIndex(int index)(Code)



setNamespaceResolver
public void setNamespaceResolver(NamespaceResolver namespaceResolver)(Code)



setValue
abstract public void setValue(Object value)(Code)
Converts the value to the required type and changes the corresponding object to that value.



testNode
public boolean testNode(NodeTest test)(Code)
Checks if this Pointer matches the supplied NodeTest.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.