|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.codegen.ExpressionCompiler
public abstract class ExpressionCompiler
This abstract class represents the compiler (that is, Java code generator)
for a particular kind of expression on the expression tree. The expression compiler
is called by the CompilerService
working its way down the expression tree in a top
down fashion: there is a one-to-one correspondence between the classes implementing the
expression on the expression tree and the compiler object used to generate Java code fragments.
Various methods are supplied to compile expressions; exactly one of them is called, depending
on the context in which the expression appears.
Constructor Summary | |
---|---|
ExpressionCompiler()
|
Method Summary | |
---|---|
void |
compileAsLoop(CompilerService compiler,
Expression expression,
LoopAction action)
Compile an XPath expression in the form of a loop. |
abstract void |
compilePush(CompilerService compiler,
Expression expression)
Generate Java code to execute the expression in push mode, that is, code to write events to the current output Receiver |
String |
compileToCharSequence(CompilerService compiler,
Expression expression)
Generate Java code to evaluate the expression as a CharSequence |
abstract String |
compileToEffectiveBooleanValue(CompilerService compiler,
Expression expression,
ReturnAction options)
Generate Java code to evaluate the effective boolean value of the expression |
abstract String |
compileToItem(CompilerService compiler,
Expression expression)
Generate Java code to evaluate the expression as an Item |
abstract String |
compileToIterator(CompilerService compiler,
Expression expression)
Generate Java code to evaluate the expression as a SequenceIterator |
String |
compileToValueRepresentation(CompilerService compiler,
Expression expression)
Generate Java code to evaluate the expression as a ValueRepresentation |
Configuration |
getConfiguration()
Get the Saxon Configuration |
static ExpressionCompiler |
makeExpressionCompiler(Expression exp,
Configuration config)
Make an expression compiler for a particular expression. |
void |
setConfiguration(Configuration config)
Set the Saxon Configuration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionCompiler()
Method Detail |
---|
public void setConfiguration(Configuration config)
public Configuration getConfiguration()
public abstract void compilePush(CompilerService compiler, Expression expression)
compiler
- the compiler serviceexpression
- the expression to be compiledpublic abstract String compileToItem(CompilerService compiler, Expression expression)
compiler
- the compiler serviceexpression
- the expression to be compiled
Item
,
and which will hold the value of the expression at run-time (or hold null,
representing an empty sequence).public abstract String compileToIterator(CompilerService compiler, Expression expression)
compiler
- the compiler serviceexpression
- the XPath expression to be compiled
SequenceIterator
,
and which at run-time will hold an iterator over the the value of the XPath expressionpublic abstract String compileToEffectiveBooleanValue(CompilerService compiler, Expression expression, ReturnAction options)
compiler
- the compiler serviceexpression
- the XPath expression to be compiledoptions
- indicates how the boolean result is to be returned
public String compileToCharSequence(CompilerService compiler, Expression expression)
compiler
- the compiler serviceexpression
- the XPath expression to be compiled
CharSequence
,
and which will hold the string value of the XPath expression at run-timepublic String compileToValueRepresentation(CompilerService compiler, Expression expression)
compiler
- the compiler serviceexpression
- the expression to be compiled
ValueRepresentation
,
and which at run-time will hold the value of the expressionpublic void compileAsLoop(CompilerService compiler, Expression expression, LoopAction action)
compiler
- the CompilerServiceexpression
- the XPath expression to be compiledaction
- the action to be taken to compile code that processes each item in the
sequence returned by the XPath expressionpublic static ExpressionCompiler makeExpressionCompiler(Expression exp, Configuration config)
This would normally be a method on the class Expression; the only reason it isn't is because this code is specific to commercial editions of Saxon.
exp
- the expression to be compiledconfig
- the Saxon Configuration
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |