Package com.saxonica.expr
Class ObjectLookupExpression
- java.lang.Object
-
- net.sf.saxon.expr.Expression
-
- net.sf.saxon.expr.BinaryExpression
-
- net.sf.saxon.expr.LookupExpression
-
- com.saxonica.expr.ObjectLookupExpression
-
- All Implemented Interfaces:
ExportAgent
,Locatable
,IdentityComparable
,Traceable
public class ObjectLookupExpression extends LookupExpression
Saxon extension: a lookup expression of the form X?Y where X is a Java external object and Y is a method defined on that object. This class is used only where it is statically known that X is a Java external object, in which case it is often possible to determine the Java method to be called statically.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObjectLookupExpression.ObjectLookupElaborator
-
Nested classes/interfaces inherited from class net.sf.saxon.expr.LookupExpression
LookupExpression.LookupElaborator
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.expr.LookupExpression
isArrayLookup, isMapLookup, isSingleContainer, isSingleEntry
-
Fields inherited from class net.sf.saxon.expr.BinaryExpression
operator
-
Fields inherited from class net.sf.saxon.expr.Expression
EFFECTIVE_BOOLEAN_VALUE, EVALUATE_METHOD, ITEM_FEED_METHOD, ITERATE_METHOD, MAX_COST, MAX_SEQUENCE_LENGTH, MAX_STRING_LENGTH, PROCESS_METHOD, staticProperties, UNBOUNDED_LOWER, UNBOUNDED_UPPER, UPDATE_METHOD, WATCH_METHOD
-
-
Constructor Summary
Constructors Constructor Description ObjectLookupExpression(Expression start, Expression step)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
computeCardinality()
Determine the static cardinality of the expressionLookupExpression
copy(RebindingMap rebindings)
Copy an expression.ItemType
getItemType()
Determine the data type of the items returned by this expressionSequenceIterator
iterate(XPathContext context)
Iterate the lookup-expression in a given contextExpression
typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo)
Type-check the expression-
Methods inherited from class net.sf.saxon.expr.LookupExpression
computeHashCode, equals, export, getCost, getElaborator, getExpressionName, getImplementationMethod, getOperandRole, getStaticUType, mustBeArrayOrMap, optimize, toString
-
Methods inherited from class net.sf.saxon.expr.BinaryExpression
computeSpecialProperties, displayOperator, explainExtraAttributes, getLhs, getLhsExpression, getOperator, getRhs, getRhsExpression, isAssociative, isCommutative, isInverse, operands, setFlattened, setLhsExpression, setRhsExpression, tag, toShortString
-
Methods inherited from class net.sf.saxon.expr.Expression
addToPathMap, adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dispatchTailCall, dynamicError, effectiveBooleanValue, evaluateAsString, evaluateItem, explain, getCardinality, getConfiguration, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStreamerName, getTracingTag, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, makeElaborator, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, prepareForStreaming, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, supportsLazyEvaluation, suppressValidation, toPattern, typeCheckChildren, typeError, unordered, verifyParentPointers, withLocation
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
-
-
-
Constructor Detail
-
ObjectLookupExpression
public ObjectLookupExpression(Expression start, Expression step)
-
-
Method Detail
-
getItemType
public final ItemType getItemType()
Description copied from class:LookupExpression
Determine the data type of the items returned by this expression- Overrides:
getItemType
in classLookupExpression
- Returns:
- the type of the expression, as far as this is known. Prior to type-checking,
the method returns
AnyItemType
-
typeCheck
public Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
Description copied from class:LookupExpression
Type-check the expression- Overrides:
typeCheck
in classLookupExpression
- Parameters:
visitor
- an expression visitorcontextInfo
- Information available statically about the context item: whether it is (possibly) absent; its static type; its streaming posture.- Returns:
- the original expression, rewritten to perform necessary run-time type checks, and to perform other type-related optimizations
- Throws:
XPathException
- if an error is discovered during this phase (typically a type error)
-
copy
public LookupExpression copy(RebindingMap rebindings)
Copy an expression. This makes a deep copy.- Overrides:
copy
in classLookupExpression
- Parameters:
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.- Returns:
- the copy of the original expression
-
computeCardinality
protected int computeCardinality()
Determine the static cardinality of the expression- Overrides:
computeCardinality
in classLookupExpression
- 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
. May also returnStaticProperty.ALLOWS_ZERO
if the result is known to be an empty sequence, orStaticProperty.ALLOWS_MANY
if if is known to return a sequence of length two or more.
-
iterate
public SequenceIterator iterate(XPathContext context) throws XPathException
Iterate the lookup-expression in a given context- Overrides:
iterate
in classLookupExpression
- Parameters:
context
- the evaluation context- 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
-
-