net.sf.saxon.expr
public final class CastableExpression extends UnaryExpression
Field Summary | |
---|---|
boolean | allowEmpty |
AtomicType | targetType |
Constructor Summary | |
---|---|
CastableExpression(Expression source, AtomicType target, boolean allowEmpty)
Create a "castable" expression of the form "source castable as target" |
Method Summary | |
---|---|
boolean | allowsEmpty()
Determine whether the empty sequence is allowed |
int | computeCardinality() |
int | computeSpecialProperties()
Determine the special properties of this expression |
Expression | copy()
Copy an expression. |
boolean | effectiveBooleanValue(XPathContext context) |
boolean | equals(Object other)
Is this expression the same as another expression? |
Item | evaluateItem(XPathContext context)
Evaluate the expression |
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the result of the Castable expression |
AtomicType | getTargetType()
Get the target type |
static boolean | isCastable(AtomicValue value, AtomicType targetType, XPathContext context)
Determine whether a value is castable to a given type |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType)
Optimize the expression |
Expression | simplify(ExpressionVisitor visitor)
Simplify the expression |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the expression |
Parameters: source The source expression target The type being tested against allowEmpty true if an empty sequence is acceptable, that is if the expression was written as "source castable as target?"
Returns: true if an empty sequence is allowed
Returns: NON_CREATIVE.
Returns: the copy of the original expression
Parameters: th the type hierarchy cache
Returns: the target type
Parameters: value the value to be tested targetType the type to be tested against context XPath dynamic context
Returns: true if the value is castable to the required type
Parameters: visitor an expression visitor
Returns: the simplified expression