|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.om.AbstractNode
net.sf.saxon.tree.NodeImpl
net.sf.saxon.tree.ParentNodeImpl
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 | |
---|---|
protected int |
nameCode
|
protected DocumentImpl |
root
|
Fields inherited from class net.sf.saxon.tree.ParentNodeImpl |
---|
sequence |
Fields inherited from class net.sf.saxon.tree.NodeImpl |
---|
index, parent |
Fields inherited from class net.sf.saxon.om.AbstractNode |
---|
NODE_LETTER |
Fields inherited from interface net.sf.saxon.om.NodeInfo |
---|
ALL_NAMESPACES, LOCAL_NAMESPACES, NO_NAMESPACES |
Constructor Summary | |
---|---|
ElementImpl()
Construct an empty ElementImpl |
Method Summary | |
---|---|
void |
addNamespaceNodes(ElementImpl owner,
List list,
boolean addXML)
Make the set of all namespace nodes associated with this element. |
void |
copy(Receiver out,
int whichNamespaces)
Copy this node to a given outputter (supporting xsl:copy-of) |
String |
generateId()
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. |
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 |
String |
getSystemId()
Get the system ID of the entity containing this element node. |
void |
initialise(int nameCode,
AttributeCollection atts,
NodeInfo parent,
String baseURI,
int lineNumber,
int sequenceNumber)
Initialise a new ElementImpl with an element name |
void |
outputNamespaceNodes(Receiver out,
boolean includeAncestors)
Output all namespace nodes associated with this element. |
void |
setAttribute(String name,
String value)
Set the value of an attribute on the current 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(String uri)
Set the system ID of this node. |
Methods inherited from class net.sf.saxon.tree.ParentNodeImpl |
---|
addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNodeValue, getNthChild, getSequenceNumber, getStringValue, hasChildNodes, useChildrenArray |
Methods inherited from class net.sf.saxon.tree.NodeImpl |
---|
compareOrder, copy, getAttributeValue, getDisplayName, getDocumentElement, getFingerprint, getLocalPart, getNamePool, getNextInDocument, getNextSibling, getOriginatingNode, getParent, getPrefix, getPreviousInDocument, getPreviousSibling, getURI, hasAttributes, isSameNode, iterateAxis, iterateAxis |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Element |
---|
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Field Detail |
---|
protected int nameCode
protected DocumentImpl root
Constructor Detail |
---|
public ElementImpl()
Method Detail |
---|
public void setNameCode(int nameCode)
public void initialise(int nameCode, AttributeCollection 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 interface Node
getBaseURI
in class NodeImpl
public void setLineNumber(int line)
public 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 String generateId()
generateId
in interface NodeInfo
generateId
in class NodeImpl
public void addNamespaceNodes(ElementImpl owner, List list, boolean addXML)
owner
- The element owning these namespace nodes.list
- a List containing NamespaceImpl objects representing the namespaces
in scope for this element; the method appends nodes to this List, which should
initially be empty. Note that the returned list will never contain the XML namespace
(to get this, the NamespaceEnumeration class adds it itself). The list WILL include
an entry for the undeclaration xmlns=""; again it is the job of NamespaceEnumeration
to ignore this, since it doesn't represent a true namespace node.addXML
- Add the XML namespace node to the listpublic void outputNamespaceNodes(Receiver out, boolean includeAncestors) throws TransformerException
outputNamespaceNodes
in interface NodeInfo
outputNamespaceNodes
in class NodeImpl
out
- The relevant outputterincludeAncestors
- True if namespaces declared on ancestor elements must
be output; false if it is known that these are already on the result tree
TransformerException
public final int getNodeKind()
getNodeKind
in interface NodeInfo
Type
public AttributeCollection getAttributeList()
public void setAttribute(String name, String value) throws DOMException
setAttribute
in interface Element
DOMException
- (always): the Saxon tree is immutablepublic void copy(Receiver out, int whichNamespaces) throws TransformerException
copy
in class NodeImpl
out
- The outputterwhichNamespaces
- indicates which namespaces should be output: all, none, or local
namespaces only (those not declared on the parent element)
TransformerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |