public class CompiledExpression extends Expression
GeneratedCode, to which evaluation is delegatedEFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, 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,
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.
|
int |
computeHashCode()
Hashcode supporting equals()
|
protected int |
computeSpecialProperties()
Compute the special properties of this expression.
|
Expression |
copy(RebindingMap rebindings)
Copy an expression.
|
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression.
|
boolean |
equals(java.lang.Object other)
Is this expression the same as another expression?
|
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
void |
evaluatePendingUpdates(XPathContext context,
PendingUpdateList pul)
Evaluate an updating expression, adding the results to a Pending Update List.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
int |
getCardinality()
Determine the static cardinality of the expression.
|
java.lang.String |
getClassName() |
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.
|
java.lang.String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
GeneratedCode |
getGeneratedCode() |
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
Expression |
getInterpretedExpression()
Get the original (uncompiled) expression of which this is the compiled form
|
int |
getIntrinsicDependencies()
Determine the intrinsic dependencies of an expression, that is, those which are not derived
from the dependencies of its subexpressions.
|
ItemType |
getItemType()
Determine the static item type of the expression, as precisely possible.
|
StructuredQName |
getObjectName() |
java.util.Iterator |
getProperties()
Get an iterator over all the properties available.
|
java.lang.Object |
getProperty(java.lang.String name) |
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.
|
void |
process(XPathContext context)
Process the instruction, without returning any tail calls
|
void |
setClassName(java.lang.String cname) |
java.lang.String |
toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form.
|
adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, computeStaticProperties, dynamicError, evaluateAsString, explain, getConfiguration, getCost, getEvaluationMethod, getExtraProperty, getIntegerBounds, getLocalRetainedStaticContext, getLocation, getNetCost, getPackageData, getParentExpression, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isInstruction, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, markTailFunctionCalls, operandList, operands, operandSparseList, optimize, optimizeChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, typeCheck, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointerspublic CompiledExpression(Expression original, GeneratedCode byteCode)
public Expression getInterpretedExpression()
getInterpretedExpression in class Expressionpublic GeneratedCode getGeneratedCode()
public void setClassName(java.lang.String cname)
public java.lang.String getClassName()
public java.lang.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()
ExpressionThis method should always return a result, though it may be the best approximation that is available at the time.
getItemType in class Expressionpublic 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 java.lang.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 function 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 export(ExpressionPresenter out) throws XPathException
Expressionexport in interface ExportAgentexport in class Expressionout - the expression presenter used to display the structureXPathException - if the export fails, for example if an expression is found that won't work
in the target environment.public void checkPermittedContents(SchemaType parentType, 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 typewhole - 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(RebindingMap rebindings)
Expressioncopy in class Expressionrebindings - a mutable list of (old binding, new binding) pairs
that is used to update the bindings held in any
local variable references that are copied.public int getConstructType()
ExpressiongetConstructType in class ExpressionLocationKindpublic StructuredQName getObjectName()
getObjectName in class Expressionpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the expression to be compared with this onepublic int computeHashCode()
computeHashCode in class Expressionpublic java.lang.Object getProperty(java.lang.String name)
getProperty in class Expressionpublic java.util.Iterator getProperties()
ExpressiongetProperties in class Expressionpublic 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 Item evaluateItem(XPathContext context) throws XPathException
ExpressionevaluateItem in class Expressioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionpublic boolean effectiveBooleanValue(XPathContext context) throws XPathException
ExpressioneffectiveBooleanValue in class Expressioncontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.