public interface IMicroElement extends IMicroNodeWithChildren, IMicroAttributeContainer<IMicroElement>
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAnyChildElement(Predicate<? super IMicroElement> aFilter)
Check if this element has at least one direct child element that matches
the provided filter.
|
static Predicate<? super IMicroElement> |
filterName(String sTagOrLocalName) |
static Predicate<? super IMicroElement> |
filterNamespaceURI(String sNamespaceURI) |
static Predicate<? super IMicroElement> |
filterNamespaceURIAndName(String sNamespaceURI,
String sTagOrLocalName) |
default void |
forAllChildElements(Consumer<? super IMicroElement> aConsumer) |
void |
forAllChildElements(Predicate<? super IMicroElement> aFilter,
Consumer<? super IMicroElement> aConsumer) |
default com.helger.commons.state.EContinue |
forAllChildElementsBreakable(Function<? super IMicroElement,com.helger.commons.state.EContinue> aConsumer) |
com.helger.commons.state.EContinue |
forAllChildElementsBreakable(Predicate<? super IMicroElement> aFilter,
Function<? super IMicroElement,com.helger.commons.state.EContinue> aConsumer) |
default com.helger.commons.collection.impl.ICommonsList<IMicroElement> |
getAllChildElements()
Get a list of all direct child elements.
|
default com.helger.commons.collection.impl.ICommonsList<IMicroElement> |
getAllChildElements(Predicate<? super IMicroElement> aFilter)
Get a list of all direct child elements matching the provided filter.
|
default com.helger.commons.collection.impl.ICommonsList<IMicroElement> |
getAllChildElements(String sTagName)
Get a list of all direct child elements having the specified tag name.
|
default com.helger.commons.collection.impl.ICommonsList<IMicroElement> |
getAllChildElements(String sNamespaceURI,
String sLocalName)
Get a list of all direct child elements having the specified namespace and
the specified tag name.
|
com.helger.commons.collection.impl.ICommonsList<IMicroElement> |
getAllChildElementsRecursive()
Recursively get all child elements.
|
default int |
getChildElementCount()
Get the number of all direct child elements.
|
default int |
getChildElementCount(Predicate<? super IMicroElement> aFilter)
Get the number of direct child elements that match the provided filter.
|
IMicroElement |
getClone() |
default IMicroElement |
getFirstChildElement()
Get the first child element of this element.
|
IMicroElement |
getFirstChildElement(Predicate<? super IMicroElement> aFilter) |
default IMicroElement |
getFirstChildElement(String sTagName)
Get the first child element with the given tag name.
|
default IMicroElement |
getFirstChildElement(String sNamespaceURI,
String sLocalName)
Get the first child element with the given tag name and the given
namespace.
|
String |
getLocalName()
Get the local name of the element.
|
String |
getNamespaceURI()
Get the namespace URI of this element
|
String |
getTagName()
Get the name of the tag.
|
default boolean |
hasChildElements()
Check if this element has at least one direct child element.
|
default boolean |
hasChildElements(String sTagName)
Check if this element has at least one direct child element with the
specified tag name.
|
default boolean |
hasChildElements(String sNamespaceURI,
String sLocalName)
Check if this element has at least one direct child element with the
specified namespace URI and tag name.
|
default boolean |
hasLocalName(String sLocalName)
Check if this element has the provided local name.
|
default boolean |
hasNamespaceURI()
Check if this element has a specified namespace URI.
|
default boolean |
hasNamespaceURI(String sNamespaceURI)
Check if this element has the specified namespace URI.
|
default boolean |
hasNoNamespaceURI()
Check if this element has no namespace URI.
|
default boolean |
hasTagName(String sTagName)
Check if this element has the provided tag name.
|
default boolean |
hasTagNameIgnoreCase(String sTagName)
Check if this element has the provided tag name but ignoring case.
|
com.helger.commons.state.EChange |
setNamespaceURI(String sNamespaceURI)
Set a new namespace URI for this element.
|
getTextContent, getTextContentTrimmed, getTextContentWithConversionforAllAttributes, forAllAttributes, forAllAttributes, getAllAttributeObjs, getAllAttributeQNames, getAllQAttributes, getAttributeCount, getAttributeObj, getAttributeObj, getAttributeObj, getAttributeObjs, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValueAsBool, getAttributeValueAsBool, getAttributeValueAsBool, getAttributeValueAsDouble, getAttributeValueAsDouble, getAttributeValueAsDouble, getAttributeValueAsFloat, getAttributeValueAsFloat, getAttributeValueAsFloat, getAttributeValueAsInt, getAttributeValueAsInt, getAttributeValueAsInt, getAttributeValueAsLong, getAttributeValueAsLong, getAttributeValueAsLong, getAttributeValueWithConversion, getAttributeValueWithConversion, getAttributeValueWithConversion, hasAttribute, hasAttribute, hasAttribute, hasAttributes, hasNoAttributes, removeAllAttributes, removeAttribute, removeAttribute, removeAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeWithConversion, setAttributeWithConversion, setAttributeWithConversion, setAttributeWithConversion, setAttributeWithConversion, setAttributeWithConversionappendCDATA, appendCDATA, appendCDATA, appendCDATAWithConversion, appendChild, appendChildren, appendChildren, appendComment, appendComment, appendComment, appendCommentWithConversion, appendContainer, appendElement, appendElement, appendEntityReference, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendProcessingInstruction, appendText, appendText, appendText, appendTextWithConversion, containsAnyChild, detachFromParent, findParentElement, getAllChildren, getAllChildrenRecursive, getAllEventTargets, getAllEventTargets, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeValue, getParent, getParentElementWithName, getParentElementWithName, getPreviousSibling, getType, hasParent, insertAfter, insertAtIndex, insertBefore, isCDATA, isComment, isContainer, isDocument, isDocumentType, isElement, isEntityReference, isEqualContent, isProcessingInstruction, isText, registerEventTarget, removeAllChildren, removeChild, removeChildAtIndex, replaceChild, unregisterEventTargetfindFirstChild, findFirstChildMapped, getChildAtIndex@Nullable String getNamespaceURI()
null if this element has no namespace URI.@Nonnull com.helger.commons.state.EChange setNamespaceURI(@Nullable String sNamespaceURI)
sNamespaceURI - The namespace URI to be set. May be null or empty to
indicate that the namespace should be removed.EChangedefault boolean hasNamespaceURI()
true if this element has a specified namespace URI,
false otherwisedefault boolean hasNoNamespaceURI()
true if this element has no namespace URI,
false otherwisedefault boolean hasNamespaceURI(@Nullable String sNamespaceURI)
sNamespaceURI - The namespace URI to check. May not be null.true if this element has the specified namespace URI,
false otherwise@Nullable String getLocalName()
getTagName() but it is only present, if a namespace URI is
present.null if no namespace is present.default boolean hasLocalName(@Nullable String sLocalName)
getTagName() but is only present if a
namespace URI is present.sLocalName - The local name to compare against. May be null.true if local name and the passed name match.@Nonnull String getTagName()
getLocalName() if a namespace URI is present.null.default boolean hasTagName(@Nullable String sTagName)
sTagName - The tag name to compare against. May be null.true if tag name and the passed name match.default boolean hasTagNameIgnoreCase(@Nullable String sTagName)
sTagName - The tag name to compare against. May be null.true if tag name and the passed name match case
insensitive.@Nonnegative default int getChildElementCount()
@Nonnegative default int getChildElementCount(@Nullable Predicate<? super IMicroElement> aFilter)
aFilter - The filter to be applied. May be null.@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.impl.ICommonsList<IMicroElement> getAllChildElements()
null.@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.impl.ICommonsList<IMicroElement> getAllChildElements(@Nullable String sTagName)
sTagName - The tag name to check. May be null.null.@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.impl.ICommonsList<IMicroElement> getAllChildElements(@Nullable String sNamespaceURI, @Nullable String sLocalName)
sNamespaceURI - The namespace URI to check. May be null.sLocalName - The tag name to check. May be null.null.@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.impl.ICommonsList<IMicroElement> getAllChildElements(@Nullable Predicate<? super IMicroElement> aFilter)
aFilter - The filter to be applied. May be null in which all
direct child elements are returned.null.@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<IMicroElement> getAllChildElementsRecursive()
null but empty.default boolean hasChildElements()
true if this element has at least one child elementdefault boolean hasChildElements(@Nullable String sTagName)
sTagName - The tag name to check. May be null.true if this element has at least one child element
with the specified tag namedefault boolean hasChildElements(@Nullable String sNamespaceURI, @Nullable String sLocalName)
sNamespaceURI - The namespace URI to check. May be null.sLocalName - The tag name to check. May be null.true if this element has at least one child element
with the specified namespace URI and tag nameboolean containsAnyChildElement(@Nullable Predicate<? super IMicroElement> aFilter)
aFilter - The filter to be applied. May be null.true if this element has at least one direct child
element that matches the passed filter, false
otherwise.@Nullable default IMicroElement getFirstChildElement()
null if this element has no
child element.@Nullable default IMicroElement getFirstChildElement(@Nullable String sTagName)
sTagName - The tag name of the element to search. May be null.null if no such child element is present@Nullable default IMicroElement getFirstChildElement(@Nullable String sNamespaceURI, @Nullable String sLocalName)
sNamespaceURI - The namespace URL to search.sLocalName - The tag name of the element to search.null if no such child element is present@Nullable IMicroElement getFirstChildElement(@Nullable Predicate<? super IMicroElement> aFilter)
default void forAllChildElements(@Nonnull Consumer<? super IMicroElement> aConsumer)
void forAllChildElements(@Nullable Predicate<? super IMicroElement> aFilter, @Nonnull Consumer<? super IMicroElement> aConsumer)
@Nonnull default com.helger.commons.state.EContinue forAllChildElementsBreakable(@Nonnull Function<? super IMicroElement,com.helger.commons.state.EContinue> aConsumer)
@Nonnull com.helger.commons.state.EContinue forAllChildElementsBreakable(@Nullable Predicate<? super IMicroElement> aFilter, @Nonnull Function<? super IMicroElement,com.helger.commons.state.EContinue> aConsumer)
@Nonnull IMicroElement getClone()
getClone in interface com.helger.commons.lang.ICloneable<IMicroNode>getClone in interface IMicroNodeWithChildren@Nonnull static Predicate<? super IMicroElement> filterNamespaceURI(@Nullable String sNamespaceURI)
@Nonnull static Predicate<? super IMicroElement> filterName(@Nullable String sTagOrLocalName)
Copyright © 2014–2023 Philip Helger. All rights reserved.