|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.expr.Expression net.sf.saxon.expr.FunctionCall net.sf.saxon.functions.SystemFunction com.saxonica.extra.Try
public class Try
This class implements the saxon:try() extension function, which is specially recognized by the system because it uses a non-standard approach to evaluating its arguments
Field Summary |
---|
Fields inherited from class net.sf.saxon.expr.Expression |
---|
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
---|---|
Try()
|
Method Summary | |
---|---|
int |
computeCardinality()
Determine the cardinality of the function. |
Item |
evaluateItem(XPathContext c)
Evaluate in a general context |
ItemType |
getItemType(TypeHierarchy th)
Determine the item type of the value returned by the function |
SequenceIterator |
iterate(XPathContext c)
Iterate over the results of the function |
Expression |
optimize(ExpressionVisitor visitor,
ItemType contextItemType)
Type-check the expression. |
Expression |
simplify(ExpressionVisitor visitor)
Simplify the function call. |
Expression |
typeCheck(ExpressionVisitor visitor,
ItemType contextItemType)
Type-check the expression. |
Methods inherited from class net.sf.saxon.functions.SystemFunction |
---|
addDocToPathMap, checkArguments, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, makeSystemFunction, setDetails |
Methods inherited from class net.sf.saxon.expr.FunctionCall |
---|
addExternalFunctionCallToPathMap, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Try()
Method Detail |
---|
public Expression simplify(ExpressionVisitor visitor) throws XPathException
simplify
in class FunctionCall
visitor
- an expression visitor
XPathException
- if an error is discovered during expression
rewritingpublic Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
typeCheck
in class FunctionCall
visitor
- an expression visitorcontextItemType
- 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 Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
optimize
in class SystemFunction
visitor
- an expression visitorcontextItemType
- 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 computeCardinality()
computeCardinality
in class SystemFunction
StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
public ItemType getItemType(TypeHierarchy th)
getItemType
in class SystemFunction
th
- the type hierarchy cache
public Item evaluateItem(XPathContext c) throws XPathException
evaluateItem
in interface EvaluableItem
evaluateItem
in class Expression
c
- The context in which the expression is to be evaluated
XPathException
- if any dynamic error occurs evaluating the
expressionpublic SequenceIterator iterate(XPathContext c) throws XPathException
iterate
in interface SequenceIterable
iterate
in class Expression
c
- supplies the context for evaluation
XPathException
- if any dynamic error occurs evaluating the
expression
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |