IMPLTYPE - implementation typepublic interface IMicroAttributeContainer<IMPLTYPE extends IMicroAttributeContainer<IMPLTYPE>> extends IMicroNode
| Modifier and Type | Method and Description |
|---|---|
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.functional.ITriConsumer<? super String,? super String,? super String> aConsumer)
Iterate all attribute objects.
|
com.helger.commons.collection.impl.ICommonsList<? extends IMicroAttribute> |
getAllAttributeObjs()
Get a list of all attributes.
|
com.helger.commons.collection.impl.ICommonsOrderedSet<IMicroQName> |
getAllAttributeQNames()
Get a set of all attribute names.
|
com.helger.commons.collection.impl.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.
|
Iterable<? extends IMicroAttribute> |
getAttributeObjs()
Get a iterable objects of all attributes.
|
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.
|
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() |
boolean |
hasNoAttributes() |
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 IMPLTYPE |
setAttribute(IMicroQName aAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(IMicroQName aAttrName,
double dAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(IMicroQName aAttrName,
float fAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(IMicroQName aAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(IMicroQName aAttrName,
int nAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(IMicroQName aAttrName,
long nAttrValue)
Set an attribute value of this element.
|
IMPLTYPE |
setAttribute(IMicroQName aAttrName,
String sAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sAttrName,
double dAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sAttrName,
float fAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sAttrName,
int nAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sAttrName,
long nAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sAttrName,
String sAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sNamespaceURI,
String sAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sNamespaceURI,
String sAttrName,
double dAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sNamespaceURI,
String sAttrName,
float fAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sNamespaceURI,
String sAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sNamespaceURI,
String sAttrName,
int nAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sNamespaceURI,
String sAttrName,
long nAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttribute(String sNamespaceURI,
String sAttrName,
String sAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttributeWithConversion(IMicroQName aAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttributeWithConversion(IMicroQName aAttrName,
String sAttrValue)
Deprecated.
|
default IMPLTYPE |
setAttributeWithConversion(String sAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttributeWithConversion(String sAttrName,
String sAttrValue)
Deprecated.
|
default IMPLTYPE |
setAttributeWithConversion(String sNamespaceURI,
String sAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
default IMPLTYPE |
setAttributeWithConversion(String sNamespaceURI,
String sAttrName,
String sAttrValue)
Deprecated.
|
appendCDATA, 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, 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 @ReturnsImmutableObject Iterable<? extends IMicroAttribute> getAttributeObjs()
null if hasAttributes() returns true.null.@Nullable @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<? extends IMicroAttribute> getAllAttributeObjs()
null.@Nullable @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsOrderedMap<IMicroQName,String> getAllQAttributes()
null if hasAttributes() returns
true.null.@Nullable @ReturnsMutableCopy com.helger.commons.collection.impl.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.functional.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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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 IMPLTYPE 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)@Deprecated @Nonnull @DevelopersNote(value="No need for setAttributeWithConversion - setAttribute is enough") default IMPLTYPE setAttributeWithConversion(@Nonnull String sAttrName, @Nullable String sAttrValue)
@Nonnull default IMPLTYPE 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)@Deprecated @Nonnull @DevelopersNote(value="No need for setAttributeWithConversion - setAttribute is enough") default IMPLTYPE setAttributeWithConversion(@Nullable String sNamespaceURI, @Nonnull String sAttrName, @Nullable String sAttrValue)
@Nonnull default IMPLTYPE 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)@Deprecated @Nonnull @DevelopersNote(value="No need for setAttributeWithConversion - setAttribute is enough") default IMPLTYPE setAttributeWithConversion(@Nonnull IMicroQName aAttrName, @Nullable String sAttrValue)
@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.Copyright © 2014–2018 Philip Helger. All rights reserved.