org.camunda.bpm.model.xml.impl.instance
Class DomDocumentImpl

java.lang.Object
  extended by org.camunda.bpm.model.xml.impl.instance.DomDocumentImpl
All Implemented Interfaces:
DomDocument

public class DomDocumentImpl
extends Object
implements DomDocument

Author:
Sebastian Menski

Field Summary
static String GENERIC_NS_PREFIX
           
 
Constructor Summary
DomDocumentImpl(Document document)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERIC_NS_PREFIX

public static final String GENERIC_NS_PREFIX
See Also:
Constant Field Values
Constructor Detail

DomDocumentImpl

public DomDocumentImpl(Document document)
Method Detail

getRootElement

public DomElement getRootElement()
Description copied from interface: DomDocument
Returns the root element of the document.

Specified by:
getRootElement in interface DomDocument
Returns:
the root element or null if non exists

setRootElement

public void setRootElement(DomElement rootElement)
Description copied from interface: DomDocument
Sets the root element of the DOM document. Replace an existing if necessary.

Specified by:
setRootElement in interface DomDocument
Parameters:
rootElement - the new root element

createElement

public DomElement createElement(String namespaceUri,
                                String localName)
Description copied from interface: DomDocument
Creates a new element in the dom document.

Specified by:
createElement in interface DomDocument
Parameters:
namespaceUri - the namespaceUri of the new element
localName - the localName of the new element
Returns:
the new DOM element

getElementById

public DomElement getElementById(String id)
Description copied from interface: DomDocument
Gets an element by its id.

Specified by:
getElementById in interface DomDocument
Parameters:
id - the id to search for
Returns:
the element or null if no such element exists

getElementsByNameNs

public List<DomElement> getElementsByNameNs(String namespaceUri,
                                            String localName)
Description copied from interface: DomDocument
Gets all elements with the namespace and name.

Specified by:
getElementsByNameNs in interface DomDocument
Parameters:
namespaceUri - the element namespaceURI to search for
localName - the element name to search for
Returns:
the list of matching elements

getDomSource

public DOMSource getDomSource()
Description copied from interface: DomDocument
Returns a new DOMSource 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.

Specified by:
getDomSource in interface DomDocument
Returns:
the new DOMSource

registerNamespace

public String registerNamespace(String namespaceUri)
Description copied from interface: DomDocument
Registers a new namespace with a generic prefix.

Specified by:
registerNamespace in interface DomDocument
Parameters:
namespaceUri - the namespaceUri of the new namespace
Returns:
the used prefix

registerNamespace

public void registerNamespace(String prefix,
                              String namespaceUri)
Description copied from interface: DomDocument
Registers a new namespace for the prefix.

Specified by:
registerNamespace in interface DomDocument
Parameters:
prefix - the prefix of the new namespace
namespaceUri - the namespaceUri of the new namespace

getUnusedGenericNsPrefix

protected String getUnusedGenericNsPrefix()

clone

public DomDocument clone()
Description copied from interface: DomDocument
Clones the DOM document.

Specified by:
clone in interface DomDocument
Overrides:
clone in class Object
Returns:
the cloned DOM document

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2015 camunda services GmbH. All rights reserved.