javax.xml.transform.Source
, javax.xml.transform.SourceLocator
, FingerprintedNode
, Item
, NodeInfo
, ValueRepresentation
ElementWithAttributes
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 | Description |
---|---|---|
protected int |
nameCode |
|
protected DocumentImpl |
root |
index, NODE_LETTER, parent
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES
sequence
EMPTY_VALUE_ARRAY
Constructor | Description |
---|---|
ElementImpl() |
Construct an empty ElementImpl
|
Modifier and Type | Method | 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.
|
atomize, compareOrder, equals, getAttributeValue, getColumnNumber, getConfiguration, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getPublicId, getTypeAnnotation, getTypedValue, getURI, hashCode, isSameNodeInfo, iterateAxis, iterateAxis
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNthChild, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, useChildrenArray
protected 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.Source
setSystemId
in class NodeImpl
public NodeInfo getRoot()
public DocumentInfo getDocumentRoot()
getDocumentRoot
in interface NodeInfo
getDocumentRoot
in class NodeImpl
public final java.lang.String getSystemId()
getSystemId
in interface NodeInfo
getSystemId
in interface javax.xml.transform.Source
getSystemId
in interface javax.xml.transform.SourceLocator
getSystemId
in class NodeImpl
public java.lang.String getBaseURI()
getBaseURI
in interface NodeInfo
getBaseURI
in class NodeImpl
public void setLineNumber(int line)
public int getLineNumber()
getLineNumber
in interface NodeInfo
getLineNumber
in interface javax.xml.transform.SourceLocator
getLineNumber
in class NodeImpl
public int getNameCode()
getNameCode
in interface NodeInfo
getNameCode
in class NodeImpl
allocate
,
getFingerprint
public void generateId(FastStringBuffer buffer)
generateId
in interface NodeInfo
generateId
in class NodeImpl
buffer
- to contain the generated IDpublic void sendNamespaceDeclarations(Receiver out, boolean includeAncestors) throws XPathException
sendNamespaceDeclarations
in interface NodeInfo
sendNamespaceDeclarations
in class NodeImpl
out
- The relevant outputterincludeAncestors
- True if namespaces declared on ancestor elements mustXPathException
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.
public final int getNodeKind()
Type
public 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