public final class AttributeGetter extends Expression
| Modifier and Type | Field and Description |
|---|---|
static int |
CHECK_CONTEXT_ITEM_IS_NODE |
static int |
CHECK_CONTEXT_ITEM_PRESENT |
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 |
|---|
AttributeGetter(FingerprintedQName attributeName) |
| 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()
Compute the static cardinality of this expression
|
int |
computeHashCode() |
AttributeGetter |
copy(RebindingMap rebindings)
Copy an expression.
|
boolean |
equals(java.lang.Object obj) |
Item |
evaluateItem(XPathContext context)
Evaluate an expression as a single item.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
FingerprintedQName |
getAttributeName() |
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 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.
|
int |
getRequiredChecks()
Ask what run-time checks are needed.
|
void |
setRequiredChecks(int checks)
Say what run-time checks are needed.
|
java.lang.String |
toShortString()
Produce a short string identifying the expression for use in error messages
|
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, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, 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, getStaticUType, getStreamerName, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isInstruction, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, markTailFunctionCalls, operandList, operands, operandSparseList, optimize, optimizeChildren, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, typeCheck, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointerspublic static final int CHECK_CONTEXT_ITEM_PRESENT
public static final int CHECK_CONTEXT_ITEM_IS_NODE
public AttributeGetter(FingerprintedQName attributeName)
public FingerprintedQName getAttributeName()
public void setRequiredChecks(int checks)
checks - the run-time checks that need to be performedpublic int getRequiredChecks()
public 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 computeCardinality()
ExpressioncomputeCardinality in class ExpressionStaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ONE_OR_MORE,
StaticProperty.ALLOWS_ZERO_OR_MOREpublic int getIntrinsicDependencies()
ExpressiongetIntrinsicDependencies in class Expressionpublic AttributeGetter 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 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 int getImplementationMethod()
ExpressiongetImplementationMethod in class ExpressionExpression.ITERATE_METHOD or Expression.EVALUATE_METHOD or
Expression.PROCESS_METHODpublic 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 java.lang.String getExpressionName()
ExpressiongetExpressionName in class Expressionpublic java.lang.String toShortString()
ExpressiontoShortString in class Expressionpublic 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 boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int computeHashCode()
computeHashCode 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.Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.