public interface IMicroElement extends IMicroNodeWithChildren
| 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 com.helger.commons.filter.IFilter<IMicroElement> |
filterName(String sTagOrLocalName) |
static com.helger.commons.filter.IFilter<IMicroElement> |
filterNamespaceURI(String sNamespaceURI) |
static com.helger.commons.filter.IFilter<IMicroElement> |
filterNamespaceURIAndName(String sNamespaceURI,
String sTagOrLocalName) |
IMicroElement |
findFirstChildElement(Predicate<? super IMicroElement> aFilter) |
void |
forAllAttributes(BiConsumer<? super IMicroQName,? super String> aConsumer)
Iterate all attribute objects.
|
void |
forAllAttributes(Consumer<? super IMicroAttribute> aConsumer)
Iterate all attribute objects.
|
void |
forAllAttributes(com.helger.commons.function.ITriConsumer<? super String,? super String,? super String> aConsumer)
Iterate all attribute objects.
|
default void |
forAllChildElements(Consumer<? super IMicroElement> aConsumer) |
void |
forAllChildElements(Predicate<? super IMicroElement> aFilter,
Consumer<? super IMicroElement> aConsumer) |
default com.helger.commons.state.EContinue |
forAllChildElementsBreakable(com.helger.commons.function.IBreakableConsumer<? super IMicroElement> aConsumer) |
com.helger.commons.state.EContinue |
forAllChildElementsBreakable(Predicate<? super IMicroElement> aFilter,
com.helger.commons.function.IBreakableConsumer<? super IMicroElement> aConsumer) |
com.helger.commons.collection.ext.ICommonsList<? extends IMicroAttribute> |
getAllAttributeObjs()
Get a list of all attributes.
|
com.helger.commons.collection.ext.ICommonsOrderedSet<IMicroQName> |
getAllAttributeQNames()
Get a set of all attribute names.
|
default com.helger.commons.collection.ext.ICommonsList<IMicroElement> |
getAllChildElements()
Get a list of all direct child elements.
|
default com.helger.commons.collection.ext.ICommonsList<IMicroElement> |
getAllChildElements(Predicate<? super IMicroElement> aFilter)
Get a list of all direct child elements matching the provided filter.
|
default com.helger.commons.collection.ext.ICommonsList<IMicroElement> |
getAllChildElements(String sTagName)
Get a list of all direct child elements having the specified tag name.
|
default com.helger.commons.collection.ext.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.ext.ICommonsList<IMicroElement> |
getAllChildElementsRecursive()
Recursively get all child elements.
|
com.helger.commons.collection.ext.ICommonsOrderedMap<IMicroQName,String> |
getAllQAttributes()
Get a map of all fully qualified attribute names and values.
|
int |
getAttributeCount() |
IMicroAttribute |
getAttributeObj(IMicroQName aAttrName)
Get the attribute object with the specified qualified name.
|
default IMicroAttribute |
getAttributeObj(String sAttrName)
Get the attribute object with the specified name.
|
default IMicroAttribute |
getAttributeObj(String sNamespaceURI,
String sAttrName)
Get the attribute object with the specified namespace URI and local name.
|
default String |
getAttributeValue(IMicroQName aAttrName)
Get the attribute value of the given attribute name.
|
default String |
getAttributeValue(String sAttrName)
Get the attribute value of the given attribute name.
|
default String |
getAttributeValue(String sNamespaceURI,
String sAttrName)
Get the attribute value of the given attribute name.
|
default boolean |
getAttributeValueAsBool(IMicroQName aAttrName,
boolean bDefault) |
default boolean |
getAttributeValueAsBool(String sAttrName,
boolean bDefault) |
default boolean |
getAttributeValueAsBool(String sNamespaceURI,
String sAttrName,
boolean bDefault) |
default double |
getAttributeValueAsDouble(IMicroQName aAttrName,
double dDefault) |
default double |
getAttributeValueAsDouble(String sAttrName,
double dDefault) |
default double |
getAttributeValueAsDouble(String sNamespaceURI,
String sAttrName,
double dDefault) |
default float |
getAttributeValueAsFloat(IMicroQName aAttrName,
float fDefault) |
default float |
getAttributeValueAsFloat(String sAttrName,
float fDefault) |
default float |
getAttributeValueAsFloat(String sNamespaceURI,
String sAttrName,
float fDefault) |
default int |
getAttributeValueAsInt(IMicroQName aAttrName,
int nDefault) |
default int |
getAttributeValueAsInt(String sAttrName,
int nDefault) |
default int |
getAttributeValueAsInt(String sNamespaceURI,
String sAttrName,
int nDefault) |
default long |
getAttributeValueAsLong(IMicroQName aAttrName,
long nDefault) |
default long |
getAttributeValueAsLong(String sAttrName,
long nDefault) |
default long |
getAttributeValueAsLong(String sNamespaceURI,
String sAttrName,
long nDefault) |
<DSTTYPE> DSTTYPE |
getAttributeValueWithConversion(IMicroQName aAttrName,
Class<DSTTYPE> aDstClass)
Get the attribute value of the given attribute name.
|
default <DSTTYPE> DSTTYPE |
getAttributeValueWithConversion(String sAttrName,
Class<DSTTYPE> aDstClass)
Get the attribute value of the given attribute name.
|
default <DSTTYPE> DSTTYPE |
getAttributeValueWithConversion(String sNamespaceURI,
String sAttrName,
Class<DSTTYPE> aDstClass)
Get the attribute value of the given attribute name.
|
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.
|
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.
|
boolean |
hasAttribute(IMicroQName aAttrName)
Check if this element has an attribute with the specified name.
|
default boolean |
hasAttribute(String sAttrName)
Check if this element has an attribute with the specified name.
|
default boolean |
hasAttribute(String sNamespaceURI,
String sAttrName)
Check if this element has an attribute with the specified name.
|
boolean |
hasAttributes() |
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.
|
boolean |
hasNoAttributes() |
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.
|
com.helger.commons.state.EChange |
removeAllAttributes()
Remove all attributes from this element
|
com.helger.commons.state.EChange |
removeAttribute(IMicroQName aAttrName)
Remove the attribute with the given name.
|
default com.helger.commons.state.EChange |
removeAttribute(String sAttrName)
Remove the attribute with the given name.
|
default com.helger.commons.state.EChange |
removeAttribute(String sNamespaceURI,
String sAttrName)
Remove the attribute with the given name.
|
default IMicroElement |
setAttribute(IMicroQName aAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(IMicroQName aAttrName,
double dAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(IMicroQName aAttrName,
float fAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(IMicroQName aAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(IMicroQName aAttrName,
int nAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(IMicroQName aAttrName,
long nAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(IMicroQName aAttrName,
String sAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sAttrName,
double dAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sAttrName,
float fAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sAttrName,
int nAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sAttrName,
long nAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sAttrName,
String sAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
double dAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
float fAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
int nAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
long nAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
String sAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttributeWithConversion(IMicroQName aAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttributeWithConversion(String sAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
default IMicroElement |
setAttributeWithConversion(String sNamespaceURI,
String sAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
com.helger.commons.state.EChange |
setNamespaceURI(String sNamespaceURI)
Set a new namespace URI for this element.
|
getTextContent, getTextContentTrimmed, getTextContentWithConversionappendCDATA, appendCDATA, appendCDATA, appendCDATAWithConversion, appendChild, appendComment, appendComment, appendComment, appendCommentWithConversion, appendContainer, appendElement, appendElement, appendEntityReference, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendIgnorableWhitespaceText, appendProcessingInstruction, appendText, appendText, appendText, appendTextWithConversion, containsAnyChild, detachFromParent, 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, getChildAtIndexboolean hasAttributes()
true if this element has at least one attribute,
false otherwiseboolean hasNoAttributes()
true if this element has no attribute,
false if at least one attribute is present.@Nonnegative int getAttributeCount()
default boolean hasAttribute(@Nullable String sAttrName)
sAttrName - The attribute name to check.true if such an attribute is present,
false otherwisedefault boolean hasAttribute(@Nullable String sNamespaceURI, @Nullable String sAttrName)
sNamespaceURI - Namespace URI to use. May be null.sAttrName - The attribute name to check.true if such an attribute is present,
false otherwiseboolean hasAttribute(@Nullable IMicroQName aAttrName)
aAttrName - The qualified attribute name to check. May be null.true if such an attribute is present,
false otherwise@Nullable default IMicroAttribute getAttributeObj(@Nullable String sAttrName)
sAttrName - The attribute locale name to query. May be null.null of no such attribute object exists.@Nullable default IMicroAttribute getAttributeObj(@Nullable String sNamespaceURI, @Nullable String sAttrName)
sNamespaceURI - Namespace URI to use. May be null.sAttrName - The attribute locale name to query. May be null.null of no such attribute object exists.@Nullable IMicroAttribute getAttributeObj(@Nullable IMicroQName aAttrName)
aAttrName - The qualified attribute name to check. May be null.null of no such attribute object exists.@Nullable default String getAttributeValue(@Nullable String sAttrName)
null is returned.sAttrName - The attribute name to retrieve the value of.null.@Nullable default String getAttributeValue(@Nullable String sNamespaceURI, @Nullable String sAttrName)
null is returned.sNamespaceURI - Namespace URI to use. May be null.sAttrName - The attribute name to retrieve the value of.null.@Nullable default String getAttributeValue(@Nullable IMicroQName aAttrName)
null is returned.aAttrName - The qualified attribute name to retrieve the value of. May be
null.null.@Nullable default <DSTTYPE> DSTTYPE getAttributeValueWithConversion(@Nullable String sAttrName, @Nonnull Class<DSTTYPE> aDstClass)
null is returned. The attribute value is
converted via the TypeConverter to
the desired destination class. If no such attribute is present,
null is returned.DSTTYPE - Destination typesAttrName - The attribute name to retrieve the value of.aDstClass - The destination class.null.ClassCastException - if the value cannot be converted@Nullable default <DSTTYPE> DSTTYPE getAttributeValueWithConversion(@Nullable String sNamespaceURI, @Nullable String sAttrName, @Nonnull Class<DSTTYPE> aDstClass)
null is returned. The attribute value is
converted via the TypeConverter to
the desired destination class. If no such attribute is present,
null is returned.DSTTYPE - Destination typesNamespaceURI - Namespace URI to use. May be null.sAttrName - The attribute name to retrieve the value of.aDstClass - The destination class.null.ClassCastException - if the value cannot be converted@Nullable <DSTTYPE> DSTTYPE getAttributeValueWithConversion(@Nullable IMicroQName aAttrName, @Nonnull Class<DSTTYPE> aDstClass)
null is returned. The attribute value is
converted via the TypeConverter to
the desired destination class. If no such attribute is present,
null is returned.DSTTYPE - Destination typeaAttrName - The attribute qualified name to retrieve the value of.aDstClass - The destination class.null.ClassCastException - if the value cannot be converteddefault boolean getAttributeValueAsBool(@Nullable String sAttrName, boolean bDefault)
default boolean getAttributeValueAsBool(@Nullable String sNamespaceURI, @Nullable String sAttrName, boolean bDefault)
default boolean getAttributeValueAsBool(@Nullable IMicroQName aAttrName, boolean bDefault)
default double getAttributeValueAsDouble(@Nullable String sAttrName, double dDefault)
default double getAttributeValueAsDouble(@Nullable String sNamespaceURI, @Nullable String sAttrName, double dDefault)
default double getAttributeValueAsDouble(@Nullable IMicroQName aAttrName, double dDefault)
default float getAttributeValueAsFloat(@Nullable String sAttrName, float fDefault)
default float getAttributeValueAsFloat(@Nullable String sNamespaceURI, @Nullable String sAttrName, float fDefault)
default float getAttributeValueAsFloat(@Nullable IMicroQName aAttrName, float fDefault)
default int getAttributeValueAsInt(@Nullable String sNamespaceURI, @Nullable String sAttrName, int nDefault)
default int getAttributeValueAsInt(@Nullable IMicroQName aAttrName, int nDefault)
default long getAttributeValueAsLong(@Nullable String sAttrName, long nDefault)
default long getAttributeValueAsLong(@Nullable String sNamespaceURI, @Nullable String sAttrName, long nDefault)
default long getAttributeValueAsLong(@Nullable IMicroQName aAttrName, long nDefault)
@Nullable @ReturnsMutableCopy com.helger.commons.collection.ext.ICommonsList<? extends IMicroAttribute> getAllAttributeObjs()
null.@Nullable @ReturnsMutableCopy com.helger.commons.collection.ext.ICommonsOrderedMap<IMicroQName,String> getAllQAttributes()
null if hasAttributes() returns
true.null.@Nullable @ReturnsMutableCopy com.helger.commons.collection.ext.ICommonsOrderedSet<IMicroQName> getAllAttributeQNames()
null.void forAllAttributes(@Nonnull Consumer<? super IMicroAttribute> aConsumer)
aConsumer - The consumer. May not be null. May only perform reading
operations!void forAllAttributes(@Nonnull BiConsumer<? super IMicroQName,? super String> aConsumer)
aConsumer - The consumer that takes the QName and the value. May not be
null. May only perform reading operations!void forAllAttributes(@Nonnull com.helger.commons.function.ITriConsumer<? super String,? super String,? super String> aConsumer)
aConsumer - The consumer that takes the namespace URI, the attribute local name
and the attribute value. May not be null. May only
perform reading operations!@Nonnull default IMicroElement setAttribute(@Nonnull String sAttrName, @Nullable String sAttrValue)
sAttrName - Name of the attribute. May neither be null nor empty.sAttrValue - If the value is null the attribute is removed (if
present)@Nonnull default IMicroElement setAttribute(@Nullable String sNamespaceURI, @Nonnull String sAttrName, @Nullable String sAttrValue)
sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.sAttrValue - If the value is null the attribute is removed (if
present)@Nonnull IMicroElement setAttribute(@Nonnull IMicroQName aAttrName, @Nullable String sAttrValue)
aAttrName - Qualified name of the attribute. May neither be null
nor empty.sAttrValue - If the value is null the attribute is removed (if
present)@Nonnull default IMicroElement setAttribute(@Nonnull String sAttrName, @Nonnull IHasAttributeValue aAttrValueProvider)
sAttrName - Name of the attribute. May neither be null nor empty.aAttrValueProvider - The attribute value provider. May not be null. If the
contained attribute value is null the attribute is
removed (if present)@Nonnull default IMicroElement setAttribute(@Nullable String sNamespaceURI, @Nonnull String sAttrName, @Nonnull IHasAttributeValue aAttrValueProvider)
sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.aAttrValueProvider - The attribute value provider. May not be null. If the
contained attribute value is null the attribute is
removed (if present)@Nonnull default IMicroElement setAttribute(@Nonnull IMicroQName aAttrName, @Nonnull IHasAttributeValue aAttrValueProvider)
aAttrName - Qualified name of the attribute. May neither be null
nor empty.aAttrValueProvider - The attribute value provider. May not be null. If the
contained attribute value is null the attribute is
removed (if present)@Nonnull default IMicroElement setAttribute(@Nonnull String sAttrName, boolean bAttrValue)
setAttribute(sAttrName, Boolean.toString (nValue)). That
means, that the serialized value of the attribute is either
true or false. If you need something else (like
"yes" or "no") don't use this method.sAttrName - Name of the attribute. May neither be null nor empty.bAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nullable String sNamespaceURI, @Nonnull String sAttrName, boolean bAttrValue)
setAttribute(sNamespaceURI, sAttrName, Boolean.toString (nValue))
. That means, that the serialized value of the attribute is either
true or false. If you need something else (like
"yes" or "no") don't use this method.sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.bAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull IMicroQName aAttrName, boolean bAttrValue)
setAttribute(aAttrName, Boolean.toString (nValue)). That
means, that the serialized value of the attribute is either
true or false. If you need something else (like
"yes" or "no") don't use this method.aAttrName - Qualified name of the attribute. May neither be null
nor empty.bAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull String sAttrName, double dAttrValue)
setAttribute(sAttrName, Double.toString (nValue)).sAttrName - Name of the attribute. May neither be null nor empty.dAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nullable String sNamespaceURI, @Nonnull String sAttrName, double dAttrValue)
setAttribute(sNamespaceURI, sAttrName, Double.toString (nValue))
.sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.dAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull IMicroQName aAttrName, double dAttrValue)
setAttribute(aAttrName, Double.toString (nValue)).aAttrName - Qualified name of the attribute. May neither be null
nor empty.dAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull String sAttrName, float fAttrValue)
setAttribute(sAttrName, Float.toString (nValue)).sAttrName - Name of the attribute. May neither be null nor empty.fAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nullable String sNamespaceURI, @Nonnull String sAttrName, float fAttrValue)
setAttribute(sNamespaceURI, sAttrName, Float.toString (nValue))
.sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.fAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull IMicroQName aAttrName, float fAttrValue)
setAttribute(aAttrName, Float.toString (nValue)).aAttrName - Qualified name of the attribute. May neither be null
nor empty.fAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull String sAttrName, int nAttrValue)
setAttribute(sAttrName, Integer.toString (nValue)).sAttrName - Name of the attribute. May neither be null nor empty.nAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nullable String sNamespaceURI, @Nonnull String sAttrName, int nAttrValue)
setAttribute(sNamespaceURI, sAttrName, Integer.toString (nValue))
.sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.nAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull IMicroQName aAttrName, int nAttrValue)
setAttribute(aAttrName, Integer.toString (nValue)).aAttrName - Qualified name of the attribute. May neither be null
nor empty.nAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull String sAttrName, long nAttrValue)
setAttribute(name, Long.toString (nValue)).sAttrName - Name of the attribute. May neither be null nor empty.nAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nullable String sNamespaceURI, @Nonnull String sAttrName, long nAttrValue)
setAttribute(name, Long.toString (nValue)).sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.nAttrValue - The new value to be set.@Nonnull default IMicroElement setAttribute(@Nonnull IMicroQName aAttrName, long nAttrValue)
setAttribute(name, Long.toString (nValue)).aAttrName - Qualified name of the attribute. May neither be null
nor empty.nAttrValue - The new value to be set.@Nonnull default IMicroElement setAttributeWithConversion(@Nonnull String sAttrName, @Nullable Object aAttrValue)
String, the TypeConverter is
invoked to convert it to a String object.sAttrName - Name of the attribute. May neither be null nor empty.aAttrValue - If the value is null the attribute is removed (if
present)@Nonnull default IMicroElement setAttributeWithConversion(@Nullable String sNamespaceURI, @Nonnull String sAttrName, @Nullable Object aAttrValue)
String, the TypeConverter is
invoked to convert it to a String object.sNamespaceURI - Namespace URI to use. May be null.sAttrName - Name of the attribute. May neither be null nor empty.aAttrValue - If the value is null the attribute is removed (if
present)@Nonnull default IMicroElement setAttributeWithConversion(@Nonnull IMicroQName aAttrName, @Nullable Object aAttrValue)
String, the TypeConverter is
invoked to convert it to a String object.aAttrName - Qualified name of the attribute. May neither be null
nor empty.aAttrValue - If the value is null the attribute is removed (if
present)@Nonnull default com.helger.commons.state.EChange removeAttribute(@Nullable String sAttrName)
sAttrName - The name of the attribute to be removed. May be null.EChange.CHANGED if the attribute was removed,
EChange.UNCHANGED if no such attribute exists at this
element.@Nonnull default com.helger.commons.state.EChange removeAttribute(@Nullable String sNamespaceURI, @Nullable String sAttrName)
sNamespaceURI - Namespace URI to use. May be null.sAttrName - The name of the attribute to be removed. May be null.EChange.CHANGED if the attribute was removed,
EChange.UNCHANGED if no such attribute exists at this
element.@Nonnull com.helger.commons.state.EChange removeAttribute(@Nullable IMicroQName aAttrName)
aAttrName - The qualified name of the attribute to be removed. May be
null.EChange.CHANGED if the attribute was removed,
EChange.UNCHANGED if no such attribute exists at this
element.@Nonnull com.helger.commons.state.EChange removeAllAttributes()
EChange.@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.@Nonnegative default int getChildElementCount()
@Nonnegative default int getChildElementCount(@Nullable Predicate<? super IMicroElement> aFilter)
aFilter - The filter to be applied. May be null.@Nonnull static com.helger.commons.filter.IFilter<IMicroElement> filterNamespaceURI(@Nullable String sNamespaceURI)
@Nonnull static com.helger.commons.filter.IFilter<IMicroElement> filterName(@Nullable String sTagOrLocalName)
@Nonnull static com.helger.commons.filter.IFilter<IMicroElement> filterNamespaceURIAndName(@Nullable String sNamespaceURI, @Nullable String sTagOrLocalName)
@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.ext.ICommonsList<IMicroElement> getAllChildElements()
null.@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.ext.ICommonsList<IMicroElement> getAllChildElements(@Nullable String sTagName)
sTagName - The tag name to check. May be null.null.@Nonnull @ReturnsMutableCopy default com.helger.commons.collection.ext.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.ext.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.ext.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 findFirstChildElement(@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 com.helger.commons.function.IBreakableConsumer<? super IMicroElement> aConsumer)
@Nonnull com.helger.commons.state.EContinue forAllChildElementsBreakable(@Nullable Predicate<? super IMicroElement> aFilter, @Nonnull com.helger.commons.function.IBreakableConsumer<? super IMicroElement> aConsumer)
@Nonnull IMicroElement getClone()
getClone in interface com.helger.commons.lang.ICloneable<IMicroNode>getClone in interface IMicroNodeWithChildrenCopyright © 2014–2016 Philip Helger. All rights reserved.