Java Doc for ExpressionTool.java in  » XML » saxonb » net » sf » saxon » expr » 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 » saxonb » net.sf.saxon.expr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.saxon.expr.ExpressionTool

ExpressionTool
public class ExpressionTool (Code)
This class, ExpressionTool, contains a number of useful static methods for manipulating expressions. Most importantly, it provides the factory method make() for constructing a new expression




Method Summary
public static  intallocateSlots(Expression exp, int nextFree, SlotManager frame)
     Allocate slot numbers to range variables
Parameters:
  exp - the expression whose range variables need to have slot numbers assigned
Parameters:
  nextFree - the next slot number that is available for allocation
Parameters:
  frame - a SlotManager object that is used to track the mapping of slot numbersto variable names for debugging purposes.
public static  booleancallsFunction(Expression exp, int fp)
    
public static  voidcopyLocationInfo(Expression from, Expression to)
    
public static  booleandependsOnVariable(Expression e, Binding[] bindingList)
    
public static  ValueeagerEvaluate(Expression exp, XPathContext context)
    
public static  voidebvError(String reason)
    
public static  booleaneffectiveBooleanValue(SequenceIterator iterator)
    
public static  voidgatherCalledFunctions(Expression e, List list)
     Gather a list of all the user-defined functions which a given expression calls directly
Parameters:
  e - the expression being tested
Parameters:
  list - a list of the functions that are called.
public static  voidgatherReferencedVariables(Expression e, List list)
     Gather a list of all the variable bindings on which a given expression depends
Parameters:
  e - the expression being tested
Parameters:
  list - a list to which the bindings are to be added.
public static  SourceLocatorgetLocator(Expression exp)
    
public static  Stringindent(int level)
    
public static  booleanisRepeatedSubexpression(Expression parent, Expression child, StaticContext env)
     Determine whether an expression is a repeatedly-evaluated subexpression of a parent expression.
public static  booleanisVariableReplaceableByDot(Expression exp, Binding[] binding)
     Determine whether it is possible to rearrange an expression so that all references to a given variable are replaced by a reference to ".".
public static  ValueRepresentationlazyEvaluate(Expression exp, XPathContext context, int ref)
     Do lazy evaluation of an expression.
public static  Expressionmake(String expression, StaticContext env, int start, int terminator, int lineNumber)
     Parse an expression.
public static  voidmakeParentReferences(Expression top)
     Establish the links from subexpressions to their parent expressions, by means of a recursive tree walk.
public static  booleanmarkTailFunctionCalls(Expression exp)
    
public static  ExpressionresolveCallsToCurrentFunction(Expression exp, Configuration config)
    
public static  Expressionunsorted(Optimizer opt, Expression exp, boolean eliminateDuplicates)
    
public static  ExpressionunsortedIfHomogeneous(Optimizer opt, Expression exp, boolean eliminateDuplicates)
     Remove unwanted sorting from an expression, at compile time, if and only if it is known that the result of the expression will be homogeneous (all nodes, or all atomic values).



Method Detail
allocateSlots
public static int allocateSlots(Expression exp, int nextFree, SlotManager frame)(Code)
Allocate slot numbers to range variables
Parameters:
  exp - the expression whose range variables need to have slot numbers assigned
Parameters:
  nextFree - the next slot number that is available for allocation
Parameters:
  frame - a SlotManager object that is used to track the mapping of slot numbersto variable names for debugging purposes. May be null. the next unallocated slot number.



callsFunction
public static boolean callsFunction(Expression exp, int fp)(Code)
Determine whether an expression contains a call on the function with a given fingerprint
Parameters:
  exp - The expression being tested
Parameters:
  fp - The fingerprint of the name of the function true if the expression contains a call on the function



copyLocationInfo
public static void copyLocationInfo(Expression from, Expression to)(Code)
Copy location information (currently the line number and parent) from one expression to another



dependsOnVariable
public static boolean dependsOnVariable(Expression e, Binding[] bindingList)(Code)
Determine whether an expression depends on any one of a set of variables
Parameters:
  e - the expression being tested
Parameters:
  bindingList - the set of variables being tested true if the expression depends on one of the given variables



eagerEvaluate
public static Value eagerEvaluate(Expression exp, XPathContext context) throws XPathException(Code)
Evaluate an expression now; lazy evaluation is not permitted in this case
Parameters:
  exp - the expression to be evaluated
Parameters:
  context - the run-time evaluation context
exception:
  net.sf.saxon.trans.XPathException - if any dynamic error occurs evaluating theexpression the result of evaluating the expression



ebvError
public static void ebvError(String reason) throws XPathException(Code)



effectiveBooleanValue
public static boolean effectiveBooleanValue(SequenceIterator iterator) throws XPathException(Code)
Determine the effective boolean value of a sequence, given an iterator over the sequence
Parameters:
  iterator - An iterator over the sequence whose effective boolean value is required the effective boolean value
throws:
  XPathException - if a dynamic error occurs



gatherCalledFunctions
public static void gatherCalledFunctions(Expression e, List list)(Code)
Gather a list of all the user-defined functions which a given expression calls directly
Parameters:
  e - the expression being tested
Parameters:
  list - a list of the functions that are called. The items in this list mustbe objects of class UserFunction



gatherReferencedVariables
public static void gatherReferencedVariables(Expression e, List list)(Code)
Gather a list of all the variable bindings on which a given expression depends
Parameters:
  e - the expression being tested
Parameters:
  list - a list to which the bindings are to be added. The items in this list mustimplement Binding



getLocator
public static SourceLocator getLocator(Expression exp)(Code)
Get location information for an expression in the form of a SourceLocator



indent
public static String indent(int level)(Code)
Construct indent string, for diagnostic output
Parameters:
  level - the indentation level (the number of spaces to return) a string of "level*2" spaces



isRepeatedSubexpression
public static boolean isRepeatedSubexpression(Expression parent, Expression child, StaticContext env)(Code)
Determine whether an expression is a repeatedly-evaluated subexpression of a parent expression. For example, the predicate in a filter expression is a repeatedly-evaluated subexpression of the filter expression.



isVariableReplaceableByDot
public static boolean isVariableReplaceableByDot(Expression exp, Binding[] binding)(Code)
Determine whether it is possible to rearrange an expression so that all references to a given variable are replaced by a reference to ".". This is true of there are no references to the variable within a filter predicate or on the rhs of a "/" operator.



lazyEvaluate
public static ValueRepresentation lazyEvaluate(Expression exp, XPathContext context, int ref) throws XPathException(Code)
Do lazy evaluation of an expression. This will return a value, which may optionally be a SequenceIntent, which is a wrapper around an iterator over the value of the expression.
Parameters:
  context - the run-time evaluation context for the expression. Ifthe expression is not evaluated immediately, then parts of thecontext on which the expression depends need to be saved as part ofthe Closure
Parameters:
  ref - an indication of how the value will be used. The value 1 indicates that the valueis only expected to be used once, so that there is no need to keep it in memory. A small value >1indicates multiple references, so the value will be saved when first evaluated. The special valueFILTERED indicates a reference within a loop of the form $x[predicate], indicating that the valueshould be saved in a way that permits indexing.
exception:
  XPathException - if any error occurs in evaluating theexpression a value: either the actual value obtained by evaluating theexpression, or a Closure containing all the information needed toevaluate it later



make
public static Expression make(String expression, StaticContext env, int start, int terminator, int lineNumber) throws XPathException(Code)
Parse an expression. This performs the basic analysis of the expression against the grammar, it binds variable references and function calls to variable definitions and function definitions, and it performs context-independent expression rewriting for optimization purposes.
exception:
  net.sf.saxon.trans.XPathException - if the expression contains a static error
Parameters:
  expression - The expression (as a character string)
Parameters:
  env - An object giving information about the compile-timecontext of the expression
Parameters:
  terminator - The token that marks the end of this expression; typicallyTokenizer.EOF, but may for example be a right curly brace
Parameters:
  lineNumber - the line number of the start of the expression an object of type Expression



makeParentReferences
public static void makeParentReferences(Expression top)(Code)
Establish the links from subexpressions to their parent expressions, by means of a recursive tree walk.



markTailFunctionCalls
public static boolean markTailFunctionCalls(Expression exp)(Code)



resolveCallsToCurrentFunction
public static Expression resolveCallsToCurrentFunction(Expression exp, Configuration config) throws XPathException(Code)
Resolve calls to the current() function within an expression



unsorted
public static Expression unsorted(Optimizer opt, Expression exp, boolean eliminateDuplicates) throws XPathException(Code)
Remove unwanted sorting from an expression, at compile time



unsortedIfHomogeneous
public static Expression unsortedIfHomogeneous(Optimizer opt, Expression exp, boolean eliminateDuplicates) throws XPathException(Code)
Remove unwanted sorting from an expression, at compile time, if and only if it is known that the result of the expression will be homogeneous (all nodes, or all atomic values). This is done when we need the effective boolean value of a sequence: the EBV of a homogenous sequence does not depend on its order, but this is not true when atomic values and nodes are mixed: (N, AV) is true, but (AV, N) is an error.



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.