net.sf.saxon.expr

Class CastableExpression

public final class CastableExpression extends UnaryExpression

Castable Expression: implements "Expr castable as atomic-type?". The implementation simply wraps a cast expression with a try/catch.
Field Summary
booleanallowEmpty
AtomicTypetargetType
Constructor Summary
CastableExpression(Expression source, AtomicType target, boolean allowEmpty)
Method Summary
intcomputeCardinality()
intcomputeSpecialProperties()
Determine the special properties of this expression
protected StringdisplayOperator(NamePool pool)
Give a string representation of the operator for use in diagnostics
booleaneffectiveBooleanValue(XPathContext context)
booleanequals(Object other)
Is this expression the same as another expression?
ItemevaluateItem(XPathContext context)
Evaluate the expression
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the result of the Castable expression
Expressionoptimize(Optimizer opt, StaticContext env, ItemType contextItemType)
Type-check the expression
Expressionsimplify(StaticContext env)
Simplify the expression
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression

Field Detail

allowEmpty

boolean allowEmpty

targetType

AtomicType targetType

Constructor Detail

CastableExpression

public CastableExpression(Expression source, AtomicType target, boolean allowEmpty)

Method Detail

computeCardinality

public int computeCardinality()

computeSpecialProperties

public int computeSpecialProperties()
Determine the special properties of this expression

Returns: NON_CREATIVE.

displayOperator

protected String displayOperator(NamePool pool)
Give a string representation of the operator for use in diagnostics

Returns: the operator, as a string

effectiveBooleanValue

public boolean effectiveBooleanValue(XPathContext context)

equals

public boolean equals(Object other)
Is this expression the same as another expression?

evaluateItem

public Item evaluateItem(XPathContext context)
Evaluate the expression

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the result of the Castable expression

Parameters: th

optimize

public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)
Type-check the expression

simplify

public Expression simplify(StaticContext env)
Simplify the expression

Returns: the simplified expression

typeCheck

public Expression typeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression