|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.data.saxon.DocumentNode
public class DocumentNode
A document node in the C24 Integreation Objects data model. This does not correspond to any actual object in the model, but is linked to the ComplexDataObject representing the outermost element.
This class implements the Saxon DocumentInfo interface representing a document node; it therefore also implements NodeInfo interface representing a Node in the XDM data model. It also implements the JAXP Source interface, allowing it to be used directly as the source of an XSLT transformation.
Field Summary |
---|
Fields inherited from interface net.sf.saxon.om.NodeInfo |
---|
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES |
Constructor Summary | |
---|---|
DocumentNode(net.sf.saxon.Configuration config,
ComplexDataObject outermost)
Creates a new namespace aware instance. |
|
DocumentNode(net.sf.saxon.Configuration config,
ComplexDataObject outermost,
boolean ignoreDocumentNode,
boolean namespaceAware)
Create a new instance. |
Method Summary | |
---|---|
net.sf.saxon.value.Value |
atomize()
Get the typed value. |
int |
compareOrder(net.sf.saxon.om.NodeInfo other)
Determine the relative position of this node and another node, in document order. |
void |
copy(net.sf.saxon.event.Receiver out,
int whichNamespaces,
boolean copyAnnotations,
int locationId)
Copy this node to a given outputter. |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
void |
generateId(net.sf.saxon.om.FastStringBuffer buffer)
Construct a character string that uniquely identifies this node. |
String |
getAttributeValue(int fingerprint)
Get the string value of a given attribute of this node |
String |
getBaseURI()
Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node. |
net.sf.saxon.Configuration |
getConfiguration()
Get the configuration used to build the tree containing this node. |
int[] |
getDeclaredNamespaces(int[] buffer)
Get all namespace undeclarations and undeclarations defined on this element. |
String |
getDisplayName()
Get the display name of this node, in the form of a lexical QName. |
int |
getDocumentNumber()
Get the document number of the document containing this node. |
net.sf.saxon.om.DocumentInfo |
getDocumentRoot()
Get the root node, if it is a document node. |
int |
getFingerprint()
Get fingerprint. |
int |
getLineNumber()
Get line number. |
String |
getLocalPart()
Get the local part of the name of this node. |
int |
getNameCode()
Get name code. |
net.sf.saxon.om.NamePool |
getNamePool()
Get the NamePool that holds the namecode for this node |
int |
getNodeKind()
Get the kind of node. |
net.sf.saxon.om.NodeInfo |
getParent()
Get the NodeInfo object representing the parent of this node |
String |
getPrefix()
Get the prefix of the name of the node. |
int |
getRelativePosition()
Get the position of this node relative to its siblings |
net.sf.saxon.om.NodeInfo |
getRoot()
Get the root node of the tree containing this node |
String |
getStringValue()
Return the string value of the node. |
CharSequence |
getStringValueCS()
Get the string value of the item as a CharSequence. |
String |
getSystemId()
Get the System ID for the node. |
int |
getTypeAnnotation()
Get the type annotation of this node, if any. |
net.sf.saxon.om.SequenceIterator |
getTypedValue()
Get the typed value of the item. |
Object |
getUnderlyingObject()
Returns the underlying object, such as the String, Integer, Date, or ComplexDataObject. |
String[] |
getUnparsedEntity(String name)
Get the unparsed entity with a given name |
String |
getURI()
Get the URI part of the name of this node. |
boolean |
hasChildNodes()
Determine whether the node has any children. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isIgnoreDocumentNode()
Returns whether this node will be ignored whilst traversing the descendant axis. |
boolean |
isNamespaceAware()
Returns whether this is a namespace aware node. |
boolean |
isSameNodeInfo(net.sf.saxon.om.NodeInfo other)
Determine whether this is the same node as another node. |
net.sf.saxon.om.AxisIterator |
iterateAxis(byte axisNumber)
Return an iteration over all the nodes reached by the given axis from this node |
net.sf.saxon.om.AxisIterator |
iterateAxis(byte axisNumber,
net.sf.saxon.pattern.NodeTest nodeTest)
Return an iteration over all the nodes reached by the given axis from this node that match a given NodeTest |
net.sf.saxon.om.NodeInfo |
selectID(String id)
Get the element with a given ID, if any |
void |
sendNamespaceDeclarations(net.sf.saxon.event.Receiver out,
boolean includeAncestors)
Output all namespace declarations associated with this element. |
void |
setSystemId(String systemId)
Set the system identifier for this Source. |
static int |
signum(int c)
Convenience method: return the signum of an integer |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentNode(net.sf.saxon.Configuration config, ComplexDataObject outermost)
config
- The Saxon configuration.outermost
- The root object.public DocumentNode(net.sf.saxon.Configuration config, ComplexDataObject outermost, boolean ignoreDocumentNode, boolean namespaceAware)
config
- The Saxon configuration.outermost
- The root object.ignoreDocumentNode
- Whether to skip the document node whilst traversing the descendant axis.namespaceAware
- Whether to create a namespace aware node.Method Detail |
---|
public Object getUnderlyingObject()
DataNode
getUnderlyingObject
in interface DataNode
public boolean isIgnoreDocumentNode()
public boolean isNamespaceAware()
public int getRelativePosition()
getRelativePosition
in interface Node
public String[] getUnparsedEntity(String name)
getUnparsedEntity
in interface net.sf.saxon.om.DocumentInfo
name
- the name of the entity
public net.sf.saxon.om.NodeInfo selectID(String id)
selectID
in interface net.sf.saxon.om.DocumentInfo
id
- the required ID value
public net.sf.saxon.value.Value atomize() throws net.sf.saxon.trans.XPathException
Item.getTypedValue()
. However, this method is often more convenient and may be
more efficient, especially in the common case where the value is expected to be a singleton.
atomize
in interface net.sf.saxon.om.NodeInfo
net.sf.saxon.trans.XPathException
public int compareOrder(net.sf.saxon.om.NodeInfo other)
compareOrder
in interface net.sf.saxon.om.NodeInfo
other
- The other node, whose position is to be compared with this
node
public static int signum(int c)
c
- a signed integer
public void copy(net.sf.saxon.event.Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws net.sf.saxon.trans.XPathException
copy
in interface net.sf.saxon.om.NodeInfo
out
- the Receiver to which the node should be copiedwhichNamespaces
- in the case of an element, controls
which namespace nodes should be copied. Values are NodeInfo.NO_NAMESPACES
,
NodeInfo.LOCAL_NAMESPACES
, NodeInfo.ALL_NAMESPACES
copyAnnotations
- indicates whether the type annotations
of element and attribute nodes should be copiedlocationId
- If non-zero, identifies the location of the instruction
that requested this copy. If zero, indicates that the location information
for the original node is to be copied; in this case the Receiver must be
a LocationCopier
net.sf.saxon.trans.XPathException
public void generateId(net.sf.saxon.om.FastStringBuffer buffer)
generateId
in interface net.sf.saxon.om.NodeInfo
buffer
- a buffer which will be updated to hold a string
that uniquely identifies this node, across all documents.Changed in Saxon 8.7 to generate the ID value in a client-supplied buffer
public String getAttributeValue(int fingerprint)
getAttributeValue
in interface net.sf.saxon.om.NodeInfo
fingerprint
- The fingerprint of the attribute name
public String getBaseURI()
getBaseURI
in interface net.sf.saxon.om.NodeInfo
public net.sf.saxon.Configuration getConfiguration()
getConfiguration
in interface net.sf.saxon.om.NodeInfo
public int[] getDeclaredNamespaces(int[] buffer)
iterateAxis(Axis.NAMESPACE)
.
getDeclaredNamespaces
in interface net.sf.saxon.om.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.
public String getDisplayName()
getDisplayName
in interface net.sf.saxon.om.NodeInfo
public int getDocumentNumber()
getDocumentNumber
in interface net.sf.saxon.om.NodeInfo
public net.sf.saxon.om.DocumentInfo getDocumentRoot()
getDocumentRoot
in interface net.sf.saxon.om.NodeInfo
public int getFingerprint()
getFingerprint
in interface net.sf.saxon.om.NodeInfo
public int getLineNumber()
getLineNumber
in interface net.sf.saxon.om.NodeInfo
public String getLocalPart()
getLocalPart
in interface net.sf.saxon.om.NodeInfo
public int getNameCode()
NamePool.FP_MASK
, you get a
fingerprint: two nodes with the same fingerprint have the same local name
and namespace URI.
getNameCode
in interface net.sf.saxon.om.NodeInfo
allocate
,
getFingerprint
public net.sf.saxon.om.NamePool getNamePool()
getNamePool
in interface net.sf.saxon.om.NodeInfo
public int getNodeKind()
Type.ELEMENT
or Type.ATTRIBUTE
. There are seven kinds of node: documents, elements, attributes,
text, comments, processing-instructions, and namespaces.
getNodeKind
in interface net.sf.saxon.om.NodeInfo
Type
public net.sf.saxon.om.NodeInfo getParent()
getParent
in interface net.sf.saxon.om.NodeInfo
public String getPrefix()
getPrefix
in interface net.sf.saxon.om.NodeInfo
public net.sf.saxon.om.NodeInfo getRoot()
getRoot
in interface net.sf.saxon.om.NodeInfo
public String getStringValue()
getStringValue
in interface net.sf.saxon.om.Item
getStringValue
in interface net.sf.saxon.om.NodeInfo
getStringValue
in interface net.sf.saxon.om.ValueRepresentation
public String getSystemId()
getSystemId
in interface Source
getSystemId
in interface net.sf.saxon.om.NodeInfo
public int getTypeAnnotation()
Configuration.getSchemaType(int)
.
The bit IS_DTD_TYPE (1<<30) will be set in the case of an attribute node if the type annotation
is one of ID, IDREF, or IDREFS and this is derived from DTD rather than schema validation.
getTypeAnnotation
in interface net.sf.saxon.om.NodeInfo
The result is undefined for nodes other than elements and attributes.
public String getURI()
getURI
in interface net.sf.saxon.om.NodeInfo
public boolean hasChildNodes()
iterateAxis(Axis.CHILD).next() != null
hasChildNodes
in interface net.sf.saxon.om.NodeInfo
public boolean isSameNodeInfo(net.sf.saxon.om.NodeInfo other)
isSameNodeInfo
in interface net.sf.saxon.om.NodeInfo
other
- the node to be compared with this node
public boolean equals(Object obj)
equals
in interface net.sf.saxon.om.NodeInfo
equals
in class Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.hashCode()
public int hashCode()
hashCode
in interface net.sf.saxon.om.NodeInfo
hashCode
in class Object
Object.equals(Object)
public net.sf.saxon.om.AxisIterator iterateAxis(byte axisNumber)
iterateAxis
in interface net.sf.saxon.om.NodeInfo
axisNumber
- an integer identifying the axis; one of the constants
defined in class Axis
UnsupportedOperationException
- if the namespace axis is
requested and this axis is not supported for this implementation.Axis
public net.sf.saxon.om.AxisIterator iterateAxis(byte axisNumber, net.sf.saxon.pattern.NodeTest nodeTest)
iterateAxis
in interface net.sf.saxon.om.NodeInfo
axisNumber
- an integer identifying the axis; one of the constants
defined in class Axis
nodeTest
- A pattern to be matched by the returned nodes; nodes
that do not match this pattern are not included in the result
UnsupportedOperationException
- if the namespace axis is
requested and this axis is not supported for this implementation.Axis
public void sendNamespaceDeclarations(net.sf.saxon.event.Receiver out, boolean includeAncestors) throws net.sf.saxon.trans.XPathException
out
- The relevant ReceiverincludeAncestors
- True if namespaces declared on ancestor
elements must be output; false if it is known that these are
net.sf.saxon.trans.XPathException
public void setSystemId(String systemId)
The system identifier is optional if the source does not get its data from a URL, but it may still be useful to provide one. The application can use a system identifier, for example, to resolve relative URIs and to include in error messages and warnings.
setSystemId
in interface Source
systemId
- The system identifier as a URL string.public 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 net.sf.saxon.om.Item
getStringValueCS
in interface net.sf.saxon.om.ValueRepresentation
getStringValue()
public net.sf.saxon.om.SequenceIterator getTypedValue() throws net.sf.saxon.trans.XPathException
getTypedValue
in interface net.sf.saxon.om.Item
net.sf.saxon.trans.XPathException
- where no typed value is available, for example in the case of
an element with complex content
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |