net.sf.saxon.expr

Class UntypedAtomicConverter

public final class UntypedAtomicConverter extends UnaryExpression implements MappingExpression

An UntypedAtomicConverter is an expression that converts any untypedAtomic items in a sequence to a specified type
Constructor Summary
UntypedAtomicConverter(Expression sequence, AtomicType requiredItemType, boolean allConverted, RoleLocator role)
Constructor
Method Summary
booleanareAllItemsConverted()
Determine whether all items are to be converted, or only the subset that are untypedAtomic
intcomputeCardinality()
intcomputeSpecialProperties()
Determine the special properties of this expression
Expressioncopy()
Copy an expression.
protected StringdisplayOperator(Configuration config)
ItemevaluateItem(XPathContext context)
Evaluate as an Item.
voidexplain(ExpressionPresenter out)
Diagnostic print of expression structure.
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the items returned by the expression
SequenceIteratorgetMappingIterator(SequenceIterator base, XPathContext context)
ItemTypegetRequiredItemType()
Get the item type to which untyped atomic items must be converted
SequenceIteratoriterate(XPathContext context)
Iterate over the sequence of values
ExpressiontypeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Type-check the expression

Constructor Detail

UntypedAtomicConverter

public UntypedAtomicConverter(Expression sequence, AtomicType requiredItemType, boolean allConverted, RoleLocator role)
Constructor

Parameters: sequence this must be a sequence of atomic values. This is not checked; a ClassCastException will occur if the precondition is not satisfied. requiredItemType the item type to which untypedAtomic items in the sequence should be converted, using the rules for "cast as". allConverted true if the result of this expression is a sequence in which all items belong to the required type role Diagnostic information for use if conversion fails

Method Detail

areAllItemsConverted

public boolean areAllItemsConverted()
Determine whether all items are to be converted, or only the subset that are untypedAtomic

Returns: true if all items are to be converted

computeCardinality

public int computeCardinality()

computeSpecialProperties

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

Returns: NON_CREATIVE.

copy

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

Returns: the copy of the original expression

displayOperator

protected String displayOperator(Configuration config)

evaluateItem

public Item evaluateItem(XPathContext context)
Evaluate as an Item. This should only be called if the UntypedAtomicConverter has cardinality zero-or-one

explain

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

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the items returned by the expression

Parameters: th the type hierarchy cache

getMappingIterator

public SequenceIterator getMappingIterator(SequenceIterator base, XPathContext context)

getRequiredItemType

public ItemType getRequiredItemType()
Get the item type to which untyped atomic items must be converted

Returns: the required item type

iterate

public SequenceIterator iterate(XPathContext context)
Iterate over the sequence of values

typeCheck

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