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


java.lang.Object
   org.apache.xpath.compiler.OpMap
      org.apache.xpath.compiler.Compiler

Compiler
public class Compiler extends OpMap (Code)
An instance of this class compiles an XPath string expression into a Expression object. This class compiles the string into a sequence of operation codes (op map) and then builds from that into an Expression tree.


Field Summary
 ErrorListenerm_errorHandler
     The error listener where errors will be sent.
 SourceLocatorm_locator
     The source locator for the expression being compiled.

Constructor Summary
public  Compiler(ErrorListener errorHandler, SourceLocator locator, FunctionTable fTable)
     Construct a Compiler object with a specific ErrorListener and SourceLocator where the expression is located.
public  Compiler()
     Construct a Compiler instance that has a null error listener and a null source locator.

Method Summary
protected  Expressionand(int opPos)
     Compile an 'and' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionarg(int opPos)
     Compile a function argument.
Parameters:
  opPos - The current position in the m_opMap array.
public  voidassertion(boolean b, java.lang.String msg)
     Tell the user of an assertion error, and probably throw an exception.
protected  Expressionbool(int opPos)
     Compile a 'boolean(...)' operation.
Parameters:
  opPos - The current position in the m_opMap array.
public  Expressioncompile(int opPos)
     Execute the XPath object from a given opcode position.
Parameters:
  opPos - The current position in the xpath.m_opMap array.
 ExpressioncompileFunction(int opPos)
     Compile a built-in XPath function.
Parameters:
  opPos - The current position in the m_opMap array.
public  intcountPredicates(int opPos)
     Count the number of predicates in the step.
Parameters:
  opPos - The position of the first predicate the m_opMap array.
protected  Expressiondiv(int opPos)
     Compile a 'div' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionequals(int opPos)
     Compile a '=' operation.
Parameters:
  opPos - The current position in the m_opMap array.
public  voiderror(String msg, Object[] args)
     Tell the user of an error, and probably throw an exception.
public  Expression[]getCompiledPredicates(int opPos)
     Compile a zero or more predicates for a given match pattern.
Parameters:
  opPos - The position of the first predicate the m_opMap array.
 FunctionTablegetFunctionTable()
    
public  intgetLocationPathDepth()
     Get the level of the location path or union being constructed.
public  PrefixResolvergetNamespaceContext()
     Get the current namespace context for the xpath.
public  intgetWhatToShow(int opPos)
     Get a org.w3c.dom.traversal.NodeFilter bit set that tells what to show for a given node test.
Parameters:
  opPos - the op map position for the location step.
protected  Expressiongroup(int opPos)
     Compile an expression group.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressiongt(int opPos)
     Compile a '>' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressiongte(int opPos)
     Compile a '>=' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionliteral(int opPos)
     Compile a literal string value.
Parameters:
  opPos - The current position in the m_opMap array.
public  ExpressionlocationPath(int opPos)
     Compile a location path.
public  ExpressionlocationPathPattern(int opPos)
     Compile a location match pattern unit expression.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionlt(int opPos)
     Compile a '<' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionlte(int opPos)
     Compile a '<=' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  ExpressionmatchPattern(int opPos)
     Compile an entire match pattern expression.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionminus(int opPos)
     Compile a '-' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionmod(int opPos)
     Compile a 'mod' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionmult(int opPos)
     Compile a '*' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionneg(int opPos)
     Compile a unary '-' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionnotequals(int opPos)
     Compile a '!=' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionnumber(int opPos)
     Compile a 'number(...)' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionnumberlit(int opPos)
     Compile a literal number value.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionor(int opPos)
     Compile an 'or' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionplus(int opPos)
     Compile a '+' operation.
Parameters:
  opPos - The current position in the m_opMap array.
public  Expressionpredicate(int opPos)
     Compile a location step predicate expression.
Parameters:
  opPos - The current position in the m_opMap array.
public  voidsetNamespaceContext(PrefixResolver pr)
     Set the current namespace context for the xpath.
