public class ElementImpl extends ParentNodeImpl
This class is an implementation of NodeInfo. The object is a wrapper around one entry in the arrays maintained by the LazyTree. Note that the same node might be represented by different LazyElementImpl objects at different times.
Modifier and Type | Field and Description |
---|---|
(package private) int[] |
attrNames |
(package private) String[] |
attrValues |
(package private) int |
nameSpace |
childNum
document, nameCode, nextSibNum, NODE_LETTER, nodeNum, parentNum, prevSibNum
Constructor and Description |
---|
ElementImpl() |
Modifier and Type | Method and Description |
---|---|
void |
copy(Receiver out,
int whichNamespaces,
boolean copyAnnotations,
int locationId)
Copy this node to a given receiver
|
String |
getAttributeValue(int fingerprint)
Get the value of a given attribute of this node
|
String |
getBaseURI()
Get the base URI of this element node.
|
int[] |
getDeclaredNamespaces(int[] buffer)
Get all namespace undeclarations and undeclarations defined on this element.
|
(package private) static int[] |
getDeclaredNamespaces(LazyDocument doc,
int nodeNr,
int nameSpace,
int[] buffer)
Static method to get all namespace undeclarations and undeclarations defined on a given element,
without instantiating the node object.
|
int |
getNodeKind()
Return the type of node.
|
int |
getTypeAnnotation()
Get the type annotation of this node, if any
Returns Type.UNTYPED_ANY if there is no type annotation
|
void |
init(int attrOffset,
int nameSpace)
Optional initialization function, depends on derived class
|
void |
sendNamespaceDeclarations(Receiver out,
boolean includeAncestors)
Output all namespace nodes associated with this element.
|
enumerateChildren, getFirstChild, getLastChild, getStringValue, getStringValueCS, hasChildNodes, iterateAxis, iterateAxis
atomize, compareOrder, equals, generateId, getColumnNumber, getConfiguration, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getNextInDocument, getNextSibling, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getRoot, getSequenceNumber, getSystemId, getTypedValue, getURI, hashCode, isSameNodeInfo, setSystemId
public void init(int attrOffset, int nameSpace) throws IOException
NodeImpl
public final int getNodeKind()
public String getBaseURI()
getBaseURI
in interface NodeInfo
getBaseURI
in class NodeImpl
public int getTypeAnnotation()
getTypeAnnotation
in interface NodeInfo
getTypeAnnotation
in class NodeImpl
public void sendNamespaceDeclarations(Receiver out, boolean includeAncestors) throws XPathException
sendNamespaceDeclarations
in interface NodeInfo
sendNamespaceDeclarations
in class NodeImpl
out
- The relevant outputterincludeAncestors
- True if namespaces associated with ancestorXPathException
public int[] getDeclaredNamespaces(int[] buffer)
getDeclaredNamespaces
in interface NodeInfo
getDeclaredNamespaces
in class NodeImpl
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.
static int[] getDeclaredNamespaces(LazyDocument doc, int nodeNr, int nameSpace, int[] buffer)
doc
- The lazy document containing the given element nodenodeNr
- The node number of the given element node within the tinyTreebuffer
- 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 String getAttributeValue(int fingerprint)
getAttributeValue
in interface NodeInfo
getAttributeValue
in class NodeImpl
fingerprint
- The fingerprint of the attribute namepublic void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException
whichNamespaces
- indicates which namespaces should be copied: all, none,
or local (i.e., those not declared on a parent element)XPathException