Java Doc for Expression.java in  » XML » xalan » org » apache » 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 » xalan » org.apache.xpath 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xpath.Expression

All known Subclasses:   org.apache.xpath.operations.Variable,  org.apache.xpath.operations.Operation,  org.apache.xpath.functions.Function,  org.apache.xpath.patterns.NodeTest,  org.apache.xpath.operations.UnaryOperation,  org.apache.xpath.patterns.UnionPattern,  org.apache.xpath.objects.XObject,
Expression
abstract public class Expression implements java.io.Serializable,ExpressionNode,XPathVisitable(Code)
This abstract class serves as the base for all expression objects. An Expression can be executed to return a org.apache.xpath.objects.XObject , normally has a location within a document or DOM, can send error and warning events, and normally do not hold state and are meant to be immutable once construction has completed. An exception to the immutibility rule is iterators and walkers, which must be cloned in order to be used -- the original must still be immutable.


Field Summary
final static  longserialVersionUID
    


Method Summary
public  DTMIteratorasIterator(XPathContext xctxt, int contextNode)
     Given an select expression and a context, evaluate the XPath and return the resulting iterator.
Parameters:
  xctxt - The execution context.
Parameters:
  contextNode - The node that "." expresses.
public  DTMIteratorasIteratorRaw(XPathContext xctxt, int contextNode)
     Given an select expression and a context, evaluate the XPath and return the resulting iterator, but do not clone.
Parameters:
  xctxt - The execution context.
Parameters:
  contextNode - The node that "." expresses.
public  intasNode(XPathContext xctxt)
     Return the first node out of the nodeset, if this expression is a nodeset expression.
Parameters:
  xctxt - The XPath runtime context.
public  voidassertion(boolean b, java.lang.String msg)
     Tell the user of an assertion error, and probably throw an exception.
public  booleanbool(XPathContext xctxt)
     Evaluate expression to a boolean.
Parameters:
  xctxt - The XPath runtime context.
public  booleancanTraverseOutsideSubtree()
     Tell if this expression or it's subexpressions can traverse outside the current subtree.
abstract public  booleandeepEquals(Expression expr)
     Compare this object with another object and see if they are equal, include the sub heararchy.
Parameters:
  expr - Another expression object.
public  voiderror(XPathContext xctxt, String msg, Object[] args)
     Tell the user of an error, and probably throw an exception.
public  XObjectexecute(XPathContext xctxt, int currentNode)
     Execute an expression in the XPath runtime context, and return the result of the expression.
Parameters:
  xctxt - The XPath runtime context.
Parameters:
  currentNode - The currentNode.
public  XObjectexecute(XPathContext xctxt, int currentNode, DTM dtm, int expType)
     Execute an expression in the XPath runtime context, and return the result of the expression.
Parameters:
  xctxt - The XPath runtime context.
Parameters:
  currentNode - The currentNode.
Parameters:
  dtm - The DTM of the current node.
Parameters:
  expType - The expanded type ID of the current node.
abstract public  XObjectexecute(XPathContext xctxt)
     Execute an expression in the XPath runtime context, and return the result of the expression.
Parameters:
  xctxt - The XPath runtime context.
public  XObjectexecute(XPathContext xctxt, boolean destructiveOK)
     Execute an expression in the XPath runtime context, and return the result of the expression, but tell that a "safe" object doesn't have to be returned.
public  voidexecuteCharsToContentHandler(XPathContext xctxt, ContentHandler handler)
     Execute an expression in the XPath runtime context, and return the result of the expression.
public  voidexprAddChild(ExpressionNode n, int i)
     This method tells the node to add its argument to the node's list of children.
public  ExpressionNodeexprGetChild(int i)
     This method returns a child node.
public  intexprGetNumChildren()
     Return the number of children the node has.
public  ExpressionNodeexprGetParent()
    
public  voidexprSetParent(ExpressionNode n)
     This pair of methods are used to inform the node of its parent.
abstract public  voidfixupVariables(java.util.Vector vars, int globalsSize)
     This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.
Parameters:
  vars - List of QNames that correspond to variables.
public  intgetColumnNumber()
     Return the character position where the current document event ends.
public  ExpressionNodegetExpressionOwner()
     Get the first non-Expression parent of this node.
public  intgetLineNumber()
     Return the line number where the current document event ends.
public  StringgetPublicId()
     Return the public identifier for the current document event.
public  StringgetSystemId()
     Return the system identifier for the current document event.
public  booleanisNodesetExpr()
     Tell if the expression is a nodeset expression.
final protected  booleanisSameClass(Expression expr)
     This is a utility method to tell if the passed in class is the same class as this.
public  booleanisStableNumber()
     Tell if this expression returns a stable number that will not change during iterations within the expression.
public  doublenum(XPathContext xctxt)
     Evaluate expression to a number.
Parameters:
  xctxt - The XPath runtime context.
public  voidwarn(XPathContext xctxt, String msg, Object[] args)
     Warn the user of an problem.
public  XMLStringxstr(XPathContext xctxt)
     Cast result object to a string.
Parameters:
  xctxt - The XPath runtime context.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)





Method Detail
asIterator
public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException(Code)
Given an select expression and a context, evaluate the XPath and return the resulting iterator.
Parameters:
  xctxt - The execution context.
Parameters:
  contextNode - The node that "." expresses. A valid DTMIterator.
throws:
  TransformerException - thrown if the active ProblemListener decidesthe error condition is severe enough to halt processing.
throws:
  javax.xml.transform.TransformerException -



asIteratorRaw
public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException(Code)
Given an select expression and a context, evaluate the XPath and return the resulting iterator, but do not clone.
Parameters:
  xctxt - The execution context.
Parameters:
  contextNode - The node that "." expresses. A valid DTMIterator.
throws:
  TransformerException - thrown if the active ProblemListener decidesthe error condition is severe enough to halt processing.
throws:
  javax.xml.transform.TransformerException -



asNode
public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)
Return the first node out of the nodeset, if this expression is a nodeset expression.
Parameters:
  xctxt - The XPath runtime context. the first node out of the nodeset, or DTM.NULL.
throws:
  javax.xml.transform.TransformerException -



assertion
public void assertion(boolean b, java.lang.String msg)(Code)
Tell the user of an assertion error, and probably throw an exception.
Parameters:
  b - If false, a runtime exception will be thrown.
Parameters:
  msg - The assertion message, which should be informative.
throws:
  RuntimeException - if the b argument is false.
throws:
  javax.xml.transform.TransformerException -



bool
public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)
Evaluate expression to a boolean.
Parameters:
  xctxt - The XPath runtime context. false
throws:
  javax.xml.transform.TransformerException -



canTraverseOutsideSubtree
public boolean canTraverseOutsideSubtree()(Code)
Tell if this expression or it's subexpressions can traverse outside the current subtree. true if traversal outside the context node's subtree can occur.



deepEquals
abstract public boolean deepEquals(Expression expr)(Code)
Compare this object with another object and see if they are equal, include the sub heararchy.
Parameters:
  expr - Another expression object. true if this objects class and the exprobject's class are the same, and the data contained within both objects are considered equal.



error
public void error(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException(Code)
Tell the user of an error, and probably throw an exception.
Parameters:
  xctxt - The XPath runtime context.
Parameters:
  msg - An error msgkey that corresponds to one of the constants foundin org.apache.xpath.res.XPATHErrorResources, which isa key for a format string.
Parameters:
  args - An array of arguments represented in the format string, whichmay be null.
throws:
  TransformerException - if the current ErrorListoner determines tothrow an exception.
throws:
  javax.xml.transform.TransformerException -



execute
public XObject execute(XPathContext xctxt, int currentNode) throws javax.xml.transform.TransformerException(Code)
Execute an expression in the XPath runtime context, and return the result of the expression.
Parameters:
  xctxt - The XPath runtime context.
Parameters:
  currentNode - The currentNode. The result of the expression in the form of a XObject.
throws:
  javax.xml.transform.TransformerException - if a runtime exceptionoccurs.



execute
public XObject execute(XPathContext xctxt, int currentNode, DTM dtm, int expType) throws javax.xml.transform.TransformerException(Code)
Execute an expression in the XPath runtime context, and return the result of the expression.
Parameters:
  xctxt - The XPath runtime context.
Parameters:
  currentNode - The currentNode.
Parameters:
  dtm - The DTM of the current node.
Parameters:
  expType - The expanded type ID of the current node. The result of the expression in the form of a XObject.
throws:
  javax.xml.transform.TransformerException - if a runtime exceptionoccurs.



execute
abstract public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)
Execute an expression in the XPath runtime context, and return the result of the expression.
Parameters:
  xctxt - The XPath runtime context. The result of the expression in the form of a XObject.
throws:
  javax.xml.transform.TransformerException - if a runtime exceptionoccurs.



execute
public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException(Code)
Execute an expression in the XPath runtime context, and return the result of the expression, but tell that a "safe" object doesn't have to be returned. The default implementation just calls execute(xctxt).
Parameters:
  xctxt - The XPath runtime context.
Parameters:
  destructiveOK - true if a "safe" object doesn't need to be returned. The result of the expression in the form of a XObject.
