public class SingletonNode extends Value
| Modifier and Type | Field and Description |
|---|---|
protected NodeInfo |
node |
EMPTY_CLASS_ARRAYEVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHODEMPTY_VALUE_ARRAY| Constructor and Description |
|---|
SingletonNode(NodeInfo node)
Create a node-set containing zero or one nodes
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
convertToJava(java.lang.Class target,
XPathContext context)
Convert to Java object (for passing to external functions)
|
void |
display(int depth,
java.io.PrintStream out,
Configuration config)
Diagnostic display
|
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value
|
java.lang.String |
evaluateAsString(XPathContext context)
Evaluate an expression as a String.
|
Item |
evaluateItem(XPathContext context)
Evaluate as an item
|
int |
getCardinality()
Determine the static cardinality
|
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
|
ItemType |
getItemType(TypeHierarchy th)
Determine the data type of the items in the expression.
|
int |
getLength()
Get the length of the sequence
|
NodeInfo |
getNode()
Get the node that forms the node-set.
|
int |
getSpecialProperties()
Get the static properties of this expression (other than its type).
|
java.lang.String |
getStringValue()
Convert the value to a string, using the serialization rules.
|
Item |
itemAt(int n)
Get the n'th item in the sequence (starting from 0).
|
SequenceIterator |
iterate(XPathContext context)
Return an enumeration of this nodeset value.
|
void |
process(XPathContext context)
Process the instruction, without returning any tail calls
|
asItem, asIterator, asValue, checkPermittedContents, convert, convertJavaObjectToXPath, equals, getDependencies, getIterator, getParentExpression, getStringValueCS, hashCode, iterateSubExpressions, makeQNameValue, optimize, promote, reduce, simplify, stringToNumber, toString, typeCheckprotected NodeInfo node
public SingletonNode(NodeInfo node)
node - The node to be contained in the node-set, or null if the node-set
is to be emptypublic int getImplementationMethod()
public void process(XPathContext context) throws XPathException
process in interface Expressionprocess in class Valuecontext - The dynamic context, giving access to the current node,
the current variables, etc.XPathExceptionpublic ItemType getItemType(TypeHierarchy th)
getItemType in interface ExpressiongetItemType in class Valueth - public int getCardinality()
getCardinality in interface ExpressiongetCardinality in class ValueStaticProperty.ALLOWS_ONE,
StaticProperty.ALLOWS_ZERO_OR_MORE, StaticProperty.ALLOWS_ZERO_OR_ONE,
StaticProperty.ALLOWS_ONE_OR_MORE, StaticProperty.EMPTY. This default
implementation returns ZERO_OR_MORE (which effectively gives no
information).public int getLength()
throws XPathException
getLength in class ValueXPathExceptionpublic Item itemAt(int n) throws XPathException
itemAt in class ValueXPathExceptionpublic NodeInfo getNode()
public int getSpecialProperties()
getSpecialProperties in interface ExpressiongetSpecialProperties in class ValueStaticProperty.NON_CREATIVEpublic SequenceIterator iterate(XPathContext context)
context - The context in which the expression is to be evaluated. Note that this
context must contain a stackframe with sufficient slots to allow evaluation of any
variables contained in the expression (including variables allocated internally
by the optimizer)public Item evaluateItem(XPathContext context)
evaluateItem in interface ExpressionevaluateItem in class Valuecontext - The context in which the expression is to be evaluated. Note that this
context must contain a stackframe with sufficient slots to allow evaluation of any
variables contained in the expression (including variables allocated internally
by the optimizer)public boolean effectiveBooleanValue(XPathContext context)
effectiveBooleanValue in interface ExpressioneffectiveBooleanValue in class Valuecontext - The context in which the expression is to be evaluatedpublic java.lang.String getStringValue()
getStringValue in interface ValueRepresentationgetStringValue in class Valuepublic java.lang.String evaluateAsString(XPathContext context) throws XPathException
evaluateAsString in interface ExpressionevaluateAsString in class Valuecontext - The context in which the expression is to be evaluatedXPathException - if any dynamic error occurs evaluating the
expressionpublic void display(int depth,
java.io.PrintStream out,
Configuration config)
display in interface Expressiondisplay in class Valuedepth - indentation level for this expressionout - Output destinationpublic java.lang.Object convertToJava(java.lang.Class target,
XPathContext context)
throws XPathException
convertToJava in class ValueXPathException