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) |
int |
computeCardinality()
Determine the cardinality of the function.
|
Expression |
copy(RebindingMap rebindings)
Copy an expression.
|
boolean |
equals(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.
|
List<TryCatch.CatchClause> |
getCatchClauses()
Get the list of catch clauses
|
ExpressionCompiler |
getExpressionCompiler()
Return the compiler of the TryCatch expression
|
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
|
protected StreamingAdjunct |
getStreamingAdjunct()
Get a class that supports streamed evaluation of this expression
|
Expression |
getTryExpr()
Get the "try" expression
|
int |
hashCode()
Hashcode supporting equals()
|
SequenceIterator |
iterate(XPathContext c)
Iterate over the results of the function
|
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.
|
Expression |
promote(PromotionOffer offer)
Offer promotion for this subexpression.
|
addToPathMap, adoptChildExpression, checkedOperands, checkForUpdatingSubexpressions, checkPermittedContents, clearStreamabilityData, computeDependencies, computeSpecialProperties, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getConfiguration, getConstructType, getCost, getDependencies, getEvaluationMethod, getHostLanguage, getIntegerBounds, getInterpretedExpression, getIntrinsicDependencies, getLocation, getNetCost, getObjectName, getPackageData, getParentExpression, getPosture, getPostureAndSweepIfKnown, getProperties, getProperty, getRetainedStaticContext, getSlotsUsed, getSpecialProperties, getStaticBaseURI, getStaticBaseURIString, getStreamability, getSweep, getSystemId, hasVariableBinding, identityHashCode, implementsStaticTypeCheck, isCallOn, isCallOnSystemFunction, isIdentical, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterateEvents, makeStreamingAdjunct, markTailFunctionCalls, operandList, operandSparseList, optimizeChildren, optimizeForType, process, promoteChildren, resetLocalStaticProperties, restoreParentPointers, setEvaluationMethod, setFiltered, setFlattened, setLocation, setParentExpression, setPostureAndSweep, setRetainedStaticContext, setRetainedStaticContextLocally, setStaticProperty, simplify, simplifyChildren, staticTypeCheck, suppressValidation, toPattern, toShortString, toStreamingPattern, toString, typeCheck, typeCheckChildren, typeError, unordered
public TryCatch(Expression tryExpr)
public void addCatchExpression(QNameTest test, Expression catchExpr)
public Expression getTryExpr()
public List<TryCatch.CatchClause> getCatchClauses()
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 Iterable<Operand> operands()
operands
in class Expression
public Expression promote(PromotionOffer offer) throws XPathException
This method must be overridden for any Expression that has subexpressions.
promote
in class Expression
offer
- details of the offer, for example the offer to move
expressions that don't depend on the context to an outer level in
the containing expressionXPathException
- if any error is detectedpublic 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(Object other)
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 String getExpressionName()
getExpressionName
in class Expression
public void export(ExpressionPresenter out) throws XPathException
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 ExpressionCompiler getExpressionCompiler()
getExpressionCompiler
in class Expression
protected StreamingAdjunct getStreamingAdjunct()
getStreamingAdjunct
in class Expression
Copyright (c) 2004-2017 Saxonica Limited. All rights reserved.