public class TryCatch extends Expression
Modifier and Type | Class and Description |
---|---|
static class |
TryCatch.CatchClause |
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 |
---|
TryCatch(Expression tryExpr) |
Modifier and Type | Method and Description |
---|---|
void |
addCatchExpression(QNameTest test,
Expression catchExpr) |
boolean |
allowExtractingCommonSubexpressions()
Ask whether common subexpressions found in the operands of this expression can
be extracted and evaluated outside the expression itself.
|
int |
computeCardinality()
Determine the cardinality of the function.
|
int |
computeHashCode()
Hashcode supporting equals()
|
Expression |
copy(RebindingMap rebindings)
Copy an expression.
|
boolean |
equals(java.lang.Object other)
Is this expression the same as another expression?
|
Item |
evaluateItem(XPathContext c)
Evaluate as a singleton item
|
void |
export(ExpressionPresenter out)
Diagnostic print of expression structure.
|
java.util.List<TryCatch.CatchClause> |
getCatchClauses()
Get the list of catch clauses
|
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().
|
ItemType |
getItemType()
Determine the item type of the value returned by the function
|
java.lang.String |
getStreamerName()
Get the (partial) name of a class that supports streaming of this kind of expression
|
Expression |
getTryExpr()
Get the "try" expression
|
Operand |
getTryOperand()
Get the "try" operand
|
boolean |
isInstruction()
Ask whether this expression is an instruction.
|
SequenceIterator |
iterate(XPathContext c)
Iterate over the results of the function
|
java.lang.Iterable<Operand> |
operands()
Get the immediate sub-expressions of this expression, with information about the relationship
of each expression to its parent expression.
|
Expression |
optimize(ExpressionVisitor visitor,
ContextItemStaticInfo contextInfo)
Perform optimisation of an expression and its subexpressions.
|
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeSpecialProperties, computeStaticProperties, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getExtraProperty, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocalRetainedStaticContext, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getProperties, getProperty, getRetainedStaticContext, getScopingExpression, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStaticType, getStaticUType, hasCompatibleStaticContext, hashCode, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isLiftable, isMultiThreaded, isSameExpression, isStaticPropertiesKnown, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, process, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setExtraProperty, setFiltered, setFlattened, setLocation, setParentExpression, setRetainedStaticContext, setRetainedStaticContextLocally, setRetainedStaticContextThoroughly, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toString, typeCheck, typeCheckChildren, typeError, unordered, verifyParentPointers, verifyParentPointers
public TryCatch(Expression tryExpr)
public void addCatchExpression(QNameTest test, Expression catchExpr)
public Operand getTryOperand()
public Expression getTryExpr()
public java.util.List<TryCatch.CatchClause> getCatchClauses()
public boolean isInstruction()
isInstruction
in class Expression
public boolean allowExtractingCommonSubexpressions()
allowExtractingCommonSubexpressions
in class Expression
public int computeCardinality()
computeCardinality
in class Expression
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public ItemType getItemType()
getItemType
in class Expression
public java.lang.Iterable<Operand> operands()
operands
in class Expression
public Expression optimize(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo) throws XPathException
Expression
This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.
optimize
in class Expression
visitor
- an expression visitorcontextInfo
- the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
XPathException
- if an error is discovered during this phase
(typically a type error)public int getImplementationMethod()
getImplementationMethod
in class Expression
Expression.ITERATE_METHOD
or Expression.EVALUATE_METHOD
or
Expression.PROCESS_METHOD
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the expression to be compared with this onepublic int computeHashCode()
computeHashCode
in class Expression
public Expression copy(RebindingMap rebindings)
copy
in class Expression
rebindings
- public Item evaluateItem(XPathContext c) throws XPathException
evaluateItem
in class Expression
c
- the dynamic XPath evaluation contextXPathException
- if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext c) throws XPathException
iterate
in class Expression
c
- supplies the context for evaluationXPathException
- if any dynamic error occurs evaluating the
expressionpublic java.lang.String getExpressionName()
getExpressionName
in class Expression
public void export(ExpressionPresenter out) throws XPathException
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.public java.lang.String getStreamerName()
getStreamerName
in class Expression
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.