protected  StepPatternstepPattern(int opPos, int stepCount, StepPattern ancestorPattern)
     Compile a step pattern unit expression, used for both location paths and match patterns.
Parameters:
  opPos - The current position in the m_opMap array.
Parameters:
  stepCount - The number of steps to expect.
Parameters:
  ancestorPattern - The owning StepPattern, which may be null.
protected  Expressionstring(int opPos)
     Compile a 'string(...)' operation.
Parameters:
  opPos - The current position in the m_opMap array.
protected  Expressionunion(int opPos)
     Compile a location path union.
protected  Expressionvariable(int opPos)
     Compile a variable reference.
Parameters:
  opPos - The current position in the m_opMap array.
public  voidwarn(String msg, Object[] args)
     Warn the user of an problem.

Field Detail
m_errorHandler
ErrorListener m_errorHandler(Code)
The error listener where errors will be sent. If this is null, errors and warnings will be sent to System.err. May be null.



m_locator
SourceLocator m_locator(Code)
The source locator for the expression being compiled. May be null.




Constructor Detail
Compiler
public Compiler(ErrorListener errorHandler, SourceLocator locator, FunctionTable fTable)(Code)
Construct a Compiler object with a specific ErrorListener and SourceLocator where the expression is located.
Parameters:
  errorHandler - Error listener where messages will be sent, or null if messages should be sent to System err.
Parameters:
  locator - The location object where the expression lives, which may be null, but which, if not null, must be valid over the long haul, in other words, it will not be cloned.
Parameters:
  fTable - The FunctionTable object where the xpath build-in functions are stored.



Compiler
public Compiler()(Code)
Construct a Compiler instance that has a null error listener and a null source locator.




Method Detail
and
protected Expression and(int opPos) throws TransformerException(Code)
Compile an 'and' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.And instance.
throws:
  TransformerException - if a error occurs creating the Expression.



arg
protected Expression arg(int opPos) throws TransformerException(Code)
Compile a function argument.
Parameters:
  opPos - The current position in the m_opMap array. reference to the argument expression.
throws:
  TransformerException - if a error occurs creating the Expression.



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.



bool
protected Expression bool(int opPos) throws TransformerException(Code)
Compile a 'boolean(...)' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Bool instance.
throws:
  TransformerException - if a error occurs creating the Expression.



compile
public Expression compile(int opPos) throws TransformerException(Code)
Execute the XPath object from a given opcode position.
Parameters:
  opPos - The current position in the xpath.m_opMap array. The result of the XPath.
throws:
  TransformerException - if there is a syntax or other error.



compileFunction
Expression compileFunction(int opPos) throws TransformerException(Code)
Compile a built-in XPath function.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.functions.Function instance.
throws:
  TransformerException - if a error occurs creating the Expression.



countPredicates
public int countPredicates(int opPos) throws TransformerException(Code)
Count the number of predicates in the step.
Parameters:
  opPos - The position of the first predicate the m_opMap array. The number of predicates for this step.
throws:
  TransformerException - if a error occurs creating the Expression.



div
protected Expression div(int opPos) throws TransformerException(Code)
Compile a 'div' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Div instance.
throws:
  TransformerException - if a error occurs creating the Expression.



equals
protected Expression equals(int opPos) throws TransformerException(Code)
Compile a '=' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Equals instance.
throws:
  TransformerException - if a error occurs creating the Expression.



error
public void error(String msg, Object[] args) throws TransformerException(Code)
Tell the user of an error, and probably throw an exception.
Parameters:
  msg - An error msgkey that corresponds to one of the constants found in org.apache.xpath.res.XPATHErrorResources, which is a key for a format string.
Parameters:
  args - An array of arguments represented in the format string, which may be null.
throws:
  TransformerException - if the current ErrorListoner determines to throw an exception.



getCompiledPredicates
public Expression[] getCompiledPredicates(int opPos) throws TransformerException(Code)
Compile a zero or more predicates for a given match pattern.
Parameters:
  opPos - The position of the first predicate the m_opMap array. reference to array of org.apache.xpath.Expression instances.
throws:
  TransformerException - if a error occurs creating the Expression.



