public class CompiledExpression extends Expression
GeneratedCode, to which evaluation is delegatedEFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, INHERITED_CONTEXT, INSPECTION_CONTEXT, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, NAVIGATION_CONTEXT, NODE_VALUE_CONTEXT, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, W3C_CONSUMING, W3C_FREE_RANGING, W3C_GROUP_CONSUMING, W3C_MOTIONLESS, WATCH_METHOD| Constructor and Description |
|---|
CompiledExpression(Expression original,
GeneratedCode byteCode) |
| Modifier and Type | Method and Description |
|---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
void |
checkForUpdatingSubexpressions()
Check to ensure that this expression does not contain any inappropriate updating subexpressions.
|
void |
checkPermittedContents(SchemaType parentType,
StaticContext env,
boolean whole)
Check that any elements and attributes constructed or returned by this expression are acceptable
in the content model of a given complex type.
|
protected int |
computeCardinality()
Compute the static cardinality of this expression
|
int |
computeDependencies()
Compute the dependencies of an expression, as the union of the
dependencies of its subexpressions.
|
protected int |
computeSpecialProperties()
Compute the special properties of this expression.
|
Expression |
copy()
Copy an expression.
|
void |
evaluatePendingUpdates(XPathContext context,
PendingUpdateList pul)
Evaluate an updating expression, adding the results to a Pending Update List.
|
void |
explain(ExpressionPresenter out)
Diagnostic print of expression structure.
|
int |
getCardinality()
Determine the static cardinality of the expression.
|
int |
getConstructType()
Get the type of this expression for use in tracing and diagnostics
|
int |
getDependencies()
Determine which aspects of the context the expression depends on.
|
String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
int |
getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
int |
getIntrinsicDependencies()
Determine the intrinsic dependencies of an expression, that is, those which are not derived
from the dependencies of its subexpressions.
|
ItemType |
getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible.
|
StructuredQName |
getObjectName()
Get a name identifying the object of the expression, for example a function name, template name,
variable name, key name, element name, etc.
|
Iterator |
getProperties()
Get an iterator over all the properties available.
|
Object |
getProperty(String name)
Get the value of a particular property of the instruction.
|
boolean |
isSubtreeExpression()
Determine whether the expression can be evaluated without reference to the part of the context
document outside the subtree rooted at the context node.
|
boolean |
isUpdatingExpression()
Determine whether this is an updating expression as defined in the XQuery update specification
|
boolean |
isVacuousExpression()
Determine whether this is a vacuous expression as defined in the XQuery update specification
|
SequenceIterator |
iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence.
|
Iterator<Expression> |
iterateSubExpressions()
Get the immediate sub-expressions of this expression.
|
void |
process(XPathContext context)
Process the instruction, without returning any tail calls
|
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression
|
String |
toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form.
|
adoptChildExpression, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, getColumnNumber, getColumnNumber, getContainer, getEvaluationMethod, getExecutable, getExpressionCompiler, getIntegerBounds, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getPublicId, getSlotsUsed, getSpecialProperties, getStreamability, getStreamingAdjunct, getSystemId, getSystemId, hasVariableBinding, implementsStaticTypeCheck, iterateEvents, iterateSubExpressionInfo, markTailFunctionCalls, optimize, promote, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, toPattern, toStreamingPattern, typeCheck, typeErrorpublic CompiledExpression(Expression original, GeneratedCode byteCode)
public String getExpressionName()
ExpressiongetExpressionName in class Expressionpublic int getImplementationMethod()
ExpressiongetImplementationMethod in class ExpressionExpression.ITERATE_METHOD or Expression.EVALUATE_METHOD or
Expression.PROCESS_METHODpublic int getCardinality()
ExpressiongetCardinality in class Expressionpublic ItemType getItemType(TypeHierarchy th)
ExpressionThis method should always return a result, though it may be the best approximation that is available at the time.
getItemType in class Expressionth - the type hierarchy cachepublic int getDependencies()
ExpressiongetDependencies in class Expressionpublic void process(XPathContext context) throws XPathException
Expressionprocess in class Expressioncontext - The dynamic context, giving access to the current node,
the current variables, etc.XPathException - if a dynamic error occurspublic void evaluatePendingUpdates(XPathContext context, PendingUpdateList pul) throws XPathException
ExpressionevaluatePendingUpdates in class Expressioncontext - the XPath dynamic evaluation contextpul - the pending update list to which the results should be writtenXPathException - if evaluation failspublic String toString()
ExpressionThe toString() method for an expression attempts to give a representation of the expression in an XPath-like form.
For subclasses of Expression that represent XPath expressions, the result should always be a string that parses as an XPath 3.0 expression. The expression produced should be equivalent to the original making certain assumptions about the static context. In general the expansion will make no assumptions about namespace bindings, except that (a) the prefix "xs" is used to refer to the XML Schema namespace, and (b) the default funcion namespace is assumed to be the "fn" namespace.
In the case of XSLT instructions and XQuery expressions, the toString() method gives an abstracted view of the syntax that is not designed in general to be parseable.
toString in class Expressionpublic void explain(ExpressionPresenter out)
Expressionexplain in class Expressionout - the expression presenter used to display the structurepublic void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException
ExpressioncheckPermittedContents in class ExpressionparentType - the "given complex type": the method is checking that the nodes returned by this
expression are acceptable members of the content model of this typeenv - the static contextwhole - if true, we want to check that the value of this expression satisfies the content model
as a whole; if false we want to check that the value of the expression is acceptable as one part
of the contentXPathException - if the value delivered by this expression cannot be part of the content model
of the given typeprotected int computeCardinality()
ExpressioncomputeCardinality in class ExpressionStaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREprotected int computeSpecialProperties()
ExpressionStaticProperty. The "special" properties are properties
other than cardinality and dependencies, and most of them relate to properties of node sequences, for
example whether the nodes are in document order.computeSpecialProperties in class Expressionpublic int computeDependencies()
ExpressioncomputeDependencies in class Expressionpublic int getIntrinsicDependencies()
ExpressiongetIntrinsicDependencies in class Expressionpublic void checkForUpdatingSubexpressions()
throws XPathException
ExpressioncheckForUpdatingSubexpressions in class ExpressionXPathException - if the expression has a non-permitted updating subexpressionpublic boolean isUpdatingExpression()
ExpressionisUpdatingExpression in class Expressionpublic boolean isVacuousExpression()
ExpressionisVacuousExpression in class Expressionpublic Expression copy()
Expressioncopy in class Expressionpublic boolean replaceSubExpression(Expression original, Expression replacement)
ExpressionreplaceSubExpression in class Expressionoriginal - the original subexpressionreplacement - the replacement subexpressionpublic int getConstructType()
ExpressiongetConstructType in interface InstructionInfogetConstructType in class ExpressionLocationpublic StructuredQName getObjectName()
InstructionInfogetObjectName in interface InstructionInfogetObjectName in class Expressionpublic Object getProperty(String name)
InstructionInfogetProperty in interface InstructionInfogetProperty in class Expressionname - The name of the required propertypublic Iterator getProperties()
ExpressiongetProperties in interface InstructionInfogetProperties in class Expressionpublic int getHostLanguage()
ExpressiongetHostLanguage in class ExpressionConfiguration.XSLT or Configuration.XQUERYpublic PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
ExpressionThe default implementation of this method assumes that an expression does no navigation other than the navigation done by evaluating its subexpressions, and that the subexpressions are evaluated in the same context as the containing expression. The method must be overridden for any expression where these assumptions do not hold. For example, implementations exist for AxisExpression, ParentExpression, and RootExpression (because they perform navigation), and for the doc(), document(), and collection() functions because they create a new navigation root. Implementations also exist for PathExpression and FilterExpression because they have subexpressions that are evaluated in a different context from the calling expression.
addToPathMap in class ExpressionpathMap - the PathMap to which the expression should be addedpathMapNodeSet - the PathMapNodeSet to which the paths embodied in this expression should be addedpublic boolean isSubtreeExpression()
ExpressionisSubtreeExpression in class Expressionpublic SequenceIterator iterate(XPathContext context) throws XPathException
Expressioniterate in class Expressioncontext - supplies the context for evaluationXPathException - if any dynamic error occurs evaluating the
expressionpublic Iterator<Expression> iterateSubExpressions()
ExpressioniterateSubExpressions in class ExpressionCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.