|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.tree.NodeImpl net.sf.saxon.tree.ElementImpl
public class ElementImpl
ElementImpl implements an element with no attributes or namespace declarations.
This class is an implementation of NodeInfo. For elements with attributes or namespace declarations, class ElementWithAttributes is used.
Field Summary |
---|
Fields inherited from class net.sf.saxon.tree.NodeImpl |
---|
NODE_LETTER |
Fields inherited from interface net.sf.saxon.om.NodeInfo |
---|
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
---|
EMPTY_VALUE_ARRAY |
Constructor Summary | |
---|---|
ElementImpl()
Construct an empty ElementImpl |
Method Summary | |
---|---|
void |
addChild(NodeImpl node,
int index)
Add a child node to this node. |
void |
compact(int size)
Compact the space used by this node |
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. |
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 |
NodeInfo |
getFirstChild()
Get the first child node of the element |
NodeInfo |
getLastChild()
Get the last child node of the element |
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 |
String |
getStringValue()
Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes. |
CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence. |
String |
getSystemId()
Get the system ID of the entity containing this element node. |
boolean |
hasChildNodes()
Determine if the node has any children. |
void |
initialise(int nameCode,
AttributeCollectionImpl atts,
NodeInfo parent,
String baseURI,
int lineNumber,
int sequenceNumber)
Initialise a new ElementImpl with an element name |
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(String uri)
Set the system ID of this node. |
Methods inherited from class net.sf.saxon.tree.NodeImpl |
---|
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 |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElementImpl()
Method Detail |
---|
public void setNameCode(int nameCode)
nameCode
- the integer name code representing the element namepublic void initialise(int nameCode, AttributeCollectionImpl atts, NodeInfo parent, 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(String uri)
setSystemId
in interface Source
setSystemId
in class NodeImpl
public NodeInfo getRoot()
getRoot
in interface NodeInfo
getRoot
in class NodeImpl
public DocumentInfo getDocumentRoot()
getDocumentRoot
in interface NodeInfo
getDocumentRoot
in class NodeImpl
public final String getSystemId()
getSystemId
in interface Source
getSystemId
in interface SourceLocator
getSystemId
in interface NodeInfo
getSystemId
in class NodeImpl
public String getBaseURI()
getBaseURI
in interface NodeInfo
getBaseURI
in class NodeImpl
public void setLineNumber(int line)
line
- the line numberpublic int getLineNumber()
getLineNumber
in interface SourceLocator
getLineNumber
in interface NodeInfo
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 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 LocationCopier
XPathException
public final boolean hasChildNodes()
hasChildNodes
in interface NodeInfo
hasChildNodes
in class NodeImpl
true
if the node has any children,
false
if the node has no children.public final NodeInfo getFirstChild()
getFirstChild
in class NodeImpl
public final NodeInfo getLastChild()
getLastChild
in class NodeImpl
public String getStringValue()
Item.getStringValueCS()
public CharSequence getStringValueCS()
NodeImpl
getStringValueCS
in interface Item
getStringValueCS
in interface ValueRepresentation
getStringValueCS
in class NodeImpl
Item.getStringValue()
public void addChild(NodeImpl node, int index)
node
- the node to be added as a child of this nodeindex
- the position where the child is to be addedpublic void compact(int size)
size
- the number of actual children
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |