public class RootExpression extends Expression
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 |
---|
RootExpression() |
Modifier and Type | Method and Description |
---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
int |
computeCardinality()
Specify that the expression returns a singleton
|
int |
computeHashCode()
get HashCode for comparing two expressions
|
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?
|
NodeInfo |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
void |
export(ExpressionPresenter destination)
Diagnostic print of expression structure.
|
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().
|
int |
getIntrinsicDependencies()
Determine which aspects of the context the expression depends on.
|
ItemType |
getItemType()
Determine the data type of the items returned by this expression
|
NodeInfo |
getNode(XPathContext context)
Return the first element selected by this Expression
|
UType |
getStaticUType(UType contextItemType)
Get the static type of the expression as a UType, following precisely the type
inference rules defined in the XSLT 3.0 specification.
|
java.lang.String |
getStreamerName()
Get the (partial) name of a class that supports streaming of this kind of expression
|
boolean |
isContextPossiblyUndefined()
Ask whether there is a possibility that the context item will be undefined
|
SequenceIterator |
iterate(XPathContext context)
Evaluate the expression in a given context to return an iterator
|
protected java.lang.String |
noContextMessage()
Customize the error message on type checking
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextItemType)
Perform optimisation of an expression and its subexpressions.
|
Pattern |
toPattern(Configuration config,
boolean is30)
Convert this expression to an equivalent XSLT pattern
|
java.lang.String |
toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath.
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Type-check the expression.
|
adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dynamicError, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isInstruction, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operands, operandSparseList, optimizeChildren, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toShortString, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointers
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck
in class Expression
visitor
- an expression visitorcontextInfo
- Information available statically about the context item: whether it is (possibly)
absent; its static type; its streaming posture.XPathException
- if an error is discovered during this phase
(typically a type error)public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextItemType) throws XPathException
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
optimize
in class Expression
visitor
- an expression visitorcontextItemType
- the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public int computeSpecialProperties()
Expression
StaticProperty
. 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 Expression
public boolean isContextPossiblyUndefined()
protected java.lang.String noContextMessage()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public final int computeCardinality()
computeCardinality
in class Expression
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public ItemType getItemType()
getItemType
in class Expression
public UType getStaticUType(UType contextItemType)
getStaticUType
in class Expression
contextItemType
- public int getImplementationMethod()
getImplementationMethod
in class Expression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public int computeHashCode()
computeHashCode
in class Expression
public NodeInfo getNode(XPathContext context) throws XPathException
context
- The evaluation contextXPathException
public int getIntrinsicDependencies()
getIntrinsicDependencies
in class Expression
public Expression copy(RebindingMap rebindings)
copy
in class Expression
rebindings
- public Pattern toPattern(Configuration config, boolean is30) throws XPathException
toPattern
in class Expression
config
- the Saxon configurationis30
- true if this is XSLT 3.0XPathException
- if conversion is not possiblepublic PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
addToPathMap
in class Expression
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
- public java.lang.String toString()
toString
in class Expression
public java.lang.String getExpressionName()
Expression
getExpressionName
in class Expression
public void export(ExpressionPresenter destination) throws XPathException
export
in interface ExportAgent
export
in class Expression
destination
- 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 SequenceIterator iterate(XPathContext context) throws XPathException
iterate
in class Expression
context
- the evaluation contextXPathException
- if any dynamic error occurs evaluating the
expressionpublic NodeInfo evaluateItem(XPathContext context) throws XPathException
Expression
evaluateItem
in class Expression
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic boolean effectiveBooleanValue(XPathContext context) throws XPathException
Expression
effectiveBooleanValue
in class Expression
context
- The context in which the expression is to be evaluatedXPathException
- if any dynamic error occurs evaluating the
expressionpublic java.lang.String getStreamerName()
getStreamerName
in class Expression
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.