Package org.camunda.spin.impl.xml.dom
Class DomXmlElement
- java.lang.Object
-
- org.camunda.spin.Spin<T>
-
- org.camunda.spin.xml.SpinXmlNode<SpinXmlElement>
-
- org.camunda.spin.xml.SpinXmlElement
-
- org.camunda.spin.impl.xml.dom.DomXmlElement
-
public class DomXmlElement extends SpinXmlElement
Wrapper for an xml dom element.- Author:
- Sebastian Menski
-
-
Field Summary
Fields Modifier and Type Field Description protected static javax.xml.transform.Transformer
cachedTransformer
protected static javax.xml.xpath.XPathFactory
cachedXPathFactory
protected DomXmlDataFormat
dataFormat
protected org.w3c.dom.Element
domElement
-
Constructor Summary
Constructors Constructor Description DomXmlElement(org.w3c.dom.Element domElement, DomXmlDataFormat dataFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adoptElement(DomXmlElement elementToAdopt)
Adopts an xml dom element to the owner document of this element if necessary.SpinXmlElement
append(java.util.Collection<SpinXmlElement> childElements)
SpinXmlElement
append(SpinXmlElement childElement)
SpinXmlElement
append(SpinXmlElement... childElements)
SpinXmlElement
appendAfter(SpinXmlElement childElement, SpinXmlElement existingChildElement)
SpinXmlElement
appendBefore(SpinXmlElement childElement, SpinXmlElement existingChildElement)
SpinXmlAttribute
attr(java.lang.String attributeName)
SpinXmlElement
attr(java.lang.String attributeName, java.lang.String value)
java.util.List<java.lang.String>
attrNames()
java.util.List<java.lang.String>
attrNames(java.lang.String namespace)
SpinXmlAttribute
attrNs(java.lang.String namespace, java.lang.String attributeName)
SpinXmlElement
attrNs(java.lang.String namespace, java.lang.String attributeName, java.lang.String value)
SpinList<SpinXmlAttribute>
attrs()
SpinList<SpinXmlAttribute>
attrs(java.lang.String namespace)
SpinXmlElement
childElement(java.lang.String elementName)
SpinXmlElement
childElement(java.lang.String namespace, java.lang.String elementName)
SpinList<SpinXmlElement>
childElements()
SpinList<SpinXmlElement>
childElements(java.lang.String elementName)
SpinList<SpinXmlElement>
childElements(java.lang.String namespace, java.lang.String elementName)
java.lang.String
getDataFormatName()
protected javax.xml.xpath.XPathFactory
getXPathFactory()
Returns a XPath Factoryboolean
hasAttr(java.lang.String attributeName)
boolean
hasAttrNs(java.lang.String namespace, java.lang.String attributeName)
boolean
hasNamespace(java.lang.String namespace)
boolean
hasPrefix(java.lang.String prefix)
<C> C
mapTo(java.lang.Class<C> javaClass)
<C> C
mapTo(java.lang.String javaClass)
java.lang.String
name()
java.lang.String
namespace()
java.lang.String
prefix()
SpinXmlElement
remove(java.util.Collection<SpinXmlElement> childElements)
SpinXmlElement
remove(SpinXmlElement childElement)
SpinXmlElement
remove(SpinXmlElement... childElements)
SpinXmlElement
removeAttr(java.lang.String attributeName)
SpinXmlElement
removeAttrNs(java.lang.String namespace, java.lang.String attributeName)
SpinXmlElement
replace(SpinXmlElement newElement)
SpinXmlElement
replaceChild(SpinXmlElement existingChildElement, SpinXmlElement newChildElement)
java.lang.String
textContent()
SpinXmlElement
textContent(java.lang.String textContent)
java.lang.String
toString()
org.w3c.dom.Element
unwrap()
void
writeToWriter(java.io.Writer writer)
SpinXPathQuery
xPath(java.lang.String expression)
-
-
-
Field Detail
-
cachedTransformer
protected static javax.xml.transform.Transformer cachedTransformer
-
cachedXPathFactory
protected static javax.xml.xpath.XPathFactory cachedXPathFactory
-
domElement
protected final org.w3c.dom.Element domElement
-
dataFormat
protected final DomXmlDataFormat dataFormat
-
-
Constructor Detail
-
DomXmlElement
public DomXmlElement(org.w3c.dom.Element domElement, DomXmlDataFormat dataFormat)
-
-
Method Detail
-
getDataFormatName
public java.lang.String getDataFormatName()
- Specified by:
getDataFormatName
in classSpin<SpinXmlElement>
-
unwrap
public org.w3c.dom.Element unwrap()
- Specified by:
unwrap
in classSpin<SpinXmlElement>
-
name
public java.lang.String name()
- Specified by:
name
in classSpinXmlNode<SpinXmlElement>
-
namespace
public java.lang.String namespace()
- Specified by:
namespace
in classSpinXmlNode<SpinXmlElement>
-
prefix
public java.lang.String prefix()
- Specified by:
prefix
in classSpinXmlNode<SpinXmlElement>
-
hasPrefix
public boolean hasPrefix(java.lang.String prefix)
- Specified by:
hasPrefix
in classSpinXmlNode<SpinXmlElement>
-
hasNamespace
public boolean hasNamespace(java.lang.String namespace)
- Specified by:
hasNamespace
in classSpinXmlNode<SpinXmlElement>
-
attr
public SpinXmlAttribute attr(java.lang.String attributeName)
- Specified by:
attr
in classSpinXmlElement
-
attrNs
public SpinXmlAttribute attrNs(java.lang.String namespace, java.lang.String attributeName)
- Specified by:
attrNs
in classSpinXmlElement
-
hasAttr
public boolean hasAttr(java.lang.String attributeName)
- Specified by:
hasAttr
in classSpinXmlElement
-
hasAttrNs
public boolean hasAttrNs(java.lang.String namespace, java.lang.String attributeName)
- Specified by:
hasAttrNs
in classSpinXmlElement
-
attrs
public SpinList<SpinXmlAttribute> attrs()
- Specified by:
attrs
in classSpinXmlElement
-
attrs
public SpinList<SpinXmlAttribute> attrs(java.lang.String namespace)
- Specified by:
attrs
in classSpinXmlElement
-
attrNames
public java.util.List<java.lang.String> attrNames()
- Specified by:
attrNames
in classSpinXmlElement
-
attrNames
public java.util.List<java.lang.String> attrNames(java.lang.String namespace)
- Specified by:
attrNames
in classSpinXmlElement
-
textContent
public java.lang.String textContent()
- Specified by:
textContent
in classSpinXmlElement
-
textContent
public SpinXmlElement textContent(java.lang.String textContent)
- Specified by:
textContent
in classSpinXmlElement
-
childElement
public SpinXmlElement childElement(java.lang.String elementName)
- Specified by:
childElement
in classSpinXmlElement
-
childElement
public SpinXmlElement childElement(java.lang.String namespace, java.lang.String elementName)
- Specified by:
childElement
in classSpinXmlElement
-
childElements
public SpinList<SpinXmlElement> childElements()
- Specified by:
childElements
in classSpinXmlElement
-
childElements
public SpinList<SpinXmlElement> childElements(java.lang.String elementName)
- Specified by:
childElements
in classSpinXmlElement
-
childElements
public SpinList<SpinXmlElement> childElements(java.lang.String namespace, java.lang.String elementName)
- Specified by:
childElements
in classSpinXmlElement
-
attr
public SpinXmlElement attr(java.lang.String attributeName, java.lang.String value)
- Specified by:
attr
in classSpinXmlElement
-
attrNs
public SpinXmlElement attrNs(java.lang.String namespace, java.lang.String attributeName, java.lang.String value)
- Specified by:
attrNs
in classSpinXmlElement
-
removeAttr
public SpinXmlElement removeAttr(java.lang.String attributeName)
- Specified by:
removeAttr
in classSpinXmlElement
-
removeAttrNs
public SpinXmlElement removeAttrNs(java.lang.String namespace, java.lang.String attributeName)
- Specified by:
removeAttrNs
in classSpinXmlElement
-
append
public SpinXmlElement append(SpinXmlElement... childElements)
- Specified by:
append
in classSpinXmlElement
-
append
public SpinXmlElement append(SpinXmlElement childElement)
-
append
public SpinXmlElement append(java.util.Collection<SpinXmlElement> childElements)
- Specified by:
append
in classSpinXmlElement
-
appendBefore
public SpinXmlElement appendBefore(SpinXmlElement childElement, SpinXmlElement existingChildElement)
- Specified by:
appendBefore
in classSpinXmlElement
-
appendAfter
public SpinXmlElement appendAfter(SpinXmlElement childElement, SpinXmlElement existingChildElement)
- Specified by:
appendAfter
in classSpinXmlElement
-
remove
public SpinXmlElement remove(SpinXmlElement... childElements)
- Specified by:
remove
in classSpinXmlElement
-
remove
public SpinXmlElement remove(SpinXmlElement childElement)
-
remove
public SpinXmlElement remove(java.util.Collection<SpinXmlElement> childElements)
- Specified by:
remove
in classSpinXmlElement
-
replace
public SpinXmlElement replace(SpinXmlElement newElement)
- Specified by:
replace
in classSpinXmlElement
-
replaceChild
public SpinXmlElement replaceChild(SpinXmlElement existingChildElement, SpinXmlElement newChildElement)
- Specified by:
replaceChild
in classSpinXmlElement
-
xPath
public SpinXPathQuery xPath(java.lang.String expression)
- Specified by:
xPath
in classSpinXmlElement
-
adoptElement
protected void adoptElement(DomXmlElement elementToAdopt)
Adopts an xml dom element to the owner document of this element if necessary.- Parameters:
elementToAdopt
- the element to adopt
-
toString
public java.lang.String toString()
- Specified by:
toString
in classSpinXmlElement
-
writeToWriter
public void writeToWriter(java.io.Writer writer)
- Specified by:
writeToWriter
in classSpinXmlElement
-
getXPathFactory
protected javax.xml.xpath.XPathFactory getXPathFactory()
Returns a XPath Factory- Returns:
- the XPath factory
-
mapTo
public <C> C mapTo(java.lang.Class<C> javaClass)
- Specified by:
mapTo
in classSpinXmlNode<SpinXmlElement>
-
mapTo
public <C> C mapTo(java.lang.String javaClass)
- Specified by:
mapTo
in classSpinXmlNode<SpinXmlElement>
-
-