public final class TextFragmentValue extends GenericTreeInfo implements NodeInfo, SourceLocator
ALL_NAMESPACES, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES
Constructor and Description |
---|
TextFragmentValue(Configuration config,
CharSequence value,
String baseURI)
Constructor: create a result tree fragment containing a single text node
|
Modifier and Type | Method and Description |
---|---|
AtomicSequence |
atomize()
Get the typed value.
|
int |
compareOrder(NodeInfo other)
Determine the relative position of this node and another node, in document order.
|
int |
comparePosition(NodeInfo other)
Determine the relative position of this node and another node, in document order,
distinguishing whether the first node is a preceding, following, descendant, ancestor,
or the same node as the second.
|
void |
copy(Receiver out,
int copyOptions,
Location locationId)
Copy the result tree fragment value to a given Outputter
|
void |
generateId(FastStringBuffer buffer)
Get a character string that uniquely identifies this node
|
String |
getAttributeValue(String uri,
String local)
Get the string value of a given attribute of this node
|
String |
getBaseURI()
Get the base URI for the document node.
|
int |
getColumnNumber()
Return the character position where the current document event ends.
|
NamespaceBinding[] |
getDeclaredNamespaces(NamespaceBinding[] buffer)
Get all namespace undeclarations and undeclarations defined on this element.
|
String |
getDisplayName()
Get the display name of this node.
|
int |
getFingerprint()
Get the fingerprint of the node, used for matching names
|
int |
getLineNumber()
Get line number
|
String |
getLocalPart()
Get the local name of this node.
|
int |
getNodeKind()
Return the type of node.
|
NodeInfo |
getParent()
Find the parent node of this node.
|
String |
getPrefix()
Get the prefix part of the name of this node.
|
String |
getPublicId()
Return the public identifier for the current document event.
|
NodeInfo |
getRoot()
Get the root node
|
NodeInfo |
getRootNode()
Get the NodeInfo object representing the document node at the root of the tree
|
SchemaType |
getSchemaType()
Get the type annotation of this node, if any.
|
String |
getStringValue()
Get the String Value
|
CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence.
|
String |
getSystemId()
Get the system ID (the document URI) of the document node.
|
TreeInfo |
getTreeInfo()
Get information about the tree to which this NodeInfo belongs
|
String[] |
getUnparsedEntity(String name)
Get the unparsed entity with a given name
|
Iterator<String> |
getUnparsedEntityNames()
Get the list of unparsed entities defined in this document
|
String |
getURI()
Get the URI part of the name of this node.
|
boolean |
hasChildNodes()
Determine whether the node has any children.
|
NodeInfo |
head()
To implement
Sequence , this method returns the item itself |
boolean |
isId()
Determine whether this node has the is-id property
|
boolean |
isIdref()
Determine whether this node has the is-idref property
|
boolean |
isNilled()
Determine whether the node has the is-nilled property
|
boolean |
isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node
|
boolean |
isTyped()
Ask whether the document contains any nodes whose type annotation is anything other than
UNTYPED
|
SequenceIterator |
iterate()
To implement
Sequence , this method returns a singleton iterator
that delivers this item in the form of a sequence |
AxisIterator |
iterateAxis(byte axisNumber)
Return an iteration over the nodes reached by the given axis from this node
|
AxisIterator |
iterateAxis(byte axisNumber,
NodeTest nodeTest)
Return an enumeration over the nodes reached by the given axis from this node
|
Location |
saveLocation()
Get an immutable copy of this Location object.
|
NodeInfo |
selectID(String id,
boolean getParent)
Get the element with a given ID.
|
void |
setSystemId(String systemId)
Set the system ID (that is, the document URI property) for the document node.
|
getConfiguration, getDocumentNumber, getUserData, setConfiguration, setDocumentNumber, setRootNode, setUserData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, getConfiguration, hashCode
public TextFragmentValue(Configuration config, CharSequence value, String baseURI)
value
- a String containing the valuebaseURI
- the base URI of the document nodepublic TreeInfo getTreeInfo()
getTreeInfo
in interface NodeInfo
public NodeInfo getRootNode()
getRootNode
in interface TreeInfo
getRootNode
in class GenericTreeInfo
public SequenceIterator iterate()
Sequence
, this method returns a singleton iterator
that delivers this item in the form of a sequencepublic boolean isTyped()
isTyped
in interface TreeInfo
isTyped
in class GenericTreeInfo
public final int getNodeKind()
getNodeKind
in interface NodeInfo
Type
public String getStringValue()
getStringValue
in interface Item
getStringValue
in interface NodeInfo
Item.getStringValueCS()
public CharSequence getStringValueCS()
getStringValueCS
in interface Item
Item.getStringValue()
public boolean isSameNodeInfo(NodeInfo other)
isSameNodeInfo
in interface NodeInfo
other
- the node to be compared with this nodepublic void generateId(FastStringBuffer buffer)
generateId
in interface NodeInfo
buffer
- the buffer to contain the generated IDpublic void setSystemId(String systemId)
setSystemId
in interface Source
setSystemId
in class GenericTreeInfo
systemId
- the system IDUnsupportedOperationException
- (always). This kind of tree does not have a document URI.public String getSystemId()
getSystemId
in interface Source
getSystemId
in interface SourceLocator
getSystemId
in interface Location
getSystemId
in interface NodeInfo
getSystemId
in interface Locator
getSystemId
in class GenericTreeInfo
public String getBaseURI()
getBaseURI
in interface NodeInfo
public int compareOrder(NodeInfo other)
compareOrder
in interface NodeInfo
other
- The other node, whose position is to be compared with this nodepublic int comparePosition(NodeInfo other)
comparePosition
in interface NodeInfo
other
- The other node, whose position is to be compared with this
nodeAxisInfo.PRECEDING
if this node is on the preceding axis of the other node;
AxisInfo.FOLLOWING
if it is on the following axis; AxisInfo.ANCESTOR
if the first node is an
ancestor of the second; AxisInfo.DESCENDANT
if the first is a descendant of the second;
AxisInfo.SELF
if they are the same node.UnsupportedOperationException
- if either node is an attribute or namespacepublic int getFingerprint()
public String getPrefix()
public String getURI()
public String getDisplayName()
getDisplayName
in interface NodeInfo
public String getLocalPart()
getLocalPart
in interface NodeInfo
public boolean hasChildNodes()
hasChildNodes
in interface NodeInfo
true
if this node has any attributes,
false
otherwise.public int getLineNumber()
getLineNumber
in interface SourceLocator
getLineNumber
in interface Location
getLineNumber
in interface NodeInfo
getLineNumber
in interface Locator
public Location saveLocation()
saveLocation
in interface Location
public SchemaType getSchemaType()
Types derived from a DTD are not reflected in the result of this method.
getSchemaType
in interface NodeInfo
public NamespaceBinding[] getDeclaredNamespaces(NamespaceBinding[] buffer)
getDeclaredNamespaces
in interface NodeInfo
buffer
- If this is non-null, and the result array fits in this buffer, then the result
may overwrite the contents of this array, to avoid the cost of allocating a new array on the heap.For a node other than an element, the method returns null.
public AtomicSequence atomize()
public String getPublicId()
The return value is the public identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.
getPublicId
in interface SourceLocator
getPublicId
in interface Location
getPublicId
in interface NodeInfo
getPublicId
in interface Locator
getPublicId
in class GenericTreeInfo
getSystemId()
public int getColumnNumber()
Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
The return value is an approximation of the column number in the document entity or external parsed entity where the markup that triggered the event appears.
getColumnNumber
in interface SourceLocator
getColumnNumber
in interface Location
getColumnNumber
in interface NodeInfo
getColumnNumber
in interface Locator
getLineNumber()
public String getAttributeValue(String uri, String local)
getAttributeValue
in interface NodeInfo
uri
- the namespace URI of the attribute name. Supply the empty string for an attribute
that is in no namespacelocal
- the local part of the attribute name.public AxisIterator iterateAxis(byte axisNumber)
iterateAxis
in interface NodeInfo
axisNumber
- The axis to be iterated overAxisInfo
public AxisIterator iterateAxis(byte axisNumber, NodeTest nodeTest)
iterateAxis
in interface NodeInfo
axisNumber
- The axis to be iterated overnodeTest
- A pattern to be matched by the returned nodesAxisInfo
public NodeInfo getParent()
public NodeInfo getRoot()
public void copy(Receiver out, int copyOptions, Location locationId) throws XPathException
copy
in interface NodeInfo
out
- the Receiver to which the node should be copied. It is the caller's
responsibility to ensure that this Receiver is open before the method is called
(or that it is self-opening), and that it is closed after use.copyOptions
- a selection of the options defined in CopyOptions
locationId
- If non-null, identifies the location of the instruction
that requested this copy. If zero, indicates that the location information
is not availableXPathException
- if any downstream error occurspublic NodeInfo selectID(String id, boolean getParent)
selectID
in interface TreeInfo
selectID
in class GenericTreeInfo
id
- The unique ID of the required elementgetParent
- True if, in the case of an element of type xs:ID, we want its parentpublic Iterator<String> getUnparsedEntityNames()
getUnparsedEntityNames
in interface TreeInfo
getUnparsedEntityNames
in class GenericTreeInfo
public String[] getUnparsedEntity(String name)
getUnparsedEntity
in interface TreeInfo
getUnparsedEntity
in class GenericTreeInfo
name
- the name of the entitypublic boolean isId()
public boolean isIdref()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.