public class CastableExpr extends AbsExpression
The castable expression tests whether a given value is castable into a given target type. The target type must be an atomic type that is in the in-scope schema types [err:XPST0051]. In addition, the target type cannot be xs:NOTATION or xs:anyAtomicType [err:XPST0080]. The optional occurrence indicator "?" denotes that an empty sequence is permitted.
The expression V castable as T returns true if the value V can be successfully cast into the target type T by using a cast expression; otherwise it returns false. The castable expression can be used as a predicate to avoid errors at evaluation time. It can also be used to select an appropriate type for processing of a given value.
Constructor and Description |
---|
CastableExpr(INodeReadTrx rtx,
AbsAxis inputExpr,
SingleType mTarget)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
AtomicValue |
evaluate()
Performs the expression dependent evaluation of the expression.
|
void |
reset(long mNodeKey)
Resetting the nodekey of this axis to a given nodekey.
|
hasNext
addAtomicToItemList, close, getItemList, getNode, getStartKey, isSelfIncluded, iterator, moveTo, next, remove, resetToLastKey, resetToStartKey
public CastableExpr(INodeReadTrx rtx, AbsAxis inputExpr, SingleType mTarget)
rtx
- Exclusive (immutable) trx to iterate with.inputExpr
- input expression, that's castablity will be tested.mTarget
- Type to test, whether the input expression can be casted to.public void reset(long mNodeKey)
reset
in class AbsExpression
mNodeKey
- the nodekey where the reset should occur to.public AtomicValue evaluate() throws TTXPathException
evaluate
in class AbsExpression
TTXPathException
- if evaluation fails.Copyright © 2013. All Rights Reserved.