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, wait
toIndentedXML, toIndentedXML, toIndentedXML, toXML, toXML, toXML
protected List mContentAndSubtagList
public XMLContainerImpl()
public boolean hasContent()
hasContent
in interface XMLContainer
public boolean hasContentOrSubtags()
public List getContentPlusSubtagList()
public XMLContainer setContent(CharSequence inContent)
setContent
in interface XMLContainer
public XMLContainer setContent(int inContent)
public void clearContent()
XMLContainer
clearContent
in interface XMLContainer
public XMLContainer addContent(CharSequence inContent)
addContent
in interface XMLContainer
public XMLContainer addContentWithoutEscaping(CharSequence inContent)
addContentWithoutEscaping
in interface XMLContainer
public String getContent()
XMLContainer
getContent
in interface XMLContainer
public String getUnescapedContent()
XMLContainer
getUnescapedContent
in interface XMLContainer
public void addSubtag(XMLizable inSubtag)
addSubtag
in interface XMLContainer
public 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 XMLContainer
inSubtags
- Collection that should only contain XMLNode objects.public <T extends XMLizable> void setSubtags(List<T> inSubtags)
XMLContainer
setSubtags
in interface XMLContainer
inSubtags
- the list of subtags to be added to this XML tagpublic <T extends XMLizable> List<T> getSubtags()
XMLContainer
getSubtags
in interface XMLContainer
public <T extends XMLNode> List<T> getXMLNodeSubtags()
XMLContainer
getXMLNodeSubtags
in interface XMLContainer
public <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)
XMLContainer
removeSubtag
in interface XMLContainer
inSubtag
- 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()
XMLContainer
clearSubtags
in interface XMLContainer
public int indexOf(XMLizable inSubtag)
XMLContainer
indexOf
in interface XMLContainer
inSubtag
- the subtag for which to determine the indexpublic int getTotalTagCount()
XMLContainer
getTotalTagCount
in interface XMLContainer
public <T extends XMLNode> T getRequiredSubtagByName(XMLName inTagName)
XMLContainer
getRequiredSubtagByName
in interface XMLContainer
inTagName
- the name of the required subtagpublic <T extends XMLNode> T getRequiredSubtagByName(String inTagName)
XMLContainer
getRequiredSubtagByName
in interface XMLContainer
inTagName
- 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)
XMLContainer
getOptionalSubtagByName
in interface XMLContainer
inTagName
- the name of the optional subtagpublic <T extends XMLNode> T getOptionalSubtagByName(XMLName inTagName, Case inCaseSensitivity)
public <T extends XMLNode> T getOptionalSubtagByName(String inTagName)
XMLContainer
getOptionalSubtagByName
in interface XMLContainer
inTagName
- the name of the optional subtagpublic <T extends XMLNode> T getOptionalSubtagByName(String inTagName, Case inCaseSensitivity)
public <T extends XMLNode> List<T> getSubtagsByName(XMLName inTagName)
XMLContainer
getSubtagsByName
in interface XMLContainer
inTagName
- the name of the requested subtagspublic <T extends XMLNode> List<T> getSubtagsByName(String inTagName)
XMLContainer
getSubtagsByName
in interface XMLContainer
inTagName
- the name of the requested subtagspublic <T extends XMLNode> List<T> getSubtagsByName(XMLName inTagName, Recursion inRecursion)
XMLContainer
getSubtagsByName
in interface XMLContainer
inTagName
- 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)
XMLContainer
getSubtagsByName
in interface XMLContainer
inTagName
- 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)
XMLContainer
removeSubtagsByName
in interface XMLContainer
inTagName
- the name of the subtags to removepublic <T extends XMLNode> List<T> removeSubtagsByName(String inTagName)
XMLContainer
removeSubtagsByName
in interface XMLContainer
inTagName
- 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)
XMLContainer
setParentNode
in interface XMLContainer
inParent
- the XML node for which this tag should be a subnodepublic XMLContainer getParentNode()
XMLContainer
getParentNode
in interface XMLContainer
public XMLContainer getPreviousSibling()
XMLContainer
getPreviousSibling
in interface XMLContainer
public XMLContainer getNextSibling()
XMLContainer
getNextSibling
in interface XMLContainer