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, verifyParentPointers
public 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()
Expression
This method should always return a result, though it may be the best approximation that is available at the time.
getItemType
in class Expression
public int computeCardinality()
Expression
computeCardinality
in class Expression
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public int getIntrinsicDependencies()
Expression
getIntrinsicDependencies
in class Expression
public AttributeGetter 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 PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
Expression
The 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 Expression
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
- the PathMapNodeSet to which the paths embodied in this expression should be addedpublic int getImplementationMethod()
Expression
getImplementationMethod
in class Expression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public Item 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 java.lang.String getExpressionName()
Expression
getExpressionName
in class Expression
public java.lang.String toShortString()
Expression
toShortString
in class Expression
public java.lang.String toString()
Expression
The 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 Expression
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int computeHashCode()
computeHashCode
in class Expression
public void export(ExpressionPresenter out) throws XPathException
Expression
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.Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.