public class FunctionLiteral extends Literal
UserFunctionReference
is used.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 and Description |
---|
FunctionLiteral(Function value)
Create a literal as a wrapper around a Value
|
Modifier and Type | Method and Description |
---|---|
int |
computeCardinality()
Determine the cardinality
|
int |
computeHashCode()
Return a hash code to support the equals() function
|
int |
computeSpecialProperties()
Compute the static properties of this expression (other than its type).
|
Expression |
copy(RebindingMap rebindings)
Copy an expression.
|
boolean |
equals(java.lang.Object obj)
Determine whether two literals are equal, when considered as expressions.
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
java.lang.String |
getExpressionName()
Get a name identifying the kind of expression, in terms meaningful to a user.
|
FunctionItemType |
getItemType()
Determine the data type of the items in the expression, if possible
|
Function |
getValue()
Get the value represented by this Literal
|
boolean |
isVacuousExpression()
Determine whether this is a vacuous expression as defined in the XQuery update specification
|
void |
setRetainedStaticContext(RetainedStaticContext rsc)
Set the retained static context
|
Expression |
simplify()
Simplify an expression
|
Expression |
typeCheck(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
TypeCheck an expression
|
addToPathMap, effectiveBooleanValue, evaluateAsString, evaluateItem, evaluatePendingUpdates, exportAtomicValue, exportValue, getDependencies, getImplementationMethod, getIntegerBounds, getNetCost, getStaticUType, getStreamerName, hasEffectiveBooleanValue, isAtomic, isConstantBoolean, isConstantOne, isEmptySequence, isSubtreeExpression, iterate, iterate, makeEmptySequence, makeLiteral, makeLiteral, makeStringsLiteral, optimize, process, toPattern, toShortString, toString
adoptChildExpression, allowExtractingCommonSubexpressions, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, dynamicError, explain, getCardinality, getConfiguration, getConstructType, getCost, getEvaluationMethod, getExtraProperty, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, hasCompatibleStaticContext, hashCode, hasSpecialProperty, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isEqual, isIdentical, isInstruction, isLiftable, isMultiThreaded, isStaticPropertiesKnown, isUpdatingExpression, markTailFunctionCalls, operandList, operands, operandSparseList, optimizeChildren, prepareForStreaming, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplifyChildren, staticTypeCheck, suppressValidation, typeCheckChildren, typeError, unordered, verifyParentPointers
public FunctionLiteral(Function value)
value
- the value of this literalpublic Function getValue()
public Expression simplify() throws XPathException
simplify
in class Expression
XPathException
- if an error is discovered during expression
rewritingpublic Expression typeCheck(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
typeCheck
in class Literal
visitor
- an expression visitorcontextInfo
- Information available statically about the context item: whether it is (possibly)
absent; its static type; its streaming posture.XPathException
- if an error is discovered during this phase
(typically a type error)public FunctionItemType getItemType()
getItemType
in class Literal
public int computeCardinality()
computeCardinality
in class Literal
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
. May also return StaticProperty.ALLOWS_ZERO
if
the result is known to be an empty sequence, or StaticProperty.ALLOWS_MANY
if
if is known to return a sequence of length two or more.public int computeSpecialProperties()
StaticProperty.NO_NODES_NEWLY_CREATED
.computeSpecialProperties
in class Literal
StaticProperty.NO_NODES_NEWLY_CREATED
public boolean isVacuousExpression()
isVacuousExpression
in class Literal
public Expression copy(RebindingMap rebindings)
public void setRetainedStaticContext(RetainedStaticContext rsc)
setRetainedStaticContext
in class Expression
rsc
- the static context to be retainedpublic boolean equals(java.lang.Object obj)
equals
in class Literal
obj
- the other expressionpublic int computeHashCode()
computeHashCode
in class Literal
public java.lang.String getExpressionName()
getExpressionName
in class Literal
public void export(ExpressionPresenter out) throws XPathException
export
in interface ExportAgent
export
in class Literal
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-2020 Saxonica Limited. All rights reserved.