Class XmlElement
java.lang.Object
software.amazon.awssdk.protocols.query.unmarshall.XmlElement
Represents an element in an XML document.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the attributes associated with the elementstatic XmlElement.Builder
builder()
children()
static XmlElement
empty()
getElementByName
(String tagName) Retrieves a single child element by tag name.getElementsByName
(String tagName) Get all child elements by the given tag name.getOptionalAttributeByName
(String attribute) Retrieves an optional attribute by attribute name.getOptionalElementByName
(String tagName) Retrieves a single child element by tag name.
-
Method Details
-
elementName
- Returns:
- Tag name of the element.
-
children
- Returns:
- The list of direct children of this element. May be empty.
-
getFirstChild
- Returns:
- The first child element of this element. Null if this element has no children.
-
getElementsByName
Get all child elements by the given tag name. This only returns direct children elements.- Parameters:
tagName
- Tag name of elements to retrieve.- Returns:
- List of elements or empty list of no elements found with given name.
-
getElementByName
Retrieves a single child element by tag name. If more than one element is found then this method will throw an exception.- Parameters:
tagName
- Tag name of element to get.- Returns:
- XmlElement with the matching tag name or null if no element exists.
- Throws:
SdkClientException
- If more than one element with the given tag name is found.
-
getOptionalElementByName
Retrieves a single child element by tag name. If more than one element is found then this method will throw an exception.- Parameters:
tagName
- Tag name of element to get.- Returns:
- Fulfilled
Optional
of XmlElement with the matching tag name or emptyOptional
if no element exists. - Throws:
SdkClientException
- If more than one element with the given tag name is found.
-
textContent
- Returns:
- Text content of this element.
-
getOptionalAttributeByName
Retrieves an optional attribute by attribute name. -
attributes
Retrieves the attributes associated with the element -
builder
- Returns:
- New
XmlElement.Builder
instance.
-
empty
- Returns:
- An empty
XmlElement
().
-