public class TraceExpression extends Instruction implements InstructionInfo
EFFECTIVE_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 |
---|
TraceExpression(Expression child)
Create a trace expression that traces execution of a given child expression
|
Modifier and Type | Method and Description |
---|---|
void |
checkForUpdatingSubexpressions()
Check to ensure that this expression does not contain any inappropriate updating subexpressions.
|
Expression |
copy(RebindingMap rebindings)
Copy an 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.
|
Expression |
getChild() |
int |
getColumnNumber()
Get the column number.
|
int |
getConstructType()
Get the construct type.
|
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.
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
InstructionInfo |
getInstructionInfo()
Get the InstructionInfo details about the construct.
|
int |
getInstructionNameCode()
Get the namecode of the instruction for use in diagnostics
|
ItemType |
getItemType()
Get the item type of the items returned by evaluating this instruction
|
int |
getLineNumber()
Get the line number.
|
NamespaceResolver |
getNamespaceResolver()
Get the namespace resolver to supply the namespace context of the instruction
that is being traced
|
int |
getNetCost()
Return the estimated cost of evaluating an expression.
|
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.
|
java.util.Iterator<java.lang.String> |
getProperties()
Get an iterator over all the properties available.
|
java.lang.Object |
getProperty(java.lang.String name)
Get a named property of the instruction/expression
|
java.lang.String |
getPublicId()
Get the Public ID
|
java.lang.String |
getSystemId()
Get the system ID.
|
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.
|
boolean |
mayCreateNewNodes()
Determine whether this instruction creates new nodes.
|
java.lang.Iterable<Operand> |
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
TailCall |
processLeavingTail(XPathContext context)
Execute this instruction, with the possibility of returning tail calls if there are any.
|
Location |
saveLocation()
Get an immutable copy of this Location object.
|
void |
setChild(Expression child) |
void |
setConstructType(int type)
Set the type of construct.
|
void |
setNamespaceResolver(NamespaceResolver resolver)
Set the namespace context for the instruction being traced.
|
void |
setObjectName(StructuredQName qName)
Set a name identifying the object of the expression, for example a function name, template name,
variable name, key name, element name, etc.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set a named property of the instruction/expression
|
java.lang.String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
alwaysCreatesNewNodes, assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, dynamicError, evaluateAsString, getInstructionName, getSourceLocator, isInstruction, isXSLT, process, someOperandCreatesNewNodes
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkPermittedContents, computeDependencies, computeHashCode, computeStaticProperties, dynamicError, effectiveBooleanValue, explain, getConfiguration, getCost, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getPackageData, getParentExpression, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, getStreamerName, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, markTailFunctionCalls, operandList, operandSparseList, optimize, optimizeChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toString, typeCheck, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointers
public TraceExpression(Expression child)
child
- the expression to be traced. This will be available to the TraceListener
as the value of the "expression" property of the InstructionInfo.public Expression getChild()
public void setChild(Expression child)
public java.lang.Iterable<Operand> operands()
Expression
If the expression is a Callable, then it is required that the order of the operands returned by this function is the same as the order of arguments supplied to the corresponding call() method.
operands
in class Instruction
public void setConstructType(int type)
LocationKind
type
- an integer code for the type of construct being tracedpublic int getConstructType()
LocationKind
getConstructType
in interface InstructionInfo
getConstructType
in class Instruction
LocationKind
public void setNamespaceResolver(NamespaceResolver resolver)
resolver
- The namespace resolver, or null if none is neededpublic NamespaceResolver getNamespaceResolver()
public void setObjectName(StructuredQName qName)
qName
- the name of the object, or null if not applicablepublic StructuredQName getObjectName()
getObjectName
in interface InstructionInfo
getObjectName
in class Expression
public void setProperty(java.lang.String name, java.lang.Object value)
name
- the name of the propertyvalue
- the value of the propertypublic java.lang.Object getProperty(java.lang.String name)
getProperty
in interface InstructionInfo
getProperty
in class Expression
name
- the name of the propertypublic java.util.Iterator<java.lang.String> getProperties()
getProperties
in interface InstructionInfo
getProperties
in class Expression
public java.lang.String getExpressionName()
getExpressionName
in class Instruction
public InstructionInfo getInstructionInfo()
public Expression copy(RebindingMap rebindings)
Expression
copy
in class Expression
rebindings
- 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 boolean isUpdatingExpression()
isUpdatingExpression
in class Expression
public boolean isVacuousExpression()
isVacuousExpression
in class Expression
public void checkForUpdatingSubexpressions() throws XPathException
checkForUpdatingSubexpressions
in class Expression
XPathException
- if the expression has a non-permitted updating subexpressionpublic int getImplementationMethod()
Instruction
getImplementationMethod
in class Instruction
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
context
- the dynamic execution contextXPathException
public ItemType getItemType()
getItemType
in class Instruction
public int getCardinality()
getCardinality
in class Expression
public int getDependencies()
StaticProperty.DEPENDS_ON_CONTEXT_ITEM
and
StaticProperty.DEPENDS_ON_CURRENT_ITEM
. The default implementation combines the intrinsic
dependencies of this expression with the dependencies of the subexpressions,
computed recursively. This is overridden for expressions such as FilterExpression
where a subexpression's dependencies are not necessarily inherited by the parent
expression.getDependencies
in class Expression
public final boolean mayCreateNewNodes()
mayCreateNewNodes
in class Instruction
public int getNetCost()
getNetCost
in class Instruction
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in class Instruction
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext context) throws XPathException
iterate
in class Instruction
context
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic int getInstructionNameCode()
Instruction
getInstructionNameCode
in class Instruction
public void export(ExpressionPresenter out) throws XPathException
export
in interface ExportAgent
export
in class Expression
out
- 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 evaluatePendingUpdates(XPathContext context, PendingUpdateList pul) throws XPathException
evaluatePendingUpdates
in class Expression
context
- the XPath dynamic evaluation contextpul
- the pending update list to which the results should be writtenXPathException
- if evaluation failspublic java.lang.String getSystemId()
Location
The system identifier of a node is in general not the same as its base URI. The base URI is affected by xml:base attributes; the system identifier is not.
getSystemId
in interface javax.xml.transform.SourceLocator
getSystemId
in interface Location
getSystemId
in interface org.xml.sax.Locator
public int getColumnNumber()
Location
getColumnNumber
in interface javax.xml.transform.SourceLocator
getColumnNumber
in interface Location
getColumnNumber
in interface org.xml.sax.Locator
public java.lang.String getPublicId()
Location
getPublicId
in interface javax.xml.transform.SourceLocator
getPublicId
in interface Location
getPublicId
in interface org.xml.sax.Locator
public int getLineNumber()
Location
getLineNumber
in interface javax.xml.transform.SourceLocator
getLineNumber
in interface Location
getLineNumber
in interface org.xml.sax.Locator
public Location saveLocation()
Location
saveLocation
in interface Location
public java.lang.String toShortString()
toShortString
in class Expression
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.