net.sf.saxon.expr

Class ErrorExpression

public class ErrorExpression extends Expression

Error expression: this expression is generated when the supplied expression cannot be parsed, and the containing element enables forwards-compatible processing. It defers the generation of an error message until an attempt is made to evaluate the expression
Constructor Summary
ErrorExpression(XPathException exception)
Constructor
Method Summary
intcomputeCardinality()
Determine the static cardinality
Expressioncopy()
Copy an expression.
ItemevaluateItem(XPathContext context)
Evaluate the expression.
voidexplain(ExpressionPresenter destination)
Diagnostic print of expression structure.
XPathExceptiongetException()
Get the wrapped exception
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the expression, if possible
SequenceIteratoriterate(XPathContext context)
Iterate over the expression.
Expressionoptimize(ExpressionVisitor visitor, ItemType contextItemType)
ExpressiontypeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the expression.

Constructor Detail

ErrorExpression

public ErrorExpression(XPathException exception)
Constructor

Parameters: exception the error found when parsing this expression

Method Detail

computeCardinality

public int computeCardinality()
Determine the static cardinality

copy

public Expression copy()
Copy an expression. This makes a deep copy.

Returns: the copy of the original expression

evaluateItem

public Item evaluateItem(XPathContext context)
Evaluate the expression. This always throws the exception registered when the expression was first parsed.

explain

public void explain(ExpressionPresenter destination)
Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.

getException

public XPathException getException()
Get the wrapped exception

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible

Parameters: th the type hierarchy cache

Returns: Type.ITEM (meaning not known in advance)

iterate

public SequenceIterator iterate(XPathContext context)
Iterate over the expression. This always throws the exception registered when the expression was first parsed.

optimize

public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType)

typeCheck

public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the expression.