public class DomDocumentImpl extends Object implements DomDocument
| Modifier and Type | Field and Description |
|---|---|
static String |
GENERIC_NS_PREFIX |
| Constructor and Description |
|---|
DomDocumentImpl(Document document) |
| Modifier and Type | Method and Description |
|---|---|
DomDocument |
clone()
Clones the DOM document.
|
DomElement |
createElement(String namespaceUri,
String localName)
Creates a new element in the dom document.
|
boolean |
equals(Object o) |
DOMSource |
getDomSource()
Returns a new
DOMSource of the document. |
DomElement |
getElementById(String id)
Gets an element by its id.
|
List<DomElement> |
getElementsByNameNs(String namespaceUri,
String localName)
Gets all elements with the namespace and name.
|
DomElement |
getRootElement()
Returns the root element of the document.
|
protected String |
getUnusedGenericNsPrefix() |
int |
hashCode() |
String |
registerNamespace(String namespaceUri)
Registers a new namespace with a generic prefix.
|
void |
registerNamespace(String prefix,
String namespaceUri)
Registers a new namespace for the prefix.
|
void |
setRootElement(DomElement rootElement)
Sets the root element of the DOM document.
|
public static final String GENERIC_NS_PREFIX
public DomDocumentImpl(Document document)
public DomElement getRootElement()
DomDocumentgetRootElement in interface DomDocumentpublic void setRootElement(DomElement rootElement)
DomDocumentsetRootElement in interface DomDocumentrootElement - the new root elementpublic DomElement createElement(String namespaceUri, String localName)
DomDocumentcreateElement in interface DomDocumentnamespaceUri - the namespaceUri of the new elementlocalName - the localName of the new elementpublic DomElement getElementById(String id)
DomDocumentgetElementById in interface DomDocumentid - the id to search forpublic List<DomElement> getElementsByNameNs(String namespaceUri, String localName)
DomDocumentgetElementsByNameNs in interface DomDocumentnamespaceUri - the element namespaceURI to search forlocalName - the element name to search forpublic DOMSource getDomSource()
DomDocumentDOMSource of the document.
Note that a DOMSource wraps the underlying Document which is
not thread-safe. Multiple DOMSources of the same document should be synchronized
by the calling application.getDomSource in interface DomDocumentDOMSourcepublic String registerNamespace(String namespaceUri)
DomDocumentregisterNamespace in interface DomDocumentnamespaceUri - the namespaceUri of the new namespacepublic void registerNamespace(String prefix, String namespaceUri)
DomDocumentregisterNamespace in interface DomDocumentprefix - the prefix of the new namespacenamespaceUri - the namespaceUri of the new namespaceprotected String getUnusedGenericNsPrefix()
public DomDocument clone()
DomDocumentclone in interface DomDocumentclone in class ObjectCopyright © 2018. All rights reserved.