throws:
  javax.xml.transform.TransformerException - if a runtime exceptionoccurs.



executeCharsToContentHandler
public void executeCharsToContentHandler(XPathContext xctxt, ContentHandler handler) throws javax.xml.transform.TransformerException, org.xml.sax.SAXException(Code)
Execute an expression in the XPath runtime context, and return the result of the expression.
Parameters:
  xctxt - The XPath runtime context.NEEDSDOC @param handler The result of the expression in the form of a XObject.
throws:
  javax.xml.transform.TransformerException - if a runtime exceptionoccurs.
throws:
  org.xml.sax.SAXException -



exprAddChild
public void exprAddChild(ExpressionNode n, int i)(Code)
This method tells the node to add its argument to the node's list of children.



exprGetChild
public ExpressionNode exprGetChild(int i)(Code)
This method returns a child node. The children are numbered from zero, left to right.



exprGetNumChildren
public int exprGetNumChildren()(Code)
Return the number of children the node has.



exprGetParent
public ExpressionNode exprGetParent()(Code)



exprSetParent
public void exprSetParent(ExpressionNode n)(Code)
This pair of methods are used to inform the node of its parent.



fixupVariables
abstract public void fixupVariables(java.util.Vector vars, int globalsSize)(Code)
This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time.
Parameters:
  vars - List of QNames that correspond to variables. This listshould be searched backwards for the first qualified name thatcorresponds to the variable reference qname. The position of theQName in the vector from the start of the vector will be its positionin the stack frame (but variables above the globalsTop value will needto be offset to the current stack frame).NEEDSDOC @param globalsSize



getColumnNumber
public int getColumnNumber()(Code)
Return the character position where the current document event ends.

Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.

The return value is an approximation of the column number in the document entity or external parsed entity where the markup that triggered the event appears.

The column number, or -1 if none is available.
See Also:   Expression.getLineNumber



getExpressionOwner
public ExpressionNode getExpressionOwner()(Code)
Get the first non-Expression parent of this node. null or first ancestor that is not an Expression.



getLineNumber
public int getLineNumber()(Code)
Return the line number where the current document event ends.

Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.

The return value is an approximation of the line number in the document entity or external parsed entity where the markup that triggered the event appears.

The line number, or -1 if none is available.
See Also:   Expression.getColumnNumber



getPublicId
public String getPublicId()(Code)
Return the public identifier for the current document event.

The return value is the public identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.

A string containing the public identifier, ornull if none is available.
See Also:   Expression.getSystemId



getSystemId
public String getSystemId()(Code)
Return the system identifier for the current document event.

The return value is the system identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.

If the system identifier is a URL, the parser must resolve it fully before passing it to the application.

A string containing the system identifier, or nullif none is available.
See Also:   Expression.getPublicId



isNodesetExpr
public boolean isNodesetExpr()(Code)
Tell if the expression is a nodeset expression. In other words, tell if you can execute Expression.asNode(XPathContext) asNode without an exception. true if the expression can be represented as a nodeset.



isSameClass
final protected boolean isSameClass(Expression expr)(Code)
This is a utility method to tell if the passed in class is the same class as this. It is to be used by the deepEquals method. I'm bottlenecking it here because I'm not totally confident that comparing the class objects is the best way to do this. true of the passed in class is the exact same class as this class.



isStableNumber
public boolean isStableNumber()(Code)
Tell if this expression returns a stable number that will not change during iterations within the expression. This is used to determine if a proximity position predicate can indicate that no more searching has to occur. true if the expression represents a stable number.



num
public double num(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)
Evaluate expression to a number.
Parameters:
  xctxt - The XPath runtime context. The expression evaluated as a double.
throws:
  javax.xml.transform.TransformerException -



warn
public void warn(XPathContext xctxt, String msg, Object[] args) throws javax.xml.transform.TransformerException(Code)
Warn the user of an problem.
Parameters:
  xctxt - The XPath runtime context.
Parameters:
  msg - An error msgkey that corresponds to one of the conststants foundin org.apache.xpath.res.XPATHErrorResources, which isa key for a format string.
Parameters:
  args - An array of arguments represented in the format string, whichmay be null.
throws:
  TransformerException - if the current ErrorListoner determines tothrow an exception.
throws:
  javax.xml.transform.TransformerException -



xstr
public XMLString xstr(XPathContext xctxt) throws javax.xml.transform.TransformerException(Code)
Cast result object to a string.
Parameters:
  xctxt - The XPath runtime context. The string this wraps or the empty string if null
throws:
  javax.xml.transform.TransformerException -



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.