public interface IMicroElement extends IMicroNodeWithChildren
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getAllAttributeNames()
Get a set of all attribute names.
|
Set<IMicroQName> |
getAllAttributeQNames()
Get a set of all attribute names.
|
Map<String,String> |
getAllAttributes()
Deprecated.
Use
getAllQAttributes() instead. |
Collection<String> |
getAllAttributeValues()
Get a set of all attribute values.
|
List<IMicroElement> |
getAllChildElements()
Get a list of all direct child elements.
|
List<IMicroElement> |
getAllChildElements(IHasElementName aElementNameProvider)
Get a list of all direct child elements having the specified tag name.
|
List<IMicroElement> |
getAllChildElements(String sTagName)
Get a list of all direct child elements having the specified tag name.
|
List<IMicroElement> |
getAllChildElements(String sNamespaceURI,
IHasElementName aElementNameProvider)
Get a list of all direct child elements having the specified namespace and
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() |
IMicroAttribute |
getAttributeObj(IMicroQName aQName) |
IMicroAttribute |
getAttributeObj(String sAttrName) |
IMicroAttribute |
getAttributeObj(String sNamespaceURI,
String sAttrName) |
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.
|
<DSTTYPE> DSTTYPE |
getAttributeWithConversion(IMicroQName aAttrName,
Class<DSTTYPE> aDstClass)
Deprecated.
|
<DSTTYPE> DSTTYPE |
getAttributeWithConversion(String sAttrName,
Class<DSTTYPE> aDstClass)
Deprecated.
Use
getAttributeValueWithConversion(String,Class)
instead |
<DSTTYPE> DSTTYPE |
getAttributeWithConversion(String sNamespaceURI,
String sAttrName,
Class<DSTTYPE> aDstClass)
Deprecated.
|
int |
getChildElementCount() |
IMicroElement |
getClone() |
IMicroElement |
getFirstChildElement()
Get the first child element of this element.
|
IMicroElement |
getFirstChildElement(IHasElementName aElementNameProvider)
Get the first child element with the given tag name.
|
IMicroElement |
getFirstChildElement(String sTagName)
Get the first child element with the given tag name.
|
IMicroElement |
getFirstChildElement(String sNamespaceURI,
IHasElementName aElementNameProvider)
Get the first child element with the given tag name and the given
namespace.
|
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(IHasElementName aElementNameProvider)
Check if this element has at least one child element with the specified tag
name.
|
boolean |
hasChildElements(String sTagName)
Check if this element has at least one child element with the specified tag
name.
|
boolean |
hasChildElements(String sNamespaceURI,
IHasElementName aElementNameProvider)
Check if this element has at least one child element with the specified
namespace URI and 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,
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,
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,
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, 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.true if such an attribute is present,
false otherwise@Nullable IMicroAttribute getAttributeObj(@Nullable String sAttrName)
@Nullable IMicroAttribute getAttributeObj(@Nullable String sNamespaceURI, @Nullable String sAttrName)
@Nullable IMicroAttribute getAttributeObj(@Nullable IMicroQName aQName)
@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.null.@Deprecated @Nullable <DSTTYPE> DSTTYPE getAttributeWithConversion(@Nullable String sAttrName, @Nonnull Class<DSTTYPE> aDstClass)
getAttributeValueWithConversion(String,Class)
insteadnull is returned. The attribute value is
converted via the TypeConverter to
the desired destination class. If no such attribute is present,
null is returned.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 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.sAttrName - The attribute name to retrieve the value of.aDstClass - The destination class.null.ClassCastException - if the value cannot be converted@Deprecated @Nullable <DSTTYPE> DSTTYPE getAttributeWithConversion(@Nullable String sNamespaceURI, @Nullable String sAttrName, @Nonnull Class<DSTTYPE> aDstClass)
getAttributeValueWithConversion(String,String,Class)
insteadnull is returned. The attribute value is
converted via the TypeConverter to
the desired destination class. If no such attribute is present,
null is returned.sNamespaceURI - 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 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.sNamespaceURI - 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@Deprecated @Nullable <DSTTYPE> DSTTYPE getAttributeWithConversion(@Nullable IMicroQName aAttrName, @Nonnull Class<DSTTYPE> aDstClass)
getAttributeValueWithConversion(IMicroQName,Class)
insteadnull is returned. The attribute value is
converted via the TypeConverter to
the desired destination class. If no such attribute is present,
null is returned.aAttrName - The attribute qualified 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.aAttrName - The attribute qualified name to retrieve the value of.aDstClass - The destination class.null.ClassCastException - if the value cannot be converted@Nullable @Deprecated @ReturnsMutableCopy Map<String,String> getAllAttributes()
getAllQAttributes() instead.null if hasAttributes() returns true.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, int nAttrValue)
setAttribute(name, 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(name, 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(name, 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> getAllChildElements(@Nonnull IHasElementName aElementNameProvider)
aElementNameProvider - Element name provider. May not be null.null.@Nonnull @ReturnsMutableCopy List<IMicroElement> getAllChildElements(@Nullable String sNamespaceURI, @Nonnull IHasElementName aElementNameProvider)
sNamespaceURI - The namespace URI to check. May be null.aElementNameProvider - Element name provider. May not 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 nameboolean hasChildElements(@Nonnull IHasElementName aElementNameProvider)
aElementNameProvider - Element name provider. May not be null.true if this element has at least one child element
with the specified tag nameboolean hasChildElements(@Nullable String sNamespaceURI, @Nonnull IHasElementName aElementNameProvider)
sNamespaceURI - The namespace URI to check. May be null.aElementNameProvider - Element name provider. May not 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@Nullable IMicroElement getFirstChildElement(@Nonnull IHasElementName aElementNameProvider)
aElementNameProvider - Element name provider. May not be null.null if no such child element is present@Nullable IMicroElement getFirstChildElement(@Nullable String sNamespaceURI, @Nonnull IHasElementName aElementNameProvider)
sNamespaceURI - The namespace URL to search.aElementNameProvider - Element name provider. May not be null.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.