Class Trace
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.Trace
- All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, CallableExpression, InstructionInfo, Locator
This class supports the XPath 2.0 function trace().
The value is traced to the registered output stream (defaulting to System.err),
unless a TraceListener is in use, in which case the information is sent to the TraceListener
- See Also:
-
Field Summary
Fields inherited from class SystemFunction
operationFields inherited from class FunctionCall
argument -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(SequenceIterator[] arguments, XPathContext context) Evaluate the expressionintGet the static cardinalityintGet the static properties of this expression (other than its type).evaluateItem(XPathContext context) Evaluate the functioniterate(XPathContext context) Iterate over the results of the functionpreEvaluate(ExpressionVisitor visitor) preEvaluate: this method suppresses compile-time evaluation by doing nothingstatic voidtraceItem(Item val, String label, PrintStream out) Methods inherited from class SystemFunction
addContextDocumentArgument, addDocToPathMap, checkArguments, copy, equals, getDetails, getErrorCodeForTypeErrors, getImplementationMethod, getItemType, getOperation, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefaultMethods inherited from class FunctionCall
addExternalFunctionCallToPathMap, checkArgumentCount, explain, getArguments, getDisplayName, getExpressionName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, promote, replaceSubExpression, setArguments, setFunctionName, simplify, simplifyArguments, toString, typeCheckMethods inherited from class Expression
addToPathMap, adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getHostLanguage, getIntegerBounds, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeErrorMethods inherited from interface CallableExpression
getArguments
-
Constructor Details
-
Trace
public Trace()
-
-
Method Details
-
preEvaluate
preEvaluate: this method suppresses compile-time evaluation by doing nothing- Overrides:
preEvaluatein classFunctionCall- Parameters:
visitor- an expression visitor- Returns:
- the result of the early evaluation, or the original expression, or potentially a simplified expression
-
computeSpecialProperties
public int computeSpecialProperties()Get the static properties of this expression (other than its type). The result is bit-significant. These properties are used for optimizations. In general, if property bit is set, it is true, but if it is unset, the value is unknown.- Overrides:
computeSpecialPropertiesin classSystemFunction- Returns:
- the special properties, as a bit-significant integer
-
computeCardinality
public int computeCardinality()Get the static cardinality- Overrides:
computeCardinalityin classSystemFunction- Returns:
- the computed cardinality, as one of the values
StaticProperty.ALLOWS_ZERO_OR_ONE,StaticProperty.EXACTLY_ONE,StaticProperty.ALLOWS_ONE_OR_MORE,StaticProperty.ALLOWS_ZERO_OR_MORE
-
evaluateItem
Evaluate the function- Overrides:
evaluateItemin classExpression- Parameters:
context- The context in which the expression is to be evaluated- Returns:
- the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
- Throws:
XPathException- if any dynamic error occurs evaluating the expression
-
traceItem
-
iterate
Iterate over the results of the function- Overrides:
iteratein classExpression- Parameters:
context- supplies the context for evaluation- Returns:
- a SequenceIterator that can be used to iterate over the result of the expression
- Throws:
XPathException- if any dynamic error occurs evaluating the expression
-
call
public SequenceIterator call(SequenceIterator[] arguments, XPathContext context) throws XPathException Evaluate the expression- Specified by:
callin interfaceCallableExpression- Parameters:
arguments- the values of the arguments, supplied as SequenceIteratorscontext- the dynamic evaluation context- Returns:
- the result of the evaluation, in the form of a SequenceIterator
- Throws:
XPathException- if a dynamic error occurs during the evaluation of the expression
-