getFunctionTable
FunctionTable getFunctionTable()(Code)
Get the function table



getLocationPathDepth
public int getLocationPathDepth()(Code)
Get the level of the location path or union being constructed. 0 if it is a top-level path.



getNamespaceContext
public PrefixResolver getNamespaceContext()(Code)
Get the current namespace context for the xpath. The current prefix resolver, *may* be null, though hopefully not.



getWhatToShow
public int getWhatToShow(int opPos)(Code)
Get a org.w3c.dom.traversal.NodeFilter bit set that tells what to show for a given node test.
Parameters:
  opPos - the op map position for the location step. org.w3c.dom.traversal.NodeFilter bit set that tells what to show for a given node test.



group
protected Expression group(int opPos) throws TransformerException(Code)
Compile an expression group.
Parameters:
  opPos - The current position in the m_opMap array. reference to the contained expression.
throws:
  TransformerException - if a error occurs creating the Expression.



gt
protected Expression gt(int opPos) throws TransformerException(Code)
Compile a '>' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Gt instance.
throws:
  TransformerException - if a error occurs creating the Expression.



gte
protected Expression gte(int opPos) throws TransformerException(Code)
Compile a '>=' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Gte instance.
throws:
  TransformerException - if a error occurs creating the Expression.



literal
protected Expression literal(int opPos)(Code)
Compile a literal string value.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.objects.XString instance.
throws:
  TransformerException - if a error occurs creating the Expression.



locationPath
public Expression locationPath(int opPos) throws TransformerException(Code)
Compile a location path. The LocPathIterator itself may create org.apache.xpath.axes.AxesWalker children.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.axes.LocPathIterator instance.
throws:
  TransformerException - if a error occurs creating the Expression.



locationPathPattern
public Expression locationPathPattern(int opPos) throws TransformerException(Code)
Compile a location match pattern unit expression.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.patterns.StepPattern instance.
throws:
  TransformerException - if a error occurs creating the Expression.



lt
protected Expression lt(int opPos) throws TransformerException(Code)
Compile a '<' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Lt instance.
throws:
  TransformerException - if a error occurs creating the Expression.



lte
protected Expression lte(int opPos) throws TransformerException(Code)
Compile a '<=' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Lte instance.
throws:
  TransformerException - if a error occurs creating the Expression.



matchPattern
protected Expression matchPattern(int opPos) throws TransformerException(Code)
Compile an entire match pattern expression.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.patterns.UnionPattern instance.
throws:
  TransformerException - if a error occurs creating the Expression.



minus
protected Expression minus(int opPos) throws TransformerException(Code)
Compile a '-' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Minus instance.
throws:
  TransformerException - if a error occurs creating the Expression.



mod
protected Expression mod(int opPos) throws TransformerException(Code)
Compile a 'mod' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Mod instance.
throws:
  TransformerException - if a error occurs creating the Expression.



mult
protected Expression mult(int opPos) throws TransformerException(Code)
Compile a '*' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Mult instance.
throws:
  TransformerException - if a error occurs creating the Expression.



neg
protected Expression neg(int opPos) throws TransformerException(Code)
Compile a unary '-' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Neg instance.
throws:
  TransformerException - if a error occurs creating the Expression.



notequals
protected Expression notequals(int opPos) throws TransformerException(Code)
Compile a '!=' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.NotEquals instance.
throws:
  TransformerException - if a error occurs creating the Expression.



number
protected Expression number(int opPos) throws TransformerException(Code)
Compile a 'number(...)' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Number instance.
throws:
  TransformerException - if a error occurs creating the Expression.



numberlit
protected Expression numberlit(int opPos)(Code)
Compile a literal number value.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.objects.XNumber instance.
throws:
  TransformerException - if a error occurs creating the Expression.



or
protected Expression or(int opPos) throws TransformerException(Code)
Compile an 'or' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Or instance.
throws:
  TransformerException - if a error occurs creating the Expression.



plus
protected Expression plus(int opPos) throws TransformerException(Code)
Compile a '+' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Plus instance.
throws:
  TransformerException - if a error occurs creating the Expression.



