Package net.sf.saxon.expr
Class RootExpression
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.SingleNodeExpression
net.sf.saxon.expr.RootExpression
- All Implemented Interfaces:
Serializable
,SourceLocator
,LocationProvider
,SaxonLocator
,InstructionInfo
,Locator
An expression whose value is always a set of nodes containing a single node,
the document root. This corresponds to the XPath Expression "/", including the implicit
"/" at the start of a path expression with a leading "/".
- See Also:
-
Field Summary
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, EVENT_FEED_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, locationId, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, PUSH_SELECTION, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, WATCH_METHOD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddToPathMap
(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet) Add a representation of this expression to a PathMap.final int
Specify that the expression returns a singletoncopy()
Copy an expression.boolean
Is this expression the same as another expression?void
explain
(ExpressionPresenter destination) Diagnostic print of expression structure.int
Determine which aspects of the context the expression depends on.Determine the data type of the items returned by this expressiongetNode
(XPathContext context) Return the first element selected by this Expressionint
hashCode()
get HashCode for comparing two expressionsprotected String
Customize the error message on type checkingtoString()
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.Methods inherited from class net.sf.saxon.expr.SingleNodeExpression
computeSpecialProperties, effectiveBooleanValue, evaluateItem, isContextPossiblyUndefined, iterate, optimize, typeCheck
Methods inherited from class net.sf.saxon.expr.Expression
adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getEvaluationMethod, getExecutable, getExpressionName, getHostLanguage, getImplementationMethod, getIntegerBounds, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, hasVariableBinding, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, iterateSameFocusSubExpressions, iterateSubExpressions, markTailFunctionCalls, process, promote, replaceSubExpression, resetLocalStaticProperties, setContainer, setEvaluationMethod, setFiltered, setFlattened, setLocationId, simplify, staticTypeCheck, suppressValidation, typeError
-
Constructor Details
-
RootExpression
public RootExpression()
-
-
Method Details
-
noContextMessage
Customize the error message on type checking- Specified by:
noContextMessage
in classSingleNodeExpression
-
equals
Is this expression the same as another expression? -
computeCardinality
public final int computeCardinality()Specify that the expression returns a singleton- Overrides:
computeCardinality
in classSingleNodeExpression
- 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
-
getItemType
Determine the data type of the items returned by this expression- Overrides:
getItemType
in classSingleNodeExpression
- Parameters:
th
- the type hierarchy cache- Returns:
- Type.NODE
-
hashCode
public int hashCode()get HashCode for comparing two expressions -
getNode
Return the first element selected by this Expression- Specified by:
getNode
in classSingleNodeExpression
- Parameters:
context
- The evaluation context- Returns:
- the NodeInfo of the first selected element, or null if no element is selected
- Throws:
XPathException
-
getIntrinsicDependencies
public int getIntrinsicDependencies()Determine which aspects of the context the expression depends on. The result is a bitwise-or'ed value composed from constants such as StaticProperty.VARIABLES and StaticProperty.CURRENT_NODE- Overrides:
getIntrinsicDependencies
in classSingleNodeExpression
- Returns:
- a set of bit-significant flags identifying the "intrinsic" dependencies. The flags are documented in class net.sf.saxon.value.StaticProperty
-
copy
Copy an expression. This makes a deep copy.- Specified by:
copy
in classExpression
- Returns:
- the copy of the original expression
-
addToPathMap
Add a representation of this expression to a PathMap. The PathMap captures a map of the nodes visited by an expression in a source tree.- Overrides:
addToPathMap
in classExpression
- Parameters:
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
-- Returns:
- the pathMapNode representing the focus established by this expression, in the case where this expression is the first operand of a path expression or filter expression
-
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. In the case of XSLT instructions, the toString() method gives an abstracted view of the syntax- Overrides:
toString
in classExpression
- Returns:
- a representation of the expression as a string
-
explain
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.- Specified by:
explain
in classExpression
- Parameters:
destination
- the expression presenter used to display the structure
-