|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.novell.xml.dom.NodeImpl
com.novell.xml.dom.DocumentImpl
Novell implementation of DOM level 1 Document interface
| Field Summary |
| Fields inherited from class com.novell.xml.dom.NodeImpl |
allowedChildren, baseURI, changeCount, document, documentOrderVal, expandedName, firstChild, lastChild, localName, namespaceURI, nextOrderVal, nextSibling, nodeName, nodeValue, parentNode, prefix, previousSibling, toStringSerializes, xmlnsPrefix, xmlPrefix, xpathBehavior |
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
| Constructor Summary | |
protected |
DocumentImpl()
Create a new DocumentImpl object |
| Method Summary | |
void |
addId(ElementImpl element,
String id)
Add an element to the id table non-DOM |
protected boolean |
checkNames()
Return true if name checking is enabled |
static String |
constructMessage(String key,
Object[] parms)
Construct a message from a format message in the properties file and an array of parameters |
Attr |
createAttribute(String name)
Creates an Attr of the given name. |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName)
Creates an attribute of the given qualified name and namespace URI. |
CDATASection |
createCDATASection(String data)
Creates a CDATASection node whose value is the specified
string. |
Comment |
createComment(String data)
Creates a Comment node given the specified string. |
DocumentFragment |
createDocumentFragment()
Creates an empty DocumentFragment object. |
Element |
createElement(String tagName)
Creates an element of the type specified. |
Element |
createElementNS(String namespaceURI,
String qualifiedName)
Creates an element of the given qualified name and namespace URI. |
Entity |
createEntity(String name,
String publicId,
String systemId,
String notationName)
Create an Entity node non-DOM |
EntityReference |
createEntityReference(String name)
Creates an EntityReference object. |
NamespaceImpl |
createNamespaceNode(String prefix,
String uri)
Create a namespace node non-DOM |
Notation |
createNotation(String name,
String publicId,
String systemId)
Create a Notation node non-DOM |
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
Creates a ProcessingInstruction node given the specified
name and data strings. |
Text |
createTextNode(String data)
Creates a Text node given the specified string. |
ElementImpl |
findElementById(String id)
Look up an element by it's id non-DOM |
DocumentType |
getDoctype()
The Document Type Declaration (see DocumentType) associated
with this document. |
Element |
getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the root element of the document. |
Element |
getElementById(String elementId)
Returns the Element whose ID is given by
elementId. |
NodeList |
getElementsByTagName(String tagname)
Returns a NodeList of all the Elements with a
given tag name in the order in which they would be encountered in a
preorder traversal of the Document tree. |
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
Returns a NodeList of all the Elements with a
given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document tree. |
DOMImplementation |
getImplementation()
The DOMImplementation object that handles this document. |
String |
getNodeName()
The name of this node, depending on its type; see the table above. |
short |
getNodeType()
A code representing the type of the underlying object, as defined above. |
Document |
getOwnerDocument()
The Document object associated with this node. |
boolean |
getSmartNS()
Get smart namespace support enabled flag |
Node |
importNode(Node importedNode,
boolean deep)
Imports a node from another document to this document. |
boolean |
isLocked()
Return if document tree is locked non-DOM |
boolean |
isOrderCurrent()
Return true if document order information in the document tree
is current. |
void |
lock()
Lock this document tree against modification non-DOM |
static DocumentImpl |
newDocument()
Factory method to create a new document |
void |
removeId(String id)
Remove an element from the id table non-DOM |
void |
setCheckNames(boolean enable)
Set whether to enable name checking for this document. |
void |
setDocumentType(DocumentTypeImpl docType)
Set the DocumentType node for this document non-DOM |
void |
setOrderCurrent(boolean orderIsCurrent)
Set the order state. |
void |
setSmartNS(boolean enable)
Set whether to enable smart namespace support. |
void |
unlock()
Unlock this document tree for modification non-DOM |
void |
updateDocumentOrder()
Setup the document order information if it has not been set, or has been invalidated by changes to the tree. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
| Constructor Detail |
protected DocumentImpl()
| Method Detail |
public String getNodeName()
getNodeName in interface NodegetNodeName in class NodeImplpublic short getNodeType()
getNodeType in interface NodegetNodeType in class NodeImplpublic Document getOwnerDocument()
Document object associated with this node. This is also
the Document object used to create new nodes. When this
node is a Document this is null.
getOwnerDocument in interface NodegetOwnerDocument in class NodeImplpublic DocumentType getDoctype()
DocumentType) associated
with this document. For HTML documents as well as XML documents without
a document type declaration this returns null. The DOM Level
1 does not support editing the Document Type Declaration, therefore
docType cannot be altered in any way.
getDoctype in interface Documentpublic DOMImplementation getImplementation()
DOMImplementation object that handles this document. A
DOM application may use objects from multiple implementations.
getImplementation in interface Documentpublic Element getDocumentElement()
getDocumentElement in interface Document
public Element createElement(String tagName)
throws DOMException
createElement in interface DocumenttagName - The name of the element type to instantiate. For XML, this
is case-sensitive. For HTML, the tagName parameter may
be provided in any case, but it must be mapped to the canonical
uppercase form by the DOM implementation.
Element object.
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an
invalid character.public DocumentFragment createDocumentFragment()
DocumentFragment object.
createDocumentFragment in interface DocumentDocumentFragment.public Text createTextNode(String data)
Text node given the specified string.
createTextNode in interface Documentdata - The data for the node.
Text object.public Comment createComment(String data)
Comment node given the specified string.
createComment in interface Documentdata - The data for the node.
Comment object.
public CDATASection createCDATASection(String data)
throws DOMException
CDATASection node whose value is the specified
string.
createCDATASection in interface Documentdata - The data for the CDATASection contents.
CDATASection object.
DOMException - NOT_SUPPORTED_ERR: Raised if this document is an HTML document.
public ProcessingInstruction createProcessingInstruction(String target,
String data)
throws DOMException
ProcessingInstruction node given the specified
name and data strings.
createProcessingInstruction in interface Documenttarget - The target part of the processing instruction.data - The data for the node.
ProcessingInstruction object.
DOMException - INVALID_CHARACTER_ERR: Raised if an invalid character is specified.
public Attr createAttribute(String name)
throws DOMException
Attr of the given name. Note that the
Attr instance can then be set on an Element
using the setAttribute method.
createAttribute in interface Documentname - The name of the attribute.
Attr object.
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an
invalid character.
public EntityReference createEntityReference(String name)
throws DOMException
createEntityReference in interface Documentname - The name of the entity to reference.
EntityReference object.
DOMException - INVALID_CHARACTER_ERR: Raised if the specified name contains an
invalid character.
public NodeList getElementsByTagName(String tagname)
NodeList of all the Elements with a
given tag name in the order in which they would be encountered in a
preorder traversal of the Document tree.
getElementsByTagName in interface Documenttagname - The name of the tag to match on. The special value "*"
matches all tags.
NodeList object containing all the matched
Elements.
public void setDocumentType(DocumentTypeImpl docType)
throws DOMException
docType - The DocumentTypeImpl
DOMException
public Notation createNotation(String name,
String publicId,
String systemId)
name - The name of the notationpublicId - The public id of the notationsystemId - The system id of the notation
public Entity createEntity(String name,
String publicId,
String systemId,
String notationName)
name - The name of the entitypublicId - The public id of the notationsystemId - The system id of the notationnotationName - For unparsed entities, the name of the notation
public Node importNode(Node importedNode,
boolean deep)
throws DOMException
parentNode is null).
The source node is not altered or removed from the original document;
this method creates a new copy of the source node.
nodeName and nodeType, plus the
attributes related to namespaces (prefix,
localName, and namespaceURI). As in the
cloneNode operation on a Node, the source
node is not altered.
nodeType, attempting to mirror the behavior expected if
a fragment of XML or HTML source was copied from one document to
another, recognizing that the two documents may have different DTDs
in the XML case. The following list describes the specifics for each
type of node.
ownerElement attribute
is set to null and the specified flag is
set to true on the generated Attr. The
descendants of the source Attr are recursively imported
and the resulting nodes reassembled to form the corresponding subtree.
Note that the deep parameter has no effect on
Attr nodes; they always carry their children with them
when imported.deep option
was set to true, the descendants of the source element
are recursively imported and the resulting nodes reassembled to form
the corresponding subtree. Otherwise, this simply generates an empty
DocumentFragment.Document
nodes cannot be imported.DocumentType
nodes cannot be imported.Attr
nodes are attached to the generated Element. Default
attributes are not copied, though if the document being imported into
defines default attributes for this element name, those are assigned.
If the importNode deep parameter was set to
true, the descendants of the source element are
recursively imported and the resulting nodes reassembled to form the
corresponding subtree.Entity nodes can be
imported, however in the current release of the DOM the
DocumentType is readonly. Ability to add these imported
nodes to a DocumentType will be considered for addition
to a future release of the DOM.On import, the publicId,
systemId, and notationName attributes are
copied. If a deep import is requested, the descendants
of the the source Entity are recursively imported and
the resulting nodes reassembled to form the corresponding subtree.EntityReference itself is
copied, even if a deep import is requested, since the
source and destination documents might have defined the entity
differently. If the document being imported into provides a
definition for this entity name, its value is assigned.Notation nodes can be imported, however in the current
release of the DOM the DocumentType is readonly. Ability
to add these imported nodes to a DocumentType will be
considered for addition to a future release of the DOM.On import, the
publicId and systemId attributes are copied.
Note that the deep parameter has no effect on
Notation nodes since they never have any children.target and data values from those of the
source node.CharacterData copy their
data and length attributes from those of
the source node.
importNode in interface DocumentimportedNode - The node to import.deep - If true, recursively import the subtree under
the specified node; if false, import only the node
itself, as explained above. This has no effect on Attr
, EntityReference, and Notation nodes.
Document.
DOMException - NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
supported.
public Element createElementNS(String namespaceURI,
String qualifiedName)
throws DOMException
createElementNS in interface DocumentnamespaceURI - The namespace URI of the element to create.qualifiedName - The qualified name of the element type to
instantiate.
Element object with the following
attributes:AttributeValueNode.nodeName
qualifiedNameNode.namespaceURI
namespaceURINode.prefixprefix, extracted
from qualifiedName, or null if there is
no prefixNode.localNamelocal name, extracted from
qualifiedNameElement.tagName
qualifiedName
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName is
malformed, if the qualifiedName has a prefix and the
namespaceURI is null, or if the
qualifiedName has a prefix that is "xml" and the
namespaceURI is different from "
http://www.w3.org/XML/1998/namespace" .
public Attr createAttributeNS(String namespaceURI,
String qualifiedName)
throws DOMException
createAttributeNS in interface DocumentnamespaceURI - The namespace URI of the attribute to create.qualifiedName - The qualified name of the attribute to instantiate.
Attr object with the following attributes:
AttributeValueNode.nodeNamequalifiedName
Node.namespaceURInamespaceURI
Node.prefixprefix, extracted from
qualifiedName, or null if there is no
prefixNode.localNamelocal name, extracted from
qualifiedNameAttr.name
qualifiedNameNode.nodeValuethe empty
string
DOMException - INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName is
malformed, if the qualifiedName has a prefix and the
namespaceURI is null, if the
qualifiedName has a prefix that is "xml" and the
namespaceURI is different from "
http://www.w3.org/XML/1998/namespace", or if the
qualifiedName is "xmlns" and the
namespaceURI is different from "
http://www.w3.org/2000/xmlns/".
public NodeList getElementsByTagNameNS(String namespaceURI,
String localName)
NodeList of all the Elements with a
given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document tree.
getElementsByTagNameNS in interface DocumentnamespaceURI - The namespace URI of the elements to match on. The
special value "*" matches all namespaces.localName - The local name of the elements to match on. The
special value "*" matches all local names.
NodeList object containing all the matched
Elements.public Element getElementById(String elementId)
Element whose ID is given by
elementId. If no such element exists, returns
null. Behavior is not defined if more than one element
has this ID. The DOM implementation must have
information that says which attributes are of type ID. Attributes
with the name "ID" are not of type ID unless so defined.
Implementations that do not know whether attributes are of type ID or
not are expected to return null.
getElementById in interface DocumentelementId - The unique id value for an element.
public NamespaceImpl createNamespaceNode(String prefix,
String uri)
prefix - The namespace prefix (name of namespace node)uri - The namespace uri (value of namespace node)
public void lock()
public void unlock()
public boolean isLocked()
public void setCheckNames(boolean enable)
enable - True if name checking should be enabled, false otherwise
(true is the default)public void setSmartNS(boolean enable)
enable - true if smart namespace support should be enabled, false otherwise
(true is the default, even though that makes us non-compliant, it makes us interoperability work better
when you have no way of knowing how the source document was created)public boolean getSmartNS()
public boolean isOrderCurrent()
true if document order information in the document tree
is current. If it is not current, it can be updated with a call
to updateDocumentOrder()
true if document order information is current in the
document tree.public void setOrderCurrent(boolean orderIsCurrent)
updateDocumentOrder() (at tree creation
time, for example using NodeImpl.setDocumentOrder())
orderIsCurrent - true if document order information is current, false otherwisepublic void updateDocumentOrder()
public static DocumentImpl newDocument()
public void addId(ElementImpl element,
String id)
element - The ElementImpl object to map by idid - The string id valuepublic void removeId(String id)
id - The id value to remove from the tablepublic ElementImpl findElementById(String id)
id - The id value for the element
protected boolean checkNames()
public static String constructMessage(String key,
Object[] parms)
key - The key of the message format string in the properties fileparms - The parameters for the message format string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||