PullEvent
, ValueRepresentation<T>
DocumentInfo
, FunctionItem<T>
, MutableNodeInfo
, NodeInfo
, SiblingCountingNode
, VirtualNode
AbsentExtensionElement
, AbstractVirtualNode
, AnyURIValue
, AtomicValue
, AttributeImpl
, Base64BinaryValue
, BigIntegerValue
, BooleanValue
, CalendarValue
, CommentImpl
, DataElement
, DateTimeValue
, DateValue
, DayTimeDurationValue
, DecimalValue
, DocumentImpl
, DocumentWrapper
, DocumentWrapper
, DocumentWrapper
, DocumentWrapper
, DoubleValue
, DurationValue
, ElementImpl
, ExtensionInstruction
, FloatValue
, GDateValue
, GDayValue
, GMonthDayValue
, GMonthValue
, GYearMonthValue
, GYearValue
, HexBinaryValue
, Int64Value
, IntegerValue
, LiteralResultElement
, NamespaceNode
, NodeImpl
, NodeWrapper
, NodeWrapper
, NodeWrapper
, NodeWrapper
, NotationValue
, NumericValue
, ObjectValue
, Orphan
, ParentNodeImpl
, ProcInstImpl
, QNameValue
, QualifiedNameValue
, SpaceStrippedDocument
, SpaceStrippedNode
, SQLClose
, SQLColumn
, SQLConnect
, SQLDelete
, SQLExecute
, SQLInsert
, SQLQuery
, SQLUpdate
, StringValue
, StyleElement
, TextFragmentValue
, TextImpl
, TimeValue
, TinyAttributeImpl
, TinyCommentImpl
, TinyDocumentImpl
, TinyElementImpl
, TinyNodeImpl
, TinyParentNodeImpl
, TinyProcInstImpl
, TinyTextImpl
, Tuple
, TypeStrippedDocument
, TypeStrippedNode
, UntypedAtomicValue
, VirtualCopy
, VirtualDocumentCopy
, VirtualUntypedCopy
, WhitespaceTextImpl
, XSLAnalyzeString
, XSLApplyImports
, XSLApplyTemplates
, XSLAttribute
, XSLAttributeSet
, XSLCallTemplate
, XSLCharacterMap
, XSLChoose
, XSLComment
, XSLCopy
, XSLCopyOf
, XSLDecimalFormat
, XSLDocument
, XSLElement
, XSLFallback
, XSLForEach
, XSLForEachGroup
, XSLFunction
, XSLGeneralIncorporate
, XSLGeneralVariable
, XSLIf
, XSLImport
, XSLImportSchema
, XSLInclude
, XSLKey
, XSLLeafNodeConstructor
, XSLMatchingSubstring
, XSLMessage
, XSLNamespace
, XSLNamespaceAlias
, XSLNextMatch
, XSLNumber
, XSLOtherwise
, XSLOutput
, XSLOutputCharacter
, XSLParam
, XSLPerformSort
, XSLPreserveSpace
, XSLProcessingInstruction
, XSLResultDocument
, XSLSequence
, XSLSort
, XSLSortOrMergeKey
, XSLStylesheet
, XSLTemplate
, XSLText
, XSLValueOf
, XSLVariable
, XSLVariableDeclaration
, XSLWhen
, XSLWithParam
, YearMonthDurationValue
public interface Item<T extends Item> extends ValueRepresentation<T>, PullEvent
This interface is part of the public Saxon API. As such (starting from Saxon 8.4), methods that form part of the stable API are labelled with a JavaDoc "since" tag to identify the Saxon release at which they were introduced.
Note: there is no method getItemType(). This is to avoid having to implement it on every implementation of NodeInfo. Instead, use the static method Type.getItemType(Item).
EMPTY_VALUE_ARRAY
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getStringValue() |
Get the value of the item as a string.
|
java.lang.CharSequence |
getStringValueCS() |
Get the string value of the item as a CharSequence.
|
SequenceIterator<? extends AtomicValue> |
getTypedValue() |
Get the typed value of the item.
|
java.lang.String getStringValue()
If the calling code can handle any CharSequence, the method getStringValueCS()
should
be used. If the caller requires a string, this method is preferred.
getStringValue
in interface ValueRepresentation<T extends Item>
java.lang.UnsupportedOperationException
- if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValueCS()
java.lang.CharSequence getStringValueCS()
X.getStringValueCS().toString()
returns a string that is equal to
X.getStringValue()
.
Note that two CharSequence values of different types should not be compared using equals(), and for the same reason they should not be used as a key in a hash table.
If the calling code can handle any CharSequence, this method should
be used. If the caller requires a string, the getStringValue()
method is preferred.
getStringValueCS
in interface ValueRepresentation<T extends Item>
java.lang.UnsupportedOperationException
- if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValue()
SequenceIterator<? extends AtomicValue> getTypedValue() throws XPathException
For a node, this is the typed value as defined in the XPath 2.0 data model. Since a node may have a list-valued data type, the typed value is in general a sequence, and it is returned in the form of a SequenceIterator.
If the node has not been validated against a schema, the typed value will be the same as the string value, either as an instance of xs:string or as an instance of xs:untypedAtomic, depending on the node kind.
For an atomic value, this method returns an iterator over a singleton sequence containing the atomic value itself.
XPathException
- where no typed value is available, for example in the case of
an element with complex content