public interface IMicroElement extends IMicroNodeWithChildren
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getAllAttributeNames()
Get a set of all attribute names.
|
Map<String,String> |
getAllAttributes()
Get a map of all attribute names and values.
|
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.
|
String |
getAttribute(String sAttrName)
Get the attribute value of the given attribute name.
|
int |
getAttributeCount() |
<DSTTYPE> DSTTYPE |
getAttributeWithConversion(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(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(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 |
hasNoNamespaceURI()
Check if this element has no namespace URI.
|
EChange |
removeAllAttributes()
Remove all attributes from this element
|
EChange |
removeAttribute(String sAttrName)
Remove the attribute with the given name.
|
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 |
setAttributeWithConversion(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, getAllChildrenRecursive, getChildren, 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 otherwise@Nonnegative int getAttributeCount()
boolean hasAttribute(@Nullable String sAttrName)
sAttrName - The attribute name to retrieve the value of.true if such an attribute is present,
false otherwise@Nullable String getAttribute(@Nullable String sAttrName)
null is returned.sAttrName - The attribute name to retrieve the value of.null.@Nullable <DSTTYPE> DSTTYPE getAttributeWithConversion(@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@Nullable @ReturnsMutableCopy Map<String,String> getAllAttributes()
null if hasAttributes() returns true.null.@Nullable @ReturnsMutableCopy Set<String> getAllAttributeNames()
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(@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(@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(@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 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 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 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 © 2006–2014 phloc systems. All rights reserved.