Java Doc for XPath.java in  » Workflow-Engines » OpenWFE » org » jdom » xpath » 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 » Workflow Engines » OpenWFE » org.jdom.xpath 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jdom.xpath.XPath

All known Subclasses:   org.jdom.xpath.JaxenXPath,
XPath
abstract public class XPath implements Serializable(Code)
A utility class for performing XPath calls on JDOM nodes, with a factory interface for obtaining a first XPath instance. Users operate against this class while XPath vendors can plug-in implementations underneath. Users can choose an implementation using either XPath.setXPathClass or the system property "org.jdom.xpath.class".
version:
   $Revision: 1.2 $, $Date: 2005/05/03 07:02:04 $
author:
   Laurent Bihanic




Method Summary
abstract public  voidaddNamespace(Namespace namespace)
     Adds a namespace definition to the list of namespaces known of this XPath expression.

Note: In XPath, there is no such thing as a 'default namespace'.

public  voidaddNamespace(String prefix, String uri)
     Adds a namespace definition (prefix and URI) to the list of namespaces known of this XPath expression.

Note: In XPath, there is no such thing as a 'default namespace'.

abstract public  StringgetXPath()
     Returns the wrapped XPath expression as a string.
public static  XPathnewInstance(String path)
     Creates a new XPath wrapper object, compiling the specified XPath expression.
abstract public  NumbernumberValueOf(Object context)
     Returns the number value of the first node selected by applying the wrapped XPath expression to the given context.
Parameters:
  context - the element to use as context for evaluatingthe XPath expression.
abstract public  ListselectNodes(Object context)
     Evaluates the wrapped XPath expression and returns the list of selected items.
Parameters:
  context - the node to use as context for evaluatingthe XPath expression.
public static  ListselectNodes(Object context, String path)
     Evaluates an XPath expression and returns the list of selected items.

Note: This method should not be used when the same XPath expression needs to be applied several times (on the same or different contexts) as it requires the expression to be compiled before being evaluated.

abstract public  ObjectselectSingleNode(Object context)
     Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes (or atomics).
Parameters:
  context - the node to use as context for evaluatingthe XPath expression.
public static  ObjectselectSingleNode(Object context, String path)
     Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes (or atomics).

Note: This method should not be used when the same XPath expression needs to be applied several times (on the same or different contexts) as it requires the expression to be compiled before being evaluated.

abstract public  voidsetVariable(String name, Object value)
     Defines an XPath variable and sets its value.
public static  voidsetXPathClass(Class aClass)
     Sets the concrete XPath subclass to use when allocating XPath instances.
abstract public  StringvalueOf(Object context)
     Returns the string value of the first node selected by applying the wrapped XPath expression to the given context.
Parameters:
  context - the element to use as context for evaluatingthe XPath expression.
final protected  ObjectwriteReplace()
     [Serialization support] Returns the alternative object to write to the stream when serializing this object.



Method Detail
addNamespace
abstract public void addNamespace(Namespace namespace)(Code)
Adds a namespace definition to the list of namespaces known of this XPath expression.

Note: In XPath, there is no such thing as a 'default namespace'. The empty prefix always resolves to the empty namespace URI.


Parameters:
  namespace - the namespace.



addNamespace
public void addNamespace(String prefix, String uri)(Code)
Adds a namespace definition (prefix and URI) to the list of namespaces known of this XPath expression.

Note: In XPath, there is no such thing as a 'default namespace'. The empty prefix always resolves to the empty namespace URI.


Parameters:
  prefix - the namespace prefix.
Parameters:
  uri - the namespace URI.
throws:
  IllegalNameException - if the prefix or uri are null orempty strings or if they containillegal characters.



getXPath
abstract public String getXPath()(Code)
Returns the wrapped XPath expression as a string. the wrapped XPath expression as a string.



newInstance
public static XPath newInstance(String path) throws JDOMException(Code)
Creates a new XPath wrapper object, compiling the specified XPath expression.
Parameters:
  path - the XPath expression to wrap.
throws:
  JDOMException - if the XPath expression is invalid.



numberValueOf
abstract public Number numberValueOf(Object context) throws JDOMException(Code)
Returns the number value of the first node selected by applying the wrapped XPath expression to the given context.
Parameters:
  context - the element to use as context for evaluatingthe XPath expression. the number value of the first node selected by applyingthe wrapped XPath expression to the given context,null if no node was selected or thespecial value java.lang.Double.NaN(NotElement-a-Number) if the selected value can not beconverted into a number value.
throws:
  JDOMException - if the XPath expression is invalid orits evaluation on the specified contextfailed.



selectNodes
abstract public List selectNodes(Object context) throws JDOMException(Code)
Evaluates the wrapped XPath expression and returns the list of selected items.
Parameters:
  context - the node to use as context for evaluatingthe XPath expression. the list of selected items, which may be of types: Element,Attribute, Text, CDATA,Comment, ProcessingInstruction, Boolean,Double, or String.
throws:
  JDOMException - if the evaluation of the XPathexpression on the specified contextfailed.



selectNodes
public static List selectNodes(Object context, String path) throws JDOMException(Code)
Evaluates an XPath expression and returns the list of selected items.

Note: This method should not be used when the same XPath expression needs to be applied several times (on the same or different contexts) as it requires the expression to be compiled before being evaluated. In such cases, XPath.newInstance allocating an XPath wrapper instance and XPath.selectNodes(java.lang.Object) evaluating it several times is way more efficient.


Parameters:
  context - the node to use as context for evaluatingthe XPath expression.
Parameters:
  path - the XPath expression to evaluate. the list of selected items, which may be of types: Element,Attribute, Text, CDATA,Comment, ProcessingInstruction, Boolean,Double, or String.
throws:
  JDOMException - if the XPath expression is invalid orits evaluation on the specified contextfailed.



selectSingleNode
abstract public Object selectSingleNode(Object context) throws JDOMException(Code)
Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes (or atomics).
Parameters:
  context - the node to use as context for evaluatingthe XPath expression. the first selected item, which may be of types: Element,Attribute, Text, CDATA,Comment, ProcessingInstruction, Boolean,Double, String, or null if no item was selected.
throws:
  JDOMException - if the evaluation of the XPathexpression on the specified contextfailed.



selectSingleNode
public static Object selectSingleNode(Object context, String path) throws JDOMException(Code)
Evaluates the wrapped XPath expression and returns the first entry in the list of selected nodes (or atomics).

Note: This method should not be used when the same XPath expression needs to be applied several times (on the same or different contexts) as it requires the expression to be compiled before being evaluated. In such cases, XPath.newInstance allocating an XPath wrapper instance and XPath.selectSingleNode(java.lang.Object) evaluating it several times is way more efficient.


Parameters:
  context - the element to use as context for evaluatingthe XPath expression.
Parameters:
  path - the XPath expression to evaluate. the first selected item, which may be of types: Element,Attribute, Text, CDATA,Comment, ProcessingInstruction, Boolean,Double, String, or null if no item was selected.
throws:
  JDOMException - if the XPath expression is invalid orits evaluation on the specified contextfailed.



setVariable
abstract public void setVariable(String name, Object value)(Code)
Defines an XPath variable and sets its value.
Parameters:
  name - the variable name.
Parameters:
  value - the variable value.
throws:
  IllegalArgumentException - if name is nota valid XPath variable nameor if the value type is notsupported by the underlyingimplementation



setXPathClass
public static void setXPathClass(Class aClass) throws JDOMException(Code)
Sets the concrete XPath subclass to use when allocating XPath instances.
Parameters:
  aClass - the concrete subclass of XPath.
throws:
  IllegalArgumentException - if aClass isnull.
throws:
  JDOMException - if aClass isnot a concrete subclassof XPath.



valueOf
abstract public String valueOf(Object context) throws JDOMException(Code)
Returns the string value of the first node selected by applying the wrapped XPath expression to the given context.
Parameters:
  context - the element to use as context for evaluatingthe XPath expression. the string value of the first node selected by applyingthe wrapped XPath expression to the given context.
throws:
  JDOMException - if the XPath expression is invalid orits evaluation on the specified contextfailed.



writeReplace
final protected Object writeReplace() throws ObjectStreamException(Code)
[Serialization support] Returns the alternative object to write to the stream when serializing this object. This method returns an instance of a dedicated nested class to serialize XPath expressions independently of the concrete implementation being used.

Note: Subclasses are not allowed to override this method to ensure valid serialization of all implementations.

an XPathString instance configured with the wrappedXPath expression.
throws:
  ObjectStreamException - never.



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.