predicate
public Expression predicate(int opPos) throws TransformerException(Code)
Compile a location step predicate expression.
Parameters:
  opPos - The current position in the m_opMap array. the contained predicate expression.
throws:
  TransformerException - if a error occurs creating the Expression.



setNamespaceContext
public void setNamespaceContext(PrefixResolver pr)(Code)
Set the current namespace context for the xpath.
Parameters:
  pr - The resolver for prefixes in the XPath expression.



stepPattern
protected StepPattern stepPattern(int opPos, int stepCount, StepPattern ancestorPattern) throws TransformerException(Code)
Compile a step pattern unit expression, used for both location paths and match patterns.
Parameters:
  opPos - The current position in the m_opMap array.
Parameters:
  stepCount - The number of steps to expect.
Parameters:
  ancestorPattern - The owning StepPattern, which may be null. reference to org.apache.xpath.patterns.StepPattern instance.
throws:
  TransformerException - if a error occurs creating the Expression.



string
protected Expression string(int opPos) throws TransformerException(Code)
Compile a 'string(...)' operation.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.String instance.
throws:
  TransformerException - if a error occurs creating the Expression.



union
protected Expression union(int opPos) throws TransformerException(Code)
Compile a location path union. The UnionPathIterator itself may create org.apache.xpath.axes.LocPathIterator children.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.axes.LocPathIterator instance.
throws:
  TransformerException - if a error occurs creating the Expression.



variable
protected Expression variable(int opPos) throws TransformerException(Code)
Compile a variable reference.
Parameters:
  opPos - The current position in the m_opMap array. reference to org.apache.xpath.operations.Variable instance.
throws:
  TransformerException - if a error occurs creating the Expression.



warn
public void warn(String msg, Object[] args) throws TransformerException(Code)
Warn the user of an problem.
Parameters:
  msg - An error msgkey that corresponds to one of the constants found in org.apache.xpath.res.XPATHErrorResources, which is a key for a format string.
Parameters:
  args - An array of arguments represented in the format string, which may be null.
throws:
  TransformerException - if the current ErrorListoner determines to throw an exception.



Fields inherited from org.apache.xpath.compiler.OpMap
final static int BLOCKTOKENQUEUESIZE(Code)(Java Doc)
final public static int MAPINDEX_LENGTH(Code)(Java Doc)
final static int MAXTOKENQUEUESIZE(Code)(Java Doc)
protected String m_currentPattern(Code)(Java Doc)
OpMapVector m_opMap(Code)(Java Doc)
ObjectVector m_tokenQueue(Code)(Java Doc)

Methods inherited from org.apache.xpath.compiler.OpMap
public void error(String msg, Object[] args) throws javax.xml.transform.TransformerException(Code)(Java Doc)
public int getArgLength(int opPos)(Code)(Java Doc)
public int getArgLengthOfStep(int opPos)(Code)(Java Doc)
public static int getFirstChildPos(int opPos)(Code)(Java Doc)
public static int getFirstChildPosOfStep(int opPos)(Code)(Java Doc)
public int getFirstPredicateOpPos(int opPos) throws javax.xml.transform.TransformerException(Code)(Java Doc)
public int getNextOpPos(int opPos)(Code)(Java Doc)
public static int getNextOpPos(int[] opMap, int opPos)(Code)(Java Doc)
public int getNextStepPos(int opPos)(Code)(Java Doc)
public int getOp(int opPos)(Code)(Java Doc)
public OpMapVector getOpMap()(Code)(Java Doc)
public String getPatternString()(Code)(Java Doc)
public String getStepLocalName(int opPosOfStep)(Code)(Java Doc)
public String getStepNS(int opPosOfStep)(Code)(Java Doc)
public int getStepTestType(int opPosOfStep)(Code)(Java Doc)
public Object getToken(int pos)(Code)(Java Doc)
public ObjectVector getTokenQueue()(Code)(Java Doc)
public int getTokenQueueSize()(Code)(Java Doc)
public void setOp(int opPos, int value)(Code)(Java Doc)
void shrink()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.