public abstract class XMLContainerImpl extends Object implements XMLContainer
| Modifier and Type | Class and Description |
|---|---|
protected static class |
XMLContainerImpl.sMode |
| Modifier and Type | Field and Description |
|---|---|
protected List |
mContentAndSubtagList |
| Constructor and Description |
|---|
XMLContainerImpl() |
| Modifier and Type | Method and Description |
|---|---|
XMLContainer |
addContent(CharSequence inContent) |
XMLContainer |
addContentWithoutEscaping(CharSequence inContent) |
void |
addSubtag(int inIndex,
XMLizable inSubtag)
Added the specified subtag at the specified position in the list of this tag's
children.
|
void |
addSubtag(XMLizable inSubtag) |
void |
addSubtags(Collection<? extends XMLizable> inSubtags) |
void |
clearContent()
Clears content (not subtags).
|
void |
clearSubtags()
Removes all subtags from this object.
|
XMLTag |
clone() |
String |
getContent()
The returned content does not contain any embedded subtags.
|
List |
getContentPlusSubtagList() |
XMLContainer |
getNextSibling()
Returns the next sibling XMLContainer of this XMLContainer.
|
<T extends XMLNode> |
getOptionalSubtagByName(String inTagName)
Returns the subtag of the specified tag name.
|
<T extends XMLNode> |
getOptionalSubtagByName(String inTagName,
Case inCaseSensitivity) |
<T extends XMLNode> |
getOptionalSubtagByName(XMLName inTagName)
Returns the subtag of the specified tag name.
|
<T extends XMLNode> |
getOptionalSubtagByName(XMLName inTagName,
Case inCaseSensitivity) |
XMLContainer |
getParentNode()
Returns the parent XMLContainer of this XMLContainer.
|
XMLContainer |
getPreviousSibling()
Returns the previous sibling XMLContainer of this XMLContainer.
|
<T extends XMLNode> |
getRequiredSubtagById(String inId) |
<T extends XMLNode> |
getRequiredSubtagById(String inId,
Recursion inRecursion) |
<T extends XMLNode> |
getRequiredSubtagByName(String inTagName)
Returns the subtag of the specified tag name.
|
<T extends XMLNode> |
getRequiredSubtagByName(XMLName inTagName)
Returns the subtag of the specified tag name.
|
<T extends XMLNode> |
getSubtagByAttribute(String inAttributeName,
String inAttributeValue)
Returns the subtag with the specified attribute name and value.
|
<T extends XMLNode> |
getSubtagByAttribute(XMLName inAttributeName,
String inAttributeValue)
Returns the subtag with the specified attribute name and value.
|
<T extends XMLizable> |
getSubtags()
Returns a List of all subtags on this object.
|
<T extends XMLNode> |
getSubtagsByAttribute(String inAttributeName,
Pattern inAttributeValuePattern)
Returns a List of all subtags with the specified attribute name and value.
|
<T extends XMLNode> |
getSubtagsByAttribute(String inAttributeName,
Pattern inAttributeValuePattern,
Recursion inRecursion)
Returns a List of all subtags with the specified attribute name and value.
|
<T extends XMLNode> |
getSubtagsByAttribute(String inAttributeName,
String inAttributeValue)
Returns a List of all subtags with the specified attribute name and value.
|
<T extends XMLNode> |
getSubtagsByAttribute(String inAttributeName,
String inAttributeValue,
Recursion inRecursion)
Returns a List of all subtags with the specified attribute name and value
(if recursion is off) or at any level below this object (if recursion is on).
|
<T extends XMLNode> |
getSubtagsByAttribute(XMLName inAttributeName,
String inAttributeValue)
Returns a List of all subtags with the specified attribute name and value.
|
<T> List<T> |
getSubtagsByClass(Class<T> inClassType)
Returns a List of all subtags of the specified Java Class on this XMLTag object
The same as getSubtagsByClass(inClassName, Recursion.OFF)
|
<T> List<T> |
getSubtagsByClass(Class<T> inClassType,
Recursion inRecursion)
Returns a List of all subtags of the specified Java Class on this XMLTag object
(if recursion is off) or at any level below this object (if recursion is on).
|
<T extends XMLNode> |
getSubtagsByName(String inTagName)
Returns a List of all subtags with the specified tag name on this XMLTag object.
|
<T extends XMLNode> |
getSubtagsByName(String inTagName,
Case inCaseSensitivity,
Recursion inRecursion) |
<T extends XMLNode> |
getSubtagsByName(String inTagName,
Recursion inRecursion)
Returns a List of all subtags with the specified tag name on this XMLTag object.
|
<T extends XMLNode> |
getSubtagsByName(XMLName inTagName)
Returns a List of all subtags with the specified tag name on this XMLTag object.
|
<T extends XMLNode> |
getSubtagsByName(XMLName inTagName,
Recursion inRecursion)
Returns a List of all subtags with the specified tag name on this XMLTag object.
|
int |
getTotalTagCount()
Returns a count of the total number of tags, including this root tag, its
subtags, the subtags' subtags, etc.
|
String |
getUnescapedContent()
Expands character entities before retuning the content of this XMLTag.
|
<T extends XMLNode> |
getXMLNodeSubtags()
Returns a List of all subtags on this object that implement XMLNode.
|
boolean |
hasContent() |
boolean |
hasContentOrSubtags() |
int |
indexOf(XMLizable inSubtag)
Returns the index of the specified subtag.
|
protected String |
innerHTML() |
void |
removeSubtag(XMLizable inSubtag)
Removes all instances of the specified subtag from this object.
|
<T extends XMLNode> |
removeSubtagsByAttribute(String inAttributeName,
Pattern inAttributeValuePattern,
Recursion inRecursion)
Removes all subtags with the specified tag name from this XMLTag object
(if recursion is off) or at any level below this object (if recursion is on).
|
<T extends XMLNode> |
removeSubtagsByAttribute(String inAttributeName,
String inAttributeValue,
Recursion inRecursion)
Removes all subtags with the specified tag name from this XMLTag object
(if recursion is off) or at any level below this object (if recursion is on).
|
<T extends XMLNode> |
removeSubtagsByAttribute(XMLName inAttributeName,
String inAttributeValue,
Recursion inRecursion)
Removes all subtags with the specified tag name from this XMLTag object
(if recursion is off) or at any level below this object (if recursion is on).
|
<T extends XMLContainer> |
removeSubtagsByClass(Class<T> inClassType)
Removes subtags of the specified Java Class on this object
The same as removeSubtagsByClass(inClassName, Recursion.OFF)
|
<T extends XMLContainer> |
removeSubtagsByClass(Class<T> inClassType,
Recursion inRecursion)
Removes subtags of the specified Java Class on this XMLTag object
(if recursion is off) or at any level below this object (if recursion is on).
|
<T extends XMLNode> |
removeSubtagsByName(String inTagName)
Removes all subtags with the specified tag name from this XMLTag object.
|
<T extends XMLNode> |
removeSubtagsByName(String inTagName,
Recursion inRecursion)
Removes all subtags with the specified tag name from this XMLTag object
(if recursion is off) or at any level below this object (if recursion is on).
|
<T extends XMLNode> |
removeSubtagsByName(XMLName inTagName)
Removes all subtags with the specified tag name from this XMLTag object.
|
XMLContainer |
setContent(CharSequence inContent) |
XMLContainer |
setContent(int inContent) |
void |
setParentNode(XMLContainer inParent)
Specifies the parent XMLContainer of this XMLContainer.
|
<T extends XMLizable> |
setSubtags(List<T> inSubtags)
Sets the subtags of this object to those specified.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoIndentedXML, toIndentedXML, toIndentedXML, toXML, toXML, toXMLprotected List mContentAndSubtagList
public XMLContainerImpl()
public boolean hasContent()
hasContent in interface XMLContainerpublic boolean hasContentOrSubtags()
public List getContentPlusSubtagList()
public XMLContainer setContent(CharSequence inContent)
setContent in interface XMLContainerpublic XMLContainer setContent(int inContent)
public void clearContent()
XMLContainerclearContent in interface XMLContainerpublic XMLContainer addContent(CharSequence inContent)
addContent in interface XMLContainerpublic XMLContainer addContentWithoutEscaping(CharSequence inContent)
addContentWithoutEscaping in interface XMLContainerpublic String getContent()
XMLContainergetContent in interface XMLContainerpublic String getUnescapedContent()
XMLContainergetUnescapedContent in interface XMLContainerpublic void addSubtag(XMLizable inSubtag)
addSubtag in interface XMLContainerpublic void addSubtag(int inIndex, XMLizable inSubtag)
inIndex - the index at which the specified subtag should be addedinSubtag - the subtag which should be added to this tagpublic void addSubtags(Collection<? extends XMLizable> inSubtags)
addSubtags in interface XMLContainerinSubtags - Collection that should only contain XMLNode objects.public <T extends XMLizable> void setSubtags(List<T> inSubtags)
XMLContainersetSubtags in interface XMLContainerinSubtags - the list of subtags to be added to this XML tagpublic <T extends XMLizable> List<T> getSubtags()
XMLContainergetSubtags in interface XMLContainerpublic <T extends XMLNode> List<T> getXMLNodeSubtags()
XMLContainergetXMLNodeSubtags in interface XMLContainerpublic <T extends XMLNode> T getSubtagByAttribute(XMLName inAttributeName, String inAttributeValue)
inAttributeName - the attribute name to match on. Allows null.inAttributeValue - the attribute value to match onRuntimeException - if multiple subtags match the specified attribute criteriapublic <T extends XMLNode> T getSubtagByAttribute(String inAttributeName, String inAttributeValue)
inAttributeName - the attribute name to match on. Allows null.inAttributeValue - the attribute value to match onRuntimeException - if multiple subtags match the specified attribute criteriapublic <T extends XMLNode> List<T> getSubtagsByAttribute(XMLName inAttributeName, String inAttributeValue)
inAttributeName - the attribute name to match on. Allows null.inAttributeValue - the attribute value to match onpublic <T extends XMLNode> List<T> getSubtagsByAttribute(String inAttributeName, String inAttributeValue)
inAttributeName - the attribute name to match on. Allows null.inAttributeValue - the attribute value to match onpublic <T extends XMLNode> List<T> getSubtagsByAttribute(String inAttributeName, Pattern inAttributeValuePattern)
inAttributeName - the attribute name to match on. Allows null.inAttributeValuePattern - the Pattern to compare to attribute values via find(). Allows null.public <T extends XMLNode> List<T> getSubtagsByAttribute(String inAttributeName, String inAttributeValue, Recursion inRecursion)
inAttributeName - the attribute name to match on. Allows null.inAttributeValue - the attribute value to match oninRecursion - flag to indicate whether or not recursion should be usedpublic <T extends XMLNode> List<T> getSubtagsByAttribute(String inAttributeName, Pattern inAttributeValuePattern, Recursion inRecursion)
inAttributeName - the attribute name to match on. Allows null.inAttributeValuePattern - the Pattern to compare to attribute values via find(). Allows null.inRecursion - flag to indicate whether or not recursion should be usedpublic <T> List<T> getSubtagsByClass(Class<T> inClassType)
public <T> List<T> getSubtagsByClass(Class<T> inClassType, Recursion inRecursion)
public void removeSubtag(XMLizable inSubtag)
XMLContainerremoveSubtag in interface XMLContainerinSubtag - the subtag to be removedpublic <T extends XMLContainer> List<T> removeSubtagsByClass(Class<T> inClassType)
public <T extends XMLContainer> List<T> removeSubtagsByClass(Class<T> inClassType, Recursion inRecursion)
public void clearSubtags()
XMLContainerclearSubtags in interface XMLContainerpublic int indexOf(XMLizable inSubtag)
XMLContainerindexOf in interface XMLContainerinSubtag - the subtag for which to determine the indexpublic int getTotalTagCount()
XMLContainergetTotalTagCount in interface XMLContainerpublic <T extends XMLNode> T getRequiredSubtagByName(XMLName inTagName)
XMLContainergetRequiredSubtagByName in interface XMLContainerinTagName - the name of the required subtagpublic <T extends XMLNode> T getRequiredSubtagByName(String inTagName)
XMLContainergetRequiredSubtagByName in interface XMLContainerinTagName - the name of the required subtagpublic <T extends XMLNode> T getRequiredSubtagById(String inId)
public <T extends XMLNode> T getRequiredSubtagById(String inId, Recursion inRecursion)
public <T extends XMLNode> T getOptionalSubtagByName(XMLName inTagName)
XMLContainergetOptionalSubtagByName in interface XMLContainerinTagName - the name of the optional subtagpublic <T extends XMLNode> T getOptionalSubtagByName(XMLName inTagName, Case inCaseSensitivity)
public <T extends XMLNode> T getOptionalSubtagByName(String inTagName)
XMLContainergetOptionalSubtagByName in interface XMLContainerinTagName - the name of the optional subtagpublic <T extends XMLNode> T getOptionalSubtagByName(String inTagName, Case inCaseSensitivity)
public <T extends XMLNode> List<T> getSubtagsByName(XMLName inTagName)
XMLContainergetSubtagsByName in interface XMLContainerinTagName - the name of the requested subtagspublic <T extends XMLNode> List<T> getSubtagsByName(String inTagName)
XMLContainergetSubtagsByName in interface XMLContainerinTagName - the name of the requested subtagspublic <T extends XMLNode> List<T> getSubtagsByName(XMLName inTagName, Recursion inRecursion)
XMLContainergetSubtagsByName in interface XMLContainerinTagName - the name of the requested subtagsinRecursion - flag to indicate whether or not recursion should be usedpublic <T extends XMLNode> List<T> getSubtagsByName(String inTagName, Recursion inRecursion)
XMLContainergetSubtagsByName in interface XMLContainerinTagName - the name of the requested subtagsinRecursion - flag to indicate whether or not recursion should be usedpublic <T extends XMLNode> List<T> getSubtagsByName(String inTagName, Case inCaseSensitivity, Recursion inRecursion)
public <T extends XMLNode> List<T> removeSubtagsByName(XMLName inTagName)
XMLContainerremoveSubtagsByName in interface XMLContainerinTagName - the name of the subtags to removepublic <T extends XMLNode> List<T> removeSubtagsByName(String inTagName)
XMLContainerremoveSubtagsByName in interface XMLContainerinTagName - the name of the subtags to removepublic <T extends XMLNode> List<T> removeSubtagsByName(String inTagName, Recursion inRecursion)
inTagName - the name of the subtags to removeinRecursion - flag to indicate whether or not recursion should be usedpublic <T extends XMLNode> List<T> removeSubtagsByAttribute(XMLName inAttributeName, String inAttributeValue, Recursion inRecursion)
inAttributeName - the attribute name to match on. Allows null.inAttributeValue - the attribute value to match oninRecursion - flag to indicate whether or not recursion should be usedpublic <T extends XMLNode> List<T> removeSubtagsByAttribute(String inAttributeName, String inAttributeValue, Recursion inRecursion)
inAttributeName - the attribute name to match on. Allows null.inAttributeValue - the attribute value to match oninRecursion - flag to indicate whether or not recursion should be usedpublic <T extends XMLNode> List<T> removeSubtagsByAttribute(String inAttributeName, Pattern inAttributeValuePattern, Recursion inRecursion)
inAttributeName - the attribute name to match on. Allows null.inAttributeValuePattern - the attribute value pattern to match withinRecursion - flag to indicate whether or not recursion should be usedpublic void setParentNode(XMLContainer inParent)
XMLContainersetParentNode in interface XMLContainerinParent - the XML node for which this tag should be a subnodepublic XMLContainer getParentNode()
XMLContainergetParentNode in interface XMLContainerpublic XMLContainer getPreviousSibling()
XMLContainergetPreviousSibling in interface XMLContainerpublic XMLContainer getNextSibling()
XMLContainergetNextSibling in interface XMLContainer
jataylor@hairyfatguy.com