net.sf.saxon.functions

Class StringLength

public class StringLength extends SystemFunction

Implement the XPath string-length() function
Method Summary
ItemevaluateItem(XPathContext c)
Evaluate in a general context
intgetIntrinsicDependencies()
Determine the intrinsic dependencies of an expression, that is, those which are not derived from the dependencies of its subexpressions.
ExpressionpreEvaluate(ExpressionVisitor visitor)
Pre-evaluate a function at compile time.
Expressionsimplify(ExpressionVisitor visitor)
Simplify and validate.
ExpressiontypeCheck(ExpressionVisitor visitor, ItemType contextItemType)

Method Detail

evaluateItem

public Item evaluateItem(XPathContext c)
Evaluate in a general context

getIntrinsicDependencies

public int getIntrinsicDependencies()
Determine the intrinsic dependencies of an expression, that is, those which are not derived from the dependencies of its subexpressions. For example, position() has an intrinsic dependency on the context position, while (position()+1) does not. The default implementation of the method returns 0, indicating "no dependencies".

Returns: a set of bit-significant flags identifying the "intrinsic" dependencies. The flags are documented in class net.sf.saxon.value.StaticProperty

preEvaluate

public Expression preEvaluate(ExpressionVisitor visitor)
Pre-evaluate a function at compile time. Functions that do not allow pre-evaluation, or that need access to context information, can override this method.

Parameters: visitor an expression visitor

Returns: the expression, either unchanged, or pre-evaluated

simplify

public Expression simplify(ExpressionVisitor visitor)
Simplify and validate. This is a pure function so it can be simplified in advance if the arguments are known

Parameters: visitor an expression visitor

typeCheck

public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType)