public class DomXmlElement extends SpinXmlElement
| Modifier and Type | Field and 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 and Description |
|---|
DomXmlElement(org.w3c.dom.Element domElement,
DomXmlDataFormat dataFormat) |
| Modifier and Type | Method and 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)
Appends child elements to this
element. |
SpinXmlElement |
append(SpinXmlElement... childElements)
Appends child elements to this
element. |
SpinXmlElement |
append(SpinXmlElement childElement) |
SpinXmlElement |
appendAfter(SpinXmlElement childElement,
SpinXmlElement existingChildElement)
|
SpinXmlElement |
appendBefore(SpinXmlElement childElement,
SpinXmlElement existingChildElement)
Appends a child element to this element before the existing child element.
|
SpinXmlAttribute |
attr(java.lang.String attributeName)
Returns the wrapped attribute for an empty namespace and the given name.
|
SpinXmlElement |
attr(java.lang.String attributeName,
java.lang.String value)
Sets the attribute value in the local namespace of this element.
|
java.util.List<java.lang.String> |
attrNames()
Returns all names of the attributes of this element.
|
java.util.List<java.lang.String> |
attrNames(java.lang.String namespace)
Returns all names of the attributes in the given namespace.
|
SpinXmlAttribute |
attrNs(java.lang.String namespace,
java.lang.String attributeName)
Returns the wrapped attribute for the given namespace and name.
|
SpinXmlElement |
attrNs(java.lang.String namespace,
java.lang.String attributeName,
java.lang.String value)
Sets the attribute value in the given namespace.
|
SpinList<SpinXmlAttribute> |
attrs()
Returns all wrapped attributes of this element.
|
SpinList<SpinXmlAttribute> |
attrs(java.lang.String namespace)
Returns all wrapped attributes for the given namespace.
|
SpinXmlElement |
childElement(java.lang.String elementName)
Returns a single wrapped child element for the given name
in the local namespace of this element.
|
SpinXmlElement |
childElement(java.lang.String namespace,
java.lang.String elementName)
Returns a single wrapped child
element for the given namespace
and name. |
SpinList<SpinXmlElement> |
childElements()
Returns all child elements of this
elements. |
SpinList<SpinXmlElement> |
childElements(java.lang.String elementName)
Returns all child
elements with a given name in the local namespace
of this element. |
SpinList<SpinXmlElement> |
childElements(java.lang.String namespace,
java.lang.String elementName)
Returns all child
elements with a given namespace and name. |
java.lang.String |
getDataFormatName()
Provides the name of the dataformat used by this spin.
|
protected javax.xml.xpath.XPathFactory |
getXPathFactory()
Returns a XPath Factory
|
boolean |
hasAttr(java.lang.String attributeName)
Checks whether this element has a attribute with an empty namespace and the given name.
|
boolean |
hasAttrNs(java.lang.String namespace,
java.lang.String attributeName)
Checks whether this element has a attribute with the given namespace and name.
|
boolean |
hasNamespace(java.lang.String namespace)
Checks if the node has a given namespace.
|
boolean |
hasPrefix(java.lang.String prefix)
Checks if the node has a given prefix.
|
<C> C |
mapTo(java.lang.Class<C> javaClass)
Maps XML into specific class
|
<C> C |
mapTo(java.lang.String javaClass)
Maps Xml into specific class
|
java.lang.String |
name()
Returns the local name of the node without namespace or prefix.
|
java.lang.String |
namespace()
Returns the namespace uri of the node and not the prefix.
|
java.lang.String |
prefix()
Returns the prefix of the node and not the namespace uri.
|
SpinXmlElement |
remove(java.util.Collection<SpinXmlElement> childElements)
Removes all child elements from this element.
|
SpinXmlElement |
remove(SpinXmlElement... childElements)
Removes all child elements from this element.
|
SpinXmlElement |
remove(SpinXmlElement childElement) |
SpinXmlElement |
removeAttr(java.lang.String attributeName)
Removes the attribute with an empty namespace.
|
SpinXmlElement |
removeAttrNs(java.lang.String namespace,
java.lang.String attributeName)
Removes the attribute under the given namespace.
|
SpinXmlElement |
replace(SpinXmlElement newElement)
Replaces this element by an new one.
|
SpinXmlElement |
replaceChild(SpinXmlElement existingChildElement,
SpinXmlElement newChildElement)
Replaces an existing child element with a new one.
|
java.lang.String |
textContent()
Returns the text content of an element.
|
SpinXmlElement |
textContent(java.lang.String textContent)
Sets the text content of an element.
|
java.lang.String |
toString()
Returns the wrapped XML element as string representation.
|
org.w3c.dom.Element |
unwrap()
Return the wrapped object.
|
void |
writeToWriter(java.io.Writer writer)
Writes the wrapped XML element to a existing writer.
|
SpinXPathQuery |
xPath(java.lang.String expression)
Creates a XPath query on this element.
|
protected static javax.xml.transform.Transformer cachedTransformer
protected static javax.xml.xpath.XPathFactory cachedXPathFactory
protected final org.w3c.dom.Element domElement
protected final DomXmlDataFormat dataFormat
public DomXmlElement(org.w3c.dom.Element domElement,
DomXmlDataFormat dataFormat)
public java.lang.String getDataFormatName()
SpingetDataFormatName in class Spin<SpinXmlElement>public org.w3c.dom.Element unwrap()
Spinunwrap in class Spin<SpinXmlElement>public java.lang.String name()
SpinXmlNodename in class SpinXmlNode<SpinXmlElement>public java.lang.String namespace()
SpinXmlNodenamespace in class SpinXmlNode<SpinXmlElement>public java.lang.String prefix()
SpinXmlNodeprefix in class SpinXmlNode<SpinXmlElement>public boolean hasPrefix(java.lang.String prefix)
SpinXmlNodehasPrefix in class SpinXmlNode<SpinXmlElement>prefix - the prefix to checkpublic boolean hasNamespace(java.lang.String namespace)
SpinXmlNodehasNamespace in class SpinXmlNode<SpinXmlElement>namespace - the namespace to checkpublic SpinXmlAttribute attr(java.lang.String attributeName)
SpinXmlElementattr in class SpinXmlElementattributeName - the name of the attributeattributepublic SpinXmlAttribute attrNs(java.lang.String namespace, java.lang.String attributeName)
SpinXmlElementattrNs in class SpinXmlElementnamespace - the namespace of the attributeattributeName - the name of the attributeattributepublic boolean hasAttr(java.lang.String attributeName)
SpinXmlElementhasAttr in class SpinXmlElementattributeName - the name of the attributepublic boolean hasAttrNs(java.lang.String namespace,
java.lang.String attributeName)
SpinXmlElementhasAttrNs in class SpinXmlElementnamespace - the namespace of the attributeattributeName - the name of the attributepublic SpinList<SpinXmlAttribute> attrs()
SpinXmlElementattrs in class SpinXmlElementpublic SpinList<SpinXmlAttribute> attrs(java.lang.String namespace)
SpinXmlElementattrs in class SpinXmlElementnamespace - the namespace of the attributespublic java.util.List<java.lang.String> attrNames()
SpinXmlElementattrNames in class SpinXmlElementpublic java.util.List<java.lang.String> attrNames(java.lang.String namespace)
SpinXmlElementattrNames in class SpinXmlElementpublic java.lang.String textContent()
SpinXmlElementtextContent in class SpinXmlElementpublic SpinXmlElement textContent(java.lang.String textContent)
SpinXmlElementtextContent in class SpinXmlElementtextContent - the text content to setelementpublic SpinXmlElement childElement(java.lang.String elementName)
SpinXmlElementchildElement in class SpinXmlElementelementName - the element nameelementpublic SpinXmlElement childElement(java.lang.String namespace, java.lang.String elementName)
SpinXmlElementelement for the given namespace
and name.childElement in class SpinXmlElementnamespace - the namespace of the elementelementName - the element nameelementpublic SpinList<SpinXmlElement> childElements()
SpinXmlElementelements.childElements in class SpinXmlElementelementspublic SpinList<SpinXmlElement> childElements(java.lang.String elementName)
SpinXmlElementelements with a given name in the local namespace
of this element.childElements in class SpinXmlElementelementName - the element nameelementspublic SpinList<SpinXmlElement> childElements(java.lang.String namespace, java.lang.String elementName)
SpinXmlElementelements with a given namespace and name.childElements in class SpinXmlElementnamespace - the namespace of the elementelementName - the element nameelementspublic SpinXmlElement attr(java.lang.String attributeName, java.lang.String value)
SpinXmlElementattr in class SpinXmlElementattributeName - the name of the attributevalue - the value to setelementpublic SpinXmlElement attrNs(java.lang.String namespace, java.lang.String attributeName, java.lang.String value)
SpinXmlElementattrNs in class SpinXmlElementnamespace - the namespace of the attributeattributeName - the name of the attributevalue - the value to setelementpublic SpinXmlElement removeAttr(java.lang.String attributeName)
SpinXmlElementremoveAttr in class SpinXmlElementattributeName - the name of the attributeelementpublic SpinXmlElement removeAttrNs(java.lang.String namespace, java.lang.String attributeName)
SpinXmlElementremoveAttrNs in class SpinXmlElementnamespace - the namespace of the attributeattributeName - the name of the attributeelementpublic SpinXmlElement append(SpinXmlElement... childElements)
SpinXmlElementelement.append in class SpinXmlElementchildElements - the child elements to appendelementpublic SpinXmlElement append(SpinXmlElement childElement)
public SpinXmlElement append(java.util.Collection<SpinXmlElement> childElements)
SpinXmlElementelement.append in class SpinXmlElementchildElements - the child elements to appendelementpublic SpinXmlElement appendBefore(SpinXmlElement childElement, SpinXmlElement existingChildElement)
SpinXmlElementappendBefore in class SpinXmlElementchildElement - the child element to appendexistingChildElement - the child element to append beforeelementpublic SpinXmlElement appendAfter(SpinXmlElement childElement, SpinXmlElement existingChildElement)
SpinXmlElementappendAfter in class SpinXmlElementchildElement - the child element to appendexistingChildElement - the child element to append afterelementpublic SpinXmlElement remove(SpinXmlElement... childElements)
SpinXmlElementremove in class SpinXmlElementchildElements - the child elements to removeelementpublic SpinXmlElement remove(SpinXmlElement childElement)
public SpinXmlElement remove(java.util.Collection<SpinXmlElement> childElements)
SpinXmlElementremove in class SpinXmlElementchildElements - the child elements to removeelementpublic SpinXmlElement replace(SpinXmlElement newElement)
SpinXmlElementreplace in class SpinXmlElementnewElement - the new elementelementpublic SpinXmlElement replaceChild(SpinXmlElement existingChildElement, SpinXmlElement newChildElement)
SpinXmlElementreplaceChild in class SpinXmlElementexistingChildElement - the existing child element to replacenewChildElement - the new child elementelementpublic SpinXPathQuery xPath(java.lang.String expression)
SpinXmlElementxPath in class SpinXmlElementexpression - the XPath expressionprotected void adoptElement(DomXmlElement elementToAdopt)
elementToAdopt - the element to adoptpublic java.lang.String toString()
SpinXmlElementtoString in class SpinXmlElementpublic void writeToWriter(java.io.Writer writer)
SpinXmlElementwriteToWriter in class SpinXmlElementwriter - the writer to write toprotected javax.xml.xpath.XPathFactory getXPathFactory()
public <C> C mapTo(java.lang.Class<C> javaClass)
SpinXmlNodemapTo in class SpinXmlNode<SpinXmlElement>javaClass - Class to which the Xml should be mappedpublic <C> C mapTo(java.lang.String javaClass)
SpinXmlNodemapTo in class SpinXmlNode<SpinXmlElement>javaClass - canonical name of the classCopyright © 2014–2022 Camunda Services GmbH. All rights reserved.