public abstract class AtomicValue extends Value implements Item
The AtomicValue class contains some methods that are suitable for applications to use, and many others that are designed for internal use by Saxon itself. These have not been fully classified. At present, therefore, none of the methods on this class should be considered to be part of the public Saxon API.
EMPTY_CLASS_ARRAYEMPTY_VALUE_ARRAYEVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD| Constructor and Description |
|---|
AtomicValue() |
| Modifier and Type | Method and Description |
|---|---|
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,
XPathContext context)
Convert the value to a given type.
|
abstract AtomicValue |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context)
Convert a value to another primitive data type, with control over how validation is
handled.
|
void |
display(int level,
java.io.PrintStream out,
Configuration config)
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.
|
asItem, asIterator, asValue, convert, convertJavaObjectToXPath, convertToJava, equals, getDependencies, getItemType, getIterator, getParentExpression, getSpecialProperties, hashCode, itemAt, iterateSubExpressions, makeQNameValue, optimize, promote, reduce, simplify, stringToNumber, typeCheckpublic boolean hasBuiltInType()
public int getImplementationMethod()
getImplementationMethod in interface Expressionpublic java.lang.CharSequence getStringValueCS()
getStringValueCS in interface ItemgetStringValueCS in interface ValueRepresentationgetStringValueCS in class ValueItem.getStringValue()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 final int getCardinality()
getCardinality in interface ExpressiongetCardinality in class ValueCardinalitypublic final AtomicValue convert(int requiredType, XPathContext context) throws XPathException
requiredType - type code of the required atomic typecontext - 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, XPathContext context)
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.context - The conversion context to be used. This is required at present only when converting to
a date or time: it provides the implicit timezone.public AtomicValue convert(AtomicType targetType, XPathContext context, boolean validate)
targetType - the type to which the value is to be convertedcontext - provides access to conversion contextvalidate - true if validation is required, false if the caller already knows that the
value is validValidationErrorValue if conversion failed. The
caller must check for this condition. Validation may fail even if validation was not requested.public final int getLength()
public Item evaluateItem(XPathContext context) throws XPathException
evaluateItem in interface ExpressionevaluateItem in class Valuecontext - the evaluation context (not used in this implementation)XPathExceptionpublic final SequenceIterator iterate(XPathContext context)
iterate in interface Expressioncontext - the evaluation context (not used in this implementation)public final java.lang.String evaluateAsString(XPathContext context)
evaluateAsString in interface ExpressionevaluateAsString in class Valuecontext - The context in which the expression is to be evaluatedpublic abstract java.lang.String getStringValue()
getStringValue in interface ItemgetStringValue in interface ValueRepresentationgetStringValue in class ValueItem.getStringValueCS()public final SequenceIterator getTypedValue()
getTypedValue in interface Itempublic AtomicValue getPrimitiveValue()
Type.isPrimitiveType(int)
It may also return a RestrictedStringValue, because that is a subclass of
StringValue.public boolean effectiveBooleanValue(XPathContext context) throws XPathException
effectiveBooleanValue in interface ExpressioneffectiveBooleanValue in class Valuecontext - the evaluation context (not used in this implementation)XPathException - if any dynamic error occurs evaluating the
expressionpublic AtomicValue getComponent(int component) throws XPathException
XPathExceptionpublic void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException
checkPermittedContents in interface ExpressioncheckPermittedContents in class ValueparentType - The schema typeenv - the static contextwhole - true if this atomic value accounts for the entire content of the containing nodeXPathException - if the expression doesn't match the required content typepublic java.lang.String toString()
public final void display(int level,
java.io.PrintStream out,
Configuration config)
display in interface Expressiondisplay in class Valuelevel - the indentation level of the outputout - config -