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
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 ClassesNested 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, isSingleEntryFields inherited from class net.sf.saxon.expr.BinaryExpression
operatorFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected intDetermine the static cardinality of the expressioncopy(RebindingMap rebindings) Copy an expression.final ItemTypeDetermine the data type of the items returned by this expressioniterate(XPathContext context) Iterate the lookup-expression in a given contexttypeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) Type-check the expressionMethods inherited from class net.sf.saxon.expr.LookupExpression
computeHashCode, equals, export, getCost, getElaborator, getExpressionName, getImplementationMethod, getOperandRole, getStaticUType, mustBeArrayOrMap, optimize, toStringMethods inherited from class net.sf.saxon.expr.BinaryExpression
computeSpecialProperties, displayOperator, explainExtraAttributes, getLhs, getLhsExpression, getOperator, getRhs, getRhsExpression, isAssociative, isCommutative, isInverse, operands, setFlattened, setLhsExpression, setRhsExpression, tag, toShortStringMethods 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, withLocationMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.trace.Traceable
gatherProperties
-
Constructor Details
-
ObjectLookupExpression
-
-
Method Details
-
getItemType
Description copied from class:LookupExpressionDetermine the data type of the items returned by this expression- Overrides:
getItemTypein 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:LookupExpressionType-check the expression- Overrides:
typeCheckin 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
Copy an expression. This makes a deep copy.- Overrides:
copyin 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:
computeCardinalityin 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_ZEROif the result is known to be an empty sequence, orStaticProperty.ALLOWS_MANYif if is known to return a sequence of length two or more.
-
iterate
Iterate the lookup-expression in a given context- Overrides:
iteratein 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
-