public class ElementImpl extends ParentNodeImpl
This class is an implementation of NodeInfo. For elements with attributes or namespace declarations, class ElementWithAttributes is used.
| Modifier and Type | Field and Description |
|---|---|
protected int |
nameCode |
protected DocumentImpl |
root |
sequenceindex, NODE_LETTER, parentALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACESEMPTY_VALUE_ARRAY| Constructor and Description |
|---|
ElementImpl()
Construct an empty ElementImpl
|
| Modifier and Type | Method and Description |
|---|---|
void |
copy(Receiver out,
int whichNamespaces,
boolean copyAnnotations,
int locationId)
Copy this node to a given outputter (supporting xsl:copy-of)
|
void |
generateId(FastStringBuffer buffer)
Get a character string that uniquely identifies this node
|
AttributeCollection |
getAttributeList()
Get the attribute list for this element.
|
java.lang.String |
getBaseURI()
Get the base URI of this element node.
|
int[] |
getDeclaredNamespaces(int[] buffer)
Get all namespace undeclarations and undeclarations defined on this element.
|
DocumentInfo |
getDocumentRoot()
Get the root document node
|
int |
getLineNumber()
Get the line number of the node within its source document entity
|
int |
getNameCode()
Get the nameCode of the node.
|
int |
getNodeKind()
Return the type of node.
|
NodeInfo |
getRoot()
Get the root node
|
java.lang.String |
getSystemId()
Get the system ID of the entity containing this element node.
|
void |
initialise(int nameCode,
AttributeCollectionImpl atts,
NodeInfo parent,
java.lang.String baseURI,
int lineNumber,
int sequenceNumber)
Initialise a new ElementImpl with an element name
|
void |
sendNamespaceDeclarations(Receiver out,
boolean includeAncestors)
Output all namespace nodes associated with this element.
|
void |
setLineNumber(int line)
Set the line number of the element within its source document entity
|
void |
setNameCode(int nameCode)
Set the name code.
|
void |
setSystemId(java.lang.String uri)
Set the system ID of this node.
|
addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNthChild, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, useChildrenArrayatomize, compareOrder, equals, getAttributeValue, getColumnNumber, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getTypeAnnotation, getTypedValue, getURI, hashCode, isSameNodeInfo, iterateAxis, iterateAxisprotected int nameCode
protected DocumentImpl root
public void setNameCode(int nameCode)
public void initialise(int nameCode,
AttributeCollectionImpl atts,
NodeInfo parent,
java.lang.String baseURI,
int lineNumber,
int sequenceNumber)
nameCode - Integer representing the element name, with namespaces resolvedatts - The attribute list: always nullparent - The parent nodebaseURI - The base URI of the new elementlineNumber - The line number of the element in the source documentsequenceNumber - Integer identifying this element within the documentpublic void setSystemId(java.lang.String uri)
setSystemId in interface javax.xml.transform.SourcesetSystemId in class NodeImplpublic NodeInfo getRoot()
public DocumentInfo getDocumentRoot()
getDocumentRoot in interface NodeInfogetDocumentRoot in class NodeImplpublic final java.lang.String getSystemId()
getSystemId in interface javax.xml.transform.SourcegetSystemId in interface javax.xml.transform.SourceLocatorgetSystemId in interface NodeInfogetSystemId in class NodeImplpublic java.lang.String getBaseURI()
getBaseURI in interface NodeInfogetBaseURI in class NodeImplpublic void setLineNumber(int line)
public int getLineNumber()
getLineNumber in interface javax.xml.transform.SourceLocatorgetLineNumber in interface NodeInfogetLineNumber in class NodeImplpublic int getNameCode()
getNameCode in interface NodeInfogetNameCode in class NodeImplallocate,
getFingerprintpublic void generateId(FastStringBuffer buffer)
generateId in interface NodeInfogenerateId in class NodeImplbuffer - to contain the generated IDpublic void sendNamespaceDeclarations(Receiver out, boolean includeAncestors) throws XPathException
sendNamespaceDeclarations in interface NodeInfosendNamespaceDeclarations in class NodeImplout - The relevant outputterincludeAncestors - True if namespaces declared on ancestor elements mustXPathExceptionpublic int[] getDeclaredNamespaces(int[] buffer)
getDeclaredNamespaces in interface NodeInfogetDeclaredNamespaces in class NodeImplbuffer - 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 final int getNodeKind()
Typepublic AttributeCollection getAttributeList()
public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException
out - The outputterwhichNamespaces - indicates which namespaces should be output: all, none, or local
namespaces only (those not declared on the parent element)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 LocationCopierXPathException