net.sf.saxon.expr

Class ItemChecker

public final class ItemChecker extends UnaryExpression

A ItemChecker implements the item type checking of "treat as": that is, it returns the supplied sequence, checking that all its items are of the correct type
Constructor Summary
ItemChecker(Expression sequence, ItemType itemType, RoleLocator role)
Constructor
Method Summary
protected StringdisplayOperator(NamePool pool)
Give a string representation of the operator for use in diagnostics
booleanequals(Object other)
Is this expression the same as another expression?
ItemevaluateItem(XPathContext context)
Evaluate as an Item.
intgetImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the items returned by the expression
ItemTypegetRequiredType()
Get the required type
SequenceIteratoriterate(XPathContext context)
Iterate over the sequence of values
voidprocess(XPathContext context)
Process the instruction, without returning any tail calls
Expressionsimplify(StaticContext env)
Simplify an expression
ExpressiontypeCheck(StaticContext env, ItemType contextItemType)
Type-check the expression

Constructor Detail

ItemChecker

public ItemChecker(Expression sequence, ItemType itemType, RoleLocator role)
Constructor

Method Detail

displayOperator

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

Returns: the operator, as a string

equals

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

evaluateItem

public Item evaluateItem(XPathContext context)
Evaluate as an Item.

getImplementationMethod

public int getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is provided. This implementation provides both iterate() and process() methods natively.

getItemType

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

Parameters: th

getRequiredType

public ItemType getRequiredType()
Get the required type

iterate

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

process

public void process(XPathContext context)
Process the instruction, without returning any tail calls

Parameters: context The dynamic context, giving access to the current node, the current variables, etc.

simplify

public Expression simplify(StaticContext env)
Simplify an expression

typeCheck

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