|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.value.Value
net.sf.saxon.value.AtomicValue
A AtomicValue is a value that isn't a sequence and isn't a node. More strictly, it is any sequence of length one whose content is not a node.
Field Summary |
Fields inherited from interface net.sf.saxon.expr.Expression |
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
AtomicValue()
|
Method Summary | |
void |
checkPermittedContents(SchemaType parentType,
StaticContext env,
boolean whole)
Check statically that the results of the expression are capable of constructing the content of a given schema type. |
AtomicValue |
convert(AtomicType targetType,
XPathContext context,
boolean validate)
Convert the value to a given type. |
AtomicValue |
convert(int requiredType)
Convert the value to a given type. |
abstract AtomicValue |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate)
Convert a value to another primitive data type, with control over how validation is handled. |
void |
display(int level,
NamePool pool,
java.io.PrintStream out)
Diagnostic print of expression structure |
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the value |
java.lang.String |
evaluateAsString(XPathContext context)
Evaluate as a string |
Item |
evaluateItem(XPathContext context)
Evaluate the value (this simply returns the value unchanged) |
int |
getCardinality()
Determine the static cardinality |
AtomicValue |
getComponent(int component)
Method to extract components of a value. |
int |
getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). |
int |
getLength()
Get the length of the sequence |
AtomicValue |
getPrimitiveValue()
Get the primitive value (the value in the value space). |
abstract java.lang.String |
getStringValue()
Convert the value to a string, using the serialization rules. |
java.lang.CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence. |
SequenceIterator |
getTypedValue()
Get the typed value of this item |
boolean |
hasBuiltInType()
Test whether the type of this atomic value is a built-in type. |
SequenceIterator |
iterate(XPathContext context)
Iterate over the (single) item in the sequence |
void |
process(XPathContext context)
Process the instruction, without returning any tail calls |
java.lang.String |
toString()
Get string value. |
Methods inherited from class net.sf.saxon.value.Value |
analyze, asItem, asValue, collapseWhitespace, convert, convertJavaObjectToXPath, convertToJava, equals, getDependencies, getItemType, getIterator, getParentExpression, getSpecialProperties, hashCode, itemAt, iterateSubExpressions, makeQNameValue, normalizeWhitespace, promote, simplify, stringToNumber, trimWhitespace |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AtomicValue()
Method Detail |
public boolean hasBuiltInType()
public int getImplementationMethod()
getImplementationMethod
in interface Expression
public void process(XPathContext context) throws XPathException
process
in interface Expression
process
in class Value
context
- The dynamic context, giving access to the current node,
the current variables, etc.
XPathException
public final int getCardinality()
getCardinality
in interface Expression
getCardinality
in class Value
Cardinality
public final AtomicValue convert(int requiredType) throws XPathException
requiredType
- type code of the required atomic type
XPathException
- if conversion is not allowed for this
required type, or if the particular value cannot be convertedpublic abstract AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate)
requiredType
- type code of the required atomic typevalidate
- true if validation is required. If set to false, the caller guarantees that
the value is valid for the target data type, and that further validation is therefore not required.
Note that a validation failure may be reported even if validation was not requested.
public AtomicValue convert(AtomicType targetType, XPathContext context, boolean validate)
targetType
- the type to which the value is to be convertedcontext
- the evaluation contextvalidate
- true if validation is required, false if the caller already knows that the
value is valid
public final int getLength()
getLength
in class Value
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface Expression
evaluateItem
in class Value
context
- the evaluation context (not used in this implementation)
XPathException
public final SequenceIterator iterate(XPathContext context)
iterate
in interface Expression
context
- the evaluation context (not used in this implementation)
public final java.lang.String evaluateAsString(XPathContext context)
evaluateAsString
in interface Expression
evaluateAsString
in class Value
context
- The context in which the expression is to be evaluated
public abstract java.lang.String getStringValue()
getStringValue
in interface Item
getStringValue
in class Value
public java.lang.CharSequence getStringValueCS()
getStringValueCS
in interface Item
public final SequenceIterator getTypedValue()
getTypedValue
in interface Item
public AtomicValue getPrimitiveValue()
Type.isPrimitiveType(int)
public boolean effectiveBooleanValue(XPathContext context) throws XPathException
effectiveBooleanValue
in interface Expression
effectiveBooleanValue
in class Value
context
- the evaluation context (not used in this implementation)
XPathException
- if any dynamic error occurs evaluating the
expressionpublic AtomicValue getComponent(int component) throws XPathException
XPathException
public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException
checkPermittedContents
in interface Expression
checkPermittedContents
in class Value
parentType
- The schema typeenv
- the static contextwhole
- true if this atomic value accounts for the entire content of the containing node
XPathException
- if the expression doesn't match the required content typepublic java.lang.String toString()
toString
in class Value
public final void display(int level, NamePool pool, java.io.PrintStream out)
display
in interface Expression
display
in class Value
level
- the indentation level of the outputout
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |