|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectnet.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 name
public 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 SourcesetSystemId in class NodeImplpublic NodeInfo getRoot()
getRoot in interface NodeInfogetRoot in class NodeImplpublic DocumentInfo getDocumentRoot()
getDocumentRoot in interface NodeInfogetDocumentRoot in class NodeImplpublic final String getSystemId()
getSystemId in interface SourcegetSystemId in interface SourceLocatorgetSystemId in interface NodeInfogetSystemId in class NodeImplpublic String getBaseURI()
getBaseURI in interface NodeInfogetBaseURI in class NodeImplpublic void setLineNumber(int line)
line - the line numberpublic int getLineNumber()
getLineNumber in interface 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 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 LocationCopier
XPathExceptionpublic final boolean hasChildNodes()
hasChildNodes in interface NodeInfohasChildNodes in class NodeImpltrue if the node has any children,
false if the node has no children.public final NodeInfo getFirstChild()
getFirstChild in class NodeImplpublic final NodeInfo getLastChild()
getLastChild in class NodeImplpublic String getStringValue()
Item.getStringValueCS()public CharSequence getStringValueCS()
NodeImpl
getStringValueCS in interface ItemgetStringValueCS in interface ValueRepresentationgetStringValueCS in class NodeImplItem.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 | ||||||