net.sf.saxon.value
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.
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(int requiredType, XPathContext context)
Convert the value to a given type. |
AtomicValue | convert(AtomicType targetType, XPathContext context, boolean validate)
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, NamePool pool, PrintStream out)
Diagnostic print of expression structure
|
boolean | effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the value
|
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 String | getStringValue()
Convert the value to a string, using the serialization rules.
|
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
|
boolean | schemaEquals(Value obj)
Compare two values for equality. |
String | toString()
Get string value. |
Parameters: parentType The schema type env the static context whole true if this atomic value accounts for the entire content of the containing node
Throws: net.sf.saxon.trans.XPathException if the expression doesn't match the required content type
Parameters: requiredType type code of the required atomic type context
Returns: the result of the conversion, if conversion was possible. This will always be an instance of the class corresponding to the type of value requested
Throws: XPathException if conversion is not allowed for this required type, or if the particular value cannot be converted
Parameters: targetType the type to which the value is to be converted context provides access to conversion context validate true if validation is required, false if the caller already knows that the value is valid
Returns: the value after conversion if successful; or a ValidationErrorValue if conversion failed. The caller must check for this condition. Validation may fail even if validation was not requested.
Parameters: requiredType type code of the required atomic type validate 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.
Returns: the result of the conversion, if successful. If unsuccessful, the value returned will be an ErrorValue. The caller must check for this condition. No exception is thrown, instead the exception will be encapsulated within the ErrorValue.
Parameters: level the indentation level of the output out
Parameters: context the evaluation context (not used in this implementation)
Returns: true, unless the value is boolean false, numeric zero, or zero-length string
Parameters: context the evaluation context (not used in this implementation)
Returns: the value, unchanged
Throws: XPathException
Returns: code identifying the cardinality
See Also: Cardinality
Returns: always 1 for an atomic value
Returns: the typed value of the expression (which is this value)
Parameters: context the evaluation context (not used in this implementation)
Returns: a SequenceIterator that iterates over the single item in this value
Parameters: context The dynamic context, giving access to the current node, the current variables, etc.