public abstract class SpinXmlElement extends SpinXmlNode<SpinXmlElement>
| Constructor and Description |
|---|
SpinXmlElement() |
| Modifier and Type | Method and Description |
|---|---|
abstract SpinXmlElement |
append(Collection<SpinXmlElement> childElements)
Appends child elements to this
element. |
abstract SpinXmlElement |
append(SpinXmlElement... childElements)
Appends child elements to this
element. |
abstract SpinXmlElement |
appendAfter(SpinXmlElement childElement,
SpinXmlElement existingChildElement)
|
abstract SpinXmlElement |
appendBefore(SpinXmlElement childElement,
SpinXmlElement existingChildElement)
Appends a child element to this element before the existing child element.
|
abstract SpinXmlAttribute |
attr(String attributeName)
Returns the wrapped attribute for an empty namespace and the given name.
|
abstract SpinXmlElement |
attr(String attributeName,
String value)
Sets the attribute value in the local namespace of this element.
|
abstract List<String> |
attrNames()
Returns all names of the attributes of this element.
|
abstract List<String> |
attrNames(String namespace)
Returns all names of the attributes in the given namespace.
|
abstract SpinXmlAttribute |
attrNs(String namespace,
String attributeName)
Returns the wrapped attribute for the given namespace and name.
|
abstract SpinXmlElement |
attrNs(String namespace,
String attributeName,
String value)
Sets the attribute value in the given namespace.
|
abstract SpinList<SpinXmlAttribute> |
attrs()
Returns all wrapped attributes of this element.
|
abstract SpinList<SpinXmlAttribute> |
attrs(String namespace)
Returns all wrapped attributes for the given namespace.
|
abstract SpinXmlElement |
childElement(String elementName)
Returns a single wrapped child element for the given name
in the local namespace of this element.
|
abstract SpinXmlElement |
childElement(String namespace,
String elementName)
Returns a single wrapped child
element for the given namespace
and name. |
abstract SpinList<SpinXmlElement> |
childElements()
Returns all child elements of this
elements. |
abstract SpinList<SpinXmlElement> |
childElements(String elementName)
Returns all child
elements with a given name in the local namespace
of this element. |
abstract SpinList<SpinXmlElement> |
childElements(String namespace,
String elementName)
Returns all child
elements with a given namespace and name. |
abstract boolean |
hasAttr(String attributeName)
Checks whether this element has a attribute with an empty namespace and the given name.
|
abstract boolean |
hasAttrNs(String namespace,
String attributeName)
Checks whether this element has a attribute with the given namespace and name.
|
abstract SpinXmlElement |
remove(Collection<SpinXmlElement> childElements)
Removes all child elements from this element.
|
abstract SpinXmlElement |
remove(SpinXmlElement... childElements)
Removes all child elements from this element.
|
abstract SpinXmlElement |
removeAttr(String attributeName)
Removes the attribute with an empty namespace.
|
abstract SpinXmlElement |
removeAttrNs(String namespace,
String attributeName)
Removes the attribute under the given namespace.
|
abstract SpinXmlElement |
replace(SpinXmlElement newChildElement)
Replaces this element by an new one.
|
abstract SpinXmlElement |
replaceChild(SpinXmlElement existingChildElement,
SpinXmlElement newChildElement)
Replaces an existing child element with a new one.
|
abstract String |
textContent()
Returns the text content of an element.
|
abstract SpinXmlElement |
textContent(String textContent)
Sets the text content of an element.
|
abstract String |
toString()
Returns the wrapped XML element as string representation.
|
abstract void |
writeToWriter(Writer writer)
Writes the wrapped XML element to a existing writer.
|
abstract SpinXPathQuery |
xPath(String expression)
Creates a XPath query on this element.
|
hasNamespace, hasPrefix, mapTo, mapTo, name, namespace, prefixpublic abstract boolean hasAttr(String attributeName)
attributeName - the name of the attributeIllegalArgumentException - if the attributeName is nullpublic abstract SpinXmlAttribute attr(String attributeName)
attributeName - the name of the attributeattributeIllegalArgumentException - if the attributeName is nullSpinXmlAttributeException - if the attribute is not foundpublic abstract SpinXmlElement attr(String attributeName, String value)
attributeName - the name of the attributevalue - the value to setelementIllegalArgumentException - if the attributeName or value is nullpublic abstract SpinXmlElement removeAttr(String attributeName)
attributeName - the name of the attributeelementIllegalArgumentException - if the attributeName is nullpublic abstract boolean hasAttrNs(String namespace, String attributeName)
namespace - the namespace of the attributeattributeName - the name of the attributeIllegalArgumentException - if the attributeName is nullpublic abstract SpinXmlAttribute attrNs(String namespace, String attributeName)
namespace - the namespace of the attributeattributeName - the name of the attributeattributeIllegalArgumentException - if attributeName or value is nullSpinXmlElementImplementationException - if the attribute cannot be set in the underlying implementationpublic abstract SpinXmlElement attrNs(String namespace, String attributeName, String value)
namespace - the namespace of the attributeattributeName - the name of the attributevalue - the value to setelementIllegalArgumentException - if attributeName or value is nullSpinXmlElementImplementationException - if the attribute cannot be set in the underlying implementationpublic abstract SpinXmlElement removeAttrNs(String namespace, String attributeName)
namespace - the namespace of the attributeattributeName - the name of the attributeelementIllegalArgumentException - if the attributeName is nullpublic abstract SpinList<SpinXmlAttribute> attrs()
public abstract SpinList<SpinXmlAttribute> attrs(String namespace)
namespace - the namespace of the attributespublic abstract List<String> attrNames()
public abstract List<String> attrNames(String namespace)
public abstract String textContent()
public abstract SpinXmlElement textContent(String textContent)
textContent - the text content to setelementIllegalArgumentException - if the textContent is nullpublic abstract SpinXmlElement childElement(String elementName)
elementName - the element nameelementIllegalArgumentException - if the elementName is nullSpinXmlElementException - if none or more than one child element is foundpublic abstract SpinXmlElement childElement(String namespace, String elementName)
element for the given namespace
and name.namespace - the namespace of the elementelementName - the element nameelementIllegalArgumentException - if the elementName is nullSpinXmlElementException - if none or more than one child element is foundpublic abstract SpinList<SpinXmlElement> childElements()
elements.elementspublic abstract SpinList<SpinXmlElement> childElements(String elementName)
elements with a given name in the local namespace
of this element.elementName - the element nameelementsIllegalArgumentException - if the element name is nullSpinXmlElementException - if no child element was foundpublic abstract SpinList<SpinXmlElement> childElements(String namespace, String elementName)
elements with a given namespace and name.namespace - the namespace of the elementelementName - the element nameelementsIllegalArgumentException - if the element name is nullSpinXmlElementException - if no child element was foundpublic abstract SpinXmlElement append(SpinXmlElement... childElements)
element.childElements - the child elements to appendelementIllegalArgumentException - if the childElements is null or one of themSpinXmlElementImplementationException - if a child element cannot be appended in the underlying implementationpublic abstract SpinXmlElement append(Collection<SpinXmlElement> childElements)
element.childElements - the child elements to appendelementIllegalArgumentException - if the childElements is null or one of themSpinXmlElementImplementationException - if a child element cannot be appended in the underlying implementationpublic abstract SpinXmlElement appendBefore(SpinXmlElement childElement, SpinXmlElement existingChildElement)
childElement - the child element to appendexistingChildElement - the child element to append beforeelementIllegalArgumentException - if the child element or existing child element is nullSpinXmlElementException - if the existing child element is not a child of this elementSpinXmlElementImplementationException - if the new child element cannot be inserted in the underlying implementationpublic abstract SpinXmlElement appendAfter(SpinXmlElement childElement, SpinXmlElement existingChildElement)
childElement - the child element to appendexistingChildElement - the child element to append afterelementIllegalArgumentException - if the child element or existing child element is nullSpinXmlElementException - if the existing child element is not a child of this elementSpinXmlElementImplementationException - if the new child element cannot be inserted in the underlying implementationpublic abstract SpinXmlElement remove(SpinXmlElement... childElements)
childElements - the child elements to removeelementIllegalArgumentException - if child elements is null or any of themSpinXmlElementException - if one of the child elements does not existSpinXmlElementImplementationException - if the child element cannot be removed in the underlying implementationpublic abstract SpinXmlElement remove(Collection<SpinXmlElement> childElements)
childElements - the child elements to removeelementIllegalArgumentException - if child elements is null or any of themSpinXmlElementException - if one of the child elements does not existSpinXmlElementImplementationException - if the child element cannot be removed in the underlying implementationpublic abstract SpinXmlElement replace(SpinXmlElement newChildElement)
newChildElement - the new elementelementIllegalArgumentException - if the new element is null or has the wrong typeSpinXmlElementException - if this element has no parent elementSpinXmlElementImplementationException - if the element cannot be replaced in the underlying implementationpublic abstract SpinXmlElement replaceChild(SpinXmlElement existingChildElement, SpinXmlElement newChildElement)
existingChildElement - the existing child element to replacenewChildElement - the new child elementelementIllegalArgumentException - if any of the child elements is nullSpinXmlElementException - if the existing element is not a child element of thisSpinXmlElementImplementationException - if the child cannot be replaced in the underlying implementationpublic abstract SpinXPathQuery xPath(String expression)
expression - the XPath expressionpublic abstract String toString()
toString in class Spin<SpinXmlElement>SpinXmlElementException - if the element cannot be transformed or no new transformer can be createdpublic abstract void writeToWriter(Writer writer)
writeToWriter in class Spin<SpinXmlElement>writer - the writer to write toSpinXmlElementException - if the element cannot be transformed or no new transformer can be createdCopyright © 2014–2020 Camunda Services GmbH. All rights reserved.