Class DomDocumentImpl
- java.lang.Object
-
- org.camunda.bpm.model.xml.impl.instance.DomDocumentImpl
-
- All Implemented Interfaces:
DomDocument
public class DomDocumentImpl extends java.lang.Object implements DomDocument
- Author:
- Sebastian Menski
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGENERIC_NS_PREFIX
-
Constructor Summary
Constructors Constructor Description DomDocumentImpl(org.w3c.dom.Document document)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DomDocumentclone()Clones the DOM document.DomElementcreateElement(java.lang.String namespaceUri, java.lang.String localName)Creates a new element in the dom document.booleanequals(java.lang.Object o)javax.xml.transform.dom.DOMSourcegetDomSource()Returns a newDOMSourceof the document.DomElementgetElementById(java.lang.String id)Gets an element by its id.java.util.List<DomElement>getElementsByNameNs(java.lang.String namespaceUri, java.lang.String localName)Gets all elements with the namespace and name.DomElementgetRootElement()Returns the root element of the document.protected java.lang.StringgetUnusedGenericNsPrefix()inthashCode()java.lang.StringregisterNamespace(java.lang.String namespaceUri)Registers a new namespace with a generic prefix.voidregisterNamespace(java.lang.String prefix, java.lang.String namespaceUri)Registers a new namespace for the prefix.voidsetRootElement(DomElement rootElement)Sets the root element of the DOM document.
-
-
-
Field Detail
-
GENERIC_NS_PREFIX
public static final java.lang.String GENERIC_NS_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRootElement
public DomElement getRootElement()
Description copied from interface:DomDocumentReturns the root element of the document.- Specified by:
getRootElementin interfaceDomDocument- Returns:
- the root element or null if non exists
-
setRootElement
public void setRootElement(DomElement rootElement)
Description copied from interface:DomDocumentSets the root element of the DOM document. Replace an existing if necessary.- Specified by:
setRootElementin interfaceDomDocument- Parameters:
rootElement- the new root element
-
createElement
public DomElement createElement(java.lang.String namespaceUri, java.lang.String localName)
Description copied from interface:DomDocumentCreates a new element in the dom document.- Specified by:
createElementin interfaceDomDocument- Parameters:
namespaceUri- the namespaceUri of the new elementlocalName- the localName of the new element- Returns:
- the new DOM element
-
getElementById
public DomElement getElementById(java.lang.String id)
Description copied from interface:DomDocumentGets an element by its id.- Specified by:
getElementByIdin interfaceDomDocument- Parameters:
id- the id to search for- Returns:
- the element or null if no such element exists
-
getElementsByNameNs
public java.util.List<DomElement> getElementsByNameNs(java.lang.String namespaceUri, java.lang.String localName)
Description copied from interface:DomDocumentGets all elements with the namespace and name.- Specified by:
getElementsByNameNsin interfaceDomDocument- Parameters:
namespaceUri- the element namespaceURI to search forlocalName- the element name to search for- Returns:
- the list of matching elements
-
getDomSource
public javax.xml.transform.dom.DOMSource getDomSource()
Description copied from interface:DomDocumentReturns a newDOMSourceof the document. Note that aDOMSourcewraps the underlyingDocumentwhich is not thread-safe. Multiple DOMSources of the same document should be synchronized by the calling application.- Specified by:
getDomSourcein interfaceDomDocument- Returns:
- the new
DOMSource
-
registerNamespace
public java.lang.String registerNamespace(java.lang.String namespaceUri)
Description copied from interface:DomDocumentRegisters a new namespace with a generic prefix.- Specified by:
registerNamespacein interfaceDomDocument- Parameters:
namespaceUri- the namespaceUri of the new namespace- Returns:
- the used prefix
-
registerNamespace
public void registerNamespace(java.lang.String prefix, java.lang.String namespaceUri)Description copied from interface:DomDocumentRegisters a new namespace for the prefix.- Specified by:
registerNamespacein interfaceDomDocument- Parameters:
prefix- the prefix of the new namespacenamespaceUri- the namespaceUri of the new namespace
-
getUnusedGenericNsPrefix
protected java.lang.String getUnusedGenericNsPrefix()
-
clone
public DomDocument clone()
Description copied from interface:DomDocumentClones the DOM document.- Specified by:
clonein interfaceDomDocument- Overrides:
clonein classjava.lang.Object- Returns:
- the cloned DOM document
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-