Java Doc for XPathExpressionImpl.java in  » XML » XPath-Saxon » net » sf » saxon » 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 » XML » XPath Saxon » net.sf.saxon.xpath 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.saxon.xpath.XPathExpressionImpl

XPathExpressionImpl
public class XPathExpressionImpl implements XPathExpression(Code)

The JAXP XPathExpression interface represents a compiled XPath expression that can be repeatedly evaluated. This class is Saxon's implementation of that interface.

The class also includes some methods retained from Saxon's original XPath API. When these methods are used, the object contains the context node and other state, so it is not thread-safe.


author:
   Michael H. Kay



Constructor Summary
protected  XPathExpressionImpl(Expression exp, Configuration config)
    

Method Summary
public  Listevaluate()
     Execute a prepared XPath expression, returning the results as a List.
public  Objectevaluate(Object node, QName qName)
     JAXP 1.3 evaluate() method
Parameters:
  node - The context node.
public  Stringevaluate(Object node)
     Evaluate the expression to return a string value
Parameters:
  node - the initial context node.
public  Objectevaluate(InputSource inputSource, QName qName)
     Evaluate the XPath expression against an input source to obtain a result of a specified type
Parameters:
  inputSource - The input source document against which the expression is evaluated.(Note that there is no caching.
public  Stringevaluate(InputSource inputSource)
     Evaluate the XPath expression against an input source to obtain a string result
Parameters:
  inputSource - The input source document against which the expression is evaluated.(Note that there is no caching.
public  ObjectevaluateSingle()
     Execute a prepared XPath expression, returning the first item in the result. This is useful where it is known that the expression will only return a singleton value (for example, a single node, or a boolean).
public  ExpressiongetInternalExpression()
     Low-level method to get the internal Saxon expression object.
public  SequenceIteratorrawIterator()
     Get a raw iterator over the results of the expression.
public  voidsetContextNode(NodeInfo node)
     Set the context node for evaluating the expression.
public  voidsetSortKey(XPathExpressionImpl sortKey)
     Define the sort order for the results of the expression.
protected  voidsetStackFrameMap(SlotManager map)
     Define the number of slots needed for local variables within the expression.


Constructor Detail
XPathExpressionImpl
protected XPathExpressionImpl(Expression exp, Configuration config)(Code)
The constructor is protected, to ensure that instances can only be created using the createExpression() method of XPathEvaluator




Method Detail
evaluate
public List evaluate() throws XPathException(Code)
Execute a prepared XPath expression, returning the results as a List. The context node must have been set previously using XPathExpressionImpl.setContextNode(net.sf.saxon.om.NodeInfo) . The results of the expression, as a List. The List represents the sequenceof items returned by the expression. Each item in the list will either be an instanceof net.sf.saxon.om.NodeInfo, representing a node, or a Java object representing an atomic value.For the types of Java object that may be returned, see XPathExpressionImpl.evaluate(Object,javax.xml.namespace.QName)with the second argument set to NODESET.



evaluate
public Object evaluate(Object node, QName qName) throws XPathExpressionException(Code)
JAXP 1.3 evaluate() method
Parameters:
  node - The context node. This must use a representation of nodes that this implementation understands.This may be a Saxon NodeInfo, or a node in one of the external object models supported, for exampleDOM, JDOM, or XOM, provided the support module for that object model is loaded.
Parameters:
  qName - Indicates the type of result required. This must be one of the constants defined inthe JAXP XPathConstants class.Saxon will attempt to convert the actual result of the expression to the required type using theXPath 1.0 conversion rules. the result of the evaluation, as a Java object of the appropriate type. Saxon interprets therules as follows:
QNameReturn Value
BOOLEANThe effective boolean value of the actual result,as a Java Boolean object
STRINGThe result of applying the string() function to the actual result,as a Java String object
NUMBERThe result of applying the number() function to the actual result,as a Java Double object
NODEA single node, in the native data model supplied as input. If theexpression returns more than one node, the first is returned. Ifthe expression returns an empty sequence, null is returned. If theexpression returns an atomic value, or if the first item in theresult sequence is an atomic value, an exception is thrown.
NODESETThis is interpreted as allowing any sequence, of nodes or atomic values.The result is returned as a Java List object, unless it is empty, in whichcase null is returned. The contents of the list may be node objects (in thenative data model supplied as input, or Java objects representing the XPathatomic values in the actual result: String for an xs:string, Double for a xs:double,Long for an xs:integer, and so on. (For safety, cast the values to a typesuch as xs:string within the XPath expression). Note that the result is neverreturned as a DOM NodeList.

throws:
  XPathExpressionException - if evaluation of the expression fails or if theresult cannot be converted to the requested type.



evaluate
public String evaluate(Object node) throws XPathExpressionException(Code)
Evaluate the expression to return a string value
Parameters:
  node - the initial context node. This must be an instance of NodeInfo the results of the expression, converted to a String
throws:
  XPathExpressionException - if evaluation fails



evaluate
public Object evaluate(InputSource inputSource, QName qName) throws XPathExpressionException(Code)
Evaluate the XPath expression against an input source to obtain a result of a specified type
Parameters:
  inputSource - The input source document against which the expression is evaluated.(Note that there is no caching. This will be parsed, and the parsed result will be discarded.)
Parameters:
  qName - The type required, identified by a constant in XPathConstants the result of the evaluation, as a Java object of the appropriate type:see XPathExpressionImpl.evaluate(Object,javax.xml.namespace.QName)
throws:
  XPathExpressionException -



evaluate
public String evaluate(InputSource inputSource) throws XPathExpressionException(Code)
Evaluate the XPath expression against an input source to obtain a string result
Parameters:
  inputSource - The input source document against which the expression is evaluated.(Note that there is no caching. This will be parsed, and the parsed result will be discarded.) the result of the evaluation, converted to a String
throws:
  XPathExpressionException -



evaluateSingle
public Object evaluateSingle() throws XPathException(Code)
Execute a prepared XPath expression, returning the first item in the result. This is useful where it is known that the expression will only return a singleton value (for example, a single node, or a boolean). The context node must be set previously using XPathExpressionImpl.setContextNode(net.sf.saxon.om.NodeInfo) . The first item in the sequence returned by the expression. If the expressionreturns an empty sequence, this method returns null. Otherwise, it returns the firstitem in the result sequence, represented as a Java object using the same mapping as forthe evaluate() method



getInternalExpression
public Expression getInternalExpression()(Code)
Low-level method to get the internal Saxon expression object. This exposes a wide range of internal methods that may be needed by specialized applications, and allows greater control over the dynamic context for evaluating the expression. the underlying Saxon expression object.



rawIterator
public SequenceIterator rawIterator() throws XPathException(Code)
Get a raw iterator over the results of the expression. This returns results without any conversion of the returned items to "native" Java classes. This method is intended for use by applications that need to process the results of the expression using internal Saxon interfaces.



setContextNode
public void setContextNode(NodeInfo node)(Code)
Set the context node for evaluating the expression. If this method is not called, the context node will be the root of the document to which the prepared expression is bound.



setSortKey
public void setSortKey(XPathExpressionImpl sortKey)(Code)
Define the sort order for the results of the expression. If this method is called, then the list returned by a subsequent call on the evaluate() method will first be sorted.
Parameters:
  sortKey - an XPathExpression, which will be applied to each item in the sequence;the result of this expression determines the ordering of the list returned by the evaluate()method. The sortKey can be null, to clear a previous sort key.



setStackFrameMap
protected void setStackFrameMap(SlotManager map)(Code)
Define the number of slots needed for local variables within the expression. This method is for internal use only.



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.