net.sf.saxon.expr
public class Literal extends Expression
Constructor Summary | |
---|---|
Literal(Value value)
Create a literal as a wrapper around a Value |
Method Summary | |
---|---|
PathMap.PathMapNodeSet | addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap. |
int | computeCardinality()
Determine the cardinality |
int | computeSpecialProperties()
Compute the static properties of this expression (other than its type). |
Expression | copy()
Copy an expression. |
boolean | effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the expression. |
boolean | equals(Object obj)
Determine whether two literals are equal, when considered as expressions. |
CharSequence | evaluateAsString(XPathContext context) |
Item | evaluateItem(XPathContext context)
Evaluate as a singleton item (or empty sequence). |
void | evaluatePendingUpdates(XPathContext context, PendingUpdateList pul)
Evaluate an updating expression, adding the results to a Pending Update List.
|
void | explain(ExpressionPresenter out)
Diagnostic print of expression structure. |
int | getDependencies()
Determine which aspects of the context the expression depends on. |
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the items in the expression, if possible |
Value | getValue()
Get the value represented by this Literal |
int | hashCode()
Return a hash code to support the equals() function |
static boolean | isAtomic(Expression exp)
Test whether the literal wraps an atomic value. |
static boolean | isConstantBoolean(Expression exp, boolean value)
Test if a literal represents the boolean value true |
static boolean | isConstantOne(Expression exp)
Test if a literal represents the integer value 1 |
static boolean | isEmptySequence(Expression exp)
Test whether the literal explicitly wraps an empty sequence. |
boolean | isSubtreeExpression()
Determine whether the expression can be evaluated without reference to the part of the context
document outside the subtree rooted at the context node. |
boolean | isVacuousExpression()
Determine whether this is a vacuous expression as defined in the XQuery update specification |
SequenceIterator | iterate(XPathContext context)
Return an Iterator to iterate over the values of a sequence. |
static Literal | makeEmptySequence()
Make an empty-sequence literal |
static Literal | makeLiteral(Value value)
Create a literal as a wrapper around a Value (factory method) |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType)
Optimize an expression |
void | process(XPathContext context)
Process the value as an instruction, without returning any tail calls |
Expression | simplify(ExpressionVisitor visitor)
Simplify an expression |
String | toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath.
|
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
TypeCheck an expression |
Parameters: value the value of this literal
Parameters: pathMap the PathMap to which the expression should be added pathMapNodeSet
Returns: the pathMapNode representing the focus established by this expression, in the case where this expression is the first operand of a path expression or filter expression
Returns: the value NON_CREATIVE
Returns: the copy of the original expression
Parameters: context The context in which the expression is to be evaluated
Returns: the effective boolean value
Throws: net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the expression
Parameters: obj the other expression
Returns: true if the two literals are equal. The test here requires (a) identity in the sense defined by XML Schema (same value in the same value space), and (b) identical type annotations. For example the literal xs:int(3) is not equal (as an expression) to xs:short(3), because the two expressions are not interchangeable.
Parameters: context the XPath dynamic evaluation context pul the pending update list to which the results should be written
Returns: for a Value, this always returns zero.
Parameters: th The TypeHierarchy. Can be null if the target is an AtomicValue.
Returns: for the default implementation: AnyItemType (not known)
Returns: the constant value
Parameters: exp an expression
Returns: if the expression is a literal and the literal wraps an AtomicValue
Parameters: exp an expression value true or false
Returns: if the expression is a literal and the literal represents the boolean value given in the second argument
Parameters: exp an expression
Returns: if the expression is a literal and the literal represents the integer value 1
Parameters: exp an expression
Returns: if the expression is a literal and the literal wraps an AtomicValue
Returns: true if the expression has no dependencies on the context node, or if the only dependencies on the context node are downward selections using the self, child, descendant, attribute, and namespace axes.
Returns: true if this expression is vacuous
Parameters: context supplies the context for evaluation
Returns: a SequenceIterator that can be used to iterate over the result of the expression
Throws: net.sf.saxon.trans.XPathException if any dynamic error occurs evaluating the expression
Returns: a literal whose value is the empty sequence
Parameters: value the value of this literal
Returns: the Literal
Returns: for a Value, this always returns the value unchanged
Parameters: context The dynamic context, giving access to the current node, the current variables, etc.
Parameters: visitor an expression visitor
Returns: for a Value, this always returns the value unchanged
Returns: for a Value, this always returns the value unchanged