public interface IMicroElement extends IMicroNodeWithChildren
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getAllAttributeNames()
Get a set of all attribute names.
|
List<? extends IMicroAttribute> |
getAllAttributeObjs()
Get a list of all attributes.
|
Set<IMicroQName> |
getAllAttributeQNames()
Get a set of all attribute names.
|
Collection<String> |
getAllAttributeValues()
Get a set of all attribute values.
|
List<IMicroElement> |
getAllChildElements()
Get a list of all direct child elements.
|
List<IMicroElement> |
getAllChildElements(String sTagName)
Get a list of all direct child elements having the specified tag name.
|
List<IMicroElement> |
getAllChildElements(String sNamespaceURI,
String sLocalName)
Get a list of all direct child elements having the specified namespace and
the specified tag name.
|
List<IMicroElement> |
getAllChildElementsRecursive()
Recursively get all child elements.
|
Map<IMicroQName,String> |
getAllQAttributes()
Get a map of all fully qualified attribute names and values.
|
int |
getAttributeCount() |
Iterator<? extends IMicroAttribute> |
getAttributeIterator()
Get an iterator over all attributes.
|
IMicroAttribute |
getAttributeObj(IMicroQName aAttrName)
Get the attribute object with the specified qualified name.
|
IMicroAttribute |
getAttributeObj(String sAttrName)
Get the attribute object with the specified name.
|
IMicroAttribute |
getAttributeObj(String sNamespaceURI,
String sAttrName)
Get the attribute object with the specified namespace URI and local name.
|
String |
getAttributeValue(IMicroQName aAttrName)
Get the attribute value of the given attribute name.
|
String |
getAttributeValue(String sAttrName)
Get the attribute value of the given attribute name.
|
String |
getAttributeValue(String sNamespaceURI,
String sAttrName)
Get the attribute value of the given attribute name.
|
<DSTTYPE> DSTTYPE |
getAttributeValueWithConversion(IMicroQName aAttrName,
Class<DSTTYPE> aDstClass)
Get the attribute value of the given attribute name.
|
<DSTTYPE> DSTTYPE |
getAttributeValueWithConversion(String sAttrName,
Class<DSTTYPE> aDstClass)
Get the attribute value of the given attribute name.
|
<DSTTYPE> DSTTYPE |
getAttributeValueWithConversion(String sNamespaceURI,
String sAttrName,
Class<DSTTYPE> aDstClass)
Get the attribute value of the given attribute name.
|
int |
getChildElementCount() |
IMicroElement |
getClone() |
IMicroElement |
getFirstChildElement()
Get the first child element of this element.
|
IMicroElement |
getFirstChildElement(String sTagName)
Get the first child element with the given tag name.
|
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.
|
boolean |
hasAttribute(String sAttrName)
Check if this element has an attribute with the specified name.
|
boolean |
hasAttribute(String sNamespaceURI,
String sAttrName)
Check if this element has an attribute with the specified name.
|
boolean |
hasAttributes() |
boolean |
hasChildElements()
Check if this element has at least one child element.
|
boolean |
hasChildElements(String sTagName)
Check if this element has at least one child element with the specified tag
name.
|
boolean |
hasChildElements(String sNamespaceURI,
String sLocalName)
Check if this element has at least one child element with the specified
namespace URI and tag name.
|
boolean |
hasNamespaceURI()
Check if this element has a specified namespace URI.
|
boolean |
hasNamespaceURI(String sNamespaceURI)
Check if this element has the specified namespace URI.
|
boolean |
hasNoAttributes() |
boolean |
hasNoNamespaceURI()
Check if this element has no namespace URI.
|
EChange |
removeAllAttributes()
Remove all attributes from this element
|
EChange |
removeAttribute(IMicroQName aAttrName)
Remove the attribute with the given name.
|
EChange |
removeAttribute(String sAttrName)
Remove the attribute with the given name.
|
EChange |
removeAttribute(String sNamespaceURI,
String sAttrName)
Remove the attribute with the given name.
|
IMicroElement |
setAttribute(IMicroQName aAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(IMicroQName aAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(IMicroQName aAttrName,
int nAttrValue)
Set an attribute value of this element.
|
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.
|
IMicroElement |
setAttribute(String sAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sAttrName,
int nAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sAttrName,
long nAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sAttrName,
String sAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
boolean bAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
IHasAttributeValue aAttrValueProvider)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
int nAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
long nAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttribute(String sNamespaceURI,
String sAttrName,
String sAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttributeWithConversion(IMicroQName aAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttributeWithConversion(String sAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
IMicroElement |
setAttributeWithConversion(String sNamespaceURI,
String sAttrName,
Object aAttrValue)
Set an attribute value of this element.
|
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, detachFromParent, getAllChildren, getAllChildrenRecursive, getAllEventTargets, getAllEventTargets, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeValue, getParent, getParentElementWithName, getParentElementWithName, getPreviousSibling, getType, hasChildren, hasParent, insertAfter, insertAtIndex, insertBefore, isCDATA, isComment, isContainer, isDocument, isDocumentType, isElement, isEntityReference, isEqualContent, isProcessingInstruction, isText, registerEventTarget, removeAllChildren, removeChild, removeChildAtIndex, replaceChild, unregisterEventTargetgetChildAtIndexgetChildCountboolean 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()
boolean hasAttribute(@Nullable String sAttrName)
sAttrName - The attribute name to check.true if such an attribute is present,
false otherwiseboolean 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 IMicroAttribute getAttributeObj(@Nullable String sAttrName)
sAttrName - The attribute locale name to query. May be null.null of no such attribute object exists.@Nullable 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 String getAttributeValue(@Nullable String sAttrName)
null is returned.sAttrName - The attribute name to retrieve the value of.null.@Nullable 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 String getAttributeValue(@Nullable IMicroQName aAttrName)
null is returned.aAttrName - The qualified attribute name to retrieve the value of. May be
null.null.@Nullable <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 <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 converted@Nullable @ReturnsMutableCopy List<? extends IMicroAttribute> getAllAttributeObjs()
null.@Nonnull Iterator<? extends IMicroAttribute> getAttributeIterator()
null.@Nullable @ReturnsMutableCopy Map<IMicroQName,String> getAllQAttributes()
null if hasAttributes() returns
true.null.@Nullable @ReturnsMutableCopy Set<String> getAllAttributeNames()
null.@Nullable @ReturnsMutableCopy Set<IMicroQName> getAllAttributeQNames()
null.@Nullable @ReturnsMutableCopy Collection<String> getAllAttributeValues()
null.@Nonnull 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 EChange removeAllAttributes()
EChange.@Nullable String getNamespaceURI()
null if this element has no namespace URI.@Nonnull 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.EChangeboolean hasNamespaceURI()
true if this element has a specified namespace URI,
false otherwiseboolean hasNoNamespaceURI()
true if this element has no namespace URI,
false otherwiseboolean 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.@Nonnull String getTagName()
getLocalName() if a namespace URI is present.null.@Nonnegative int getChildElementCount()
@Nonnull @ReturnsMutableCopy List<IMicroElement> getAllChildElements()
null.@Nonnull @ReturnsMutableCopy List<IMicroElement> getAllChildElements(@Nullable String sTagName)
sTagName - The tag name to check. May be null.null.@Nonnull @ReturnsMutableCopy List<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 List<IMicroElement> getAllChildElementsRecursive()
null but empty.boolean hasChildElements()
true if this element has at least one child elementboolean 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 nameboolean 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 name@Nullable IMicroElement getFirstChildElement()
null if this element has no
child element.@Nullable 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 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@Nonnull IMicroElement getClone()
getClone in interface ICloneable<IMicroNode>getClone in interface IMicroNodeWithChildrenCopyright © 2014–2015 Philip Helger. All rights reserved.