public class XMLTag extends XMLContainerImpl implements XMLNode, Comparable
XMLContainerImpl.sMode
mContentAndSubtagList
Constructor and Description |
---|
XMLTag(File inXMLFile) |
XMLTag(InputStream inXML) |
XMLTag(Reader inXML) |
XMLTag(String inName) |
XMLTag(String inName,
Collection<XMLAttribute> inAttributes) |
XMLTag(String inName,
Collection inAttributes,
String inContent) |
XMLTag(String inName,
Map<String,String> inAttributes) |
XMLTag(String inName,
Map inAttributes,
String inContent) |
XMLTag(XMLName inName) |
Modifier and Type | Method and Description |
---|---|
XMLTag |
addSubtag(String inTagName) |
XMLTag |
addSubtag(XMLName inTagName) |
XMLTag |
addXMLNamespaceDeclaration(XMLNamespace inValue) |
XMLTag |
clone() |
int |
compareTo(Object inObj2) |
boolean |
equals(Object inObj2) |
List<? extends XMLNode> |
findNodesByAttributeValue(String inAttribute,
String inValue)
Returns a List of all nodes with the specified attribute name and specified attribute value.
|
List<? extends XMLNode> |
findNodesByAttributeValue(XMLName inAttribute,
String inValue)
Returns a List of all nodes with the specified attribute name and specified attribute value.
|
XMLAttribute |
getAttribute(String inAttributeName) |
XMLAttribute |
getAttribute(XMLName inAttributeName) |
Collection<XMLAttribute> |
getAttributes()
Returns a Collection of XMLAttribute objects.
|
String |
getAttributeValue(String inAttributeName) |
String |
getAttributeValue(XMLName inAttributeName) |
String |
getEndTag() |
XMLNamespace |
getNamespace() |
String |
getQualifiedTagName() |
String |
getStartTag() |
String |
getTagName() |
boolean |
hasAttribute(String inAttributeName) |
boolean |
hasAttribute(XMLName inAttributeName) |
boolean |
hasAttributes() |
boolean |
isEmptyTag() |
XMLAttribute |
removeAttribute(String inAttributeName) |
XMLAttribute |
removeAttribute(XMLName inAttributeName) |
void |
replaceCharacterEntities() |
XMLTag |
setAttribute(String inAttributeName,
Object inValue) |
XMLTag |
setAttribute(XMLAttribute inAttribute) |
XMLTag |
setAttribute(XMLName inAttributeName,
Object inValue) |
void |
setAttributes(Collection<XMLAttribute> inAttributes)
Takes a Collection of XMLAttribute objects as input.
|
XMLNode |
setContent(CharSequence inContent) |
XMLTag |
setDefaultXMLNamespaceDeclaration(XMLNamespace inValue) |
XMLTag |
setNamespace(XMLNamespace inValue) |
XMLTag |
setSortAttributesBeforeWriting(boolean inValue) |
XMLTag |
setTagName(String inName) |
XMLTag |
setTagName(XMLName inName) |
protected void |
sortAttributes(List<XMLAttribute> inAttributes) |
String |
toIndentedXML(int inInitialIndentLevel,
int inIndentSize) |
void |
toIndentedXML(OutputStream inOutputStream,
int inInitialIndentLevel,
int inIndentSize)
Writes out the tag (and any subtags) to te specified OutputStream.
|
void |
toIndentedXML(Writer inWriter,
int inInitialIndentLevel,
int inIndentSize) |
void |
toIndentedXML(Writer inWriter,
int inInitialIndentLevel,
int inIndentSize,
XMLNamespaceSet inDeclaredNamespaces) |
String |
toString() |
String |
toXML() |
void |
toXML(OutputStream inStream) |
void |
toXML(Writer inWriter) |
protected void |
toXML(Writer inWriter,
XMLNamespaceSet inDeclaredNamespaces) |
static void |
useDoubleQuotes(boolean inValue) |
void |
verifyTagName(String inTagName) |
void |
verifyTagName(String inTagName,
Case inCaseSensitivity) |
void |
verifyTagName(XMLName inTagName) |
void |
verifyTagName(XMLName inTagName,
Case inCaseSensitivity) |
addContent, addContentWithoutEscaping, addSubtag, addSubtag, addSubtags, clearContent, clearSubtags, getContent, getContentPlusSubtagList, getNextSibling, getOptionalSubtagByName, getOptionalSubtagByName, getOptionalSubtagByName, getOptionalSubtagByName, getParentNode, getPreviousSibling, getRequiredSubtagById, getRequiredSubtagById, getRequiredSubtagByName, getRequiredSubtagByName, getSubtagByAttribute, getSubtagByAttribute, getSubtags, getSubtagsByAttribute, getSubtagsByAttribute, getSubtagsByAttribute, getSubtagsByAttribute, getSubtagsByAttribute, getSubtagsByClass, getSubtagsByClass, getSubtagsByName, getSubtagsByName, getSubtagsByName, getSubtagsByName, getSubtagsByName, getTotalTagCount, getUnescapedContent, getXMLNodeSubtags, hasContent, hasContentOrSubtags, indexOf, innerHTML, removeSubtag, removeSubtagsByAttribute, removeSubtagsByAttribute, removeSubtagsByAttribute, removeSubtagsByClass, removeSubtagsByClass, removeSubtagsByName, removeSubtagsByName, removeSubtagsByName, setContent, setParentNode, setSubtags
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addContent, addContentWithoutEscaping, addSubtag, addSubtags, clearContent, clearSubtags, getContent, getNextSibling, getOptionalSubtagByName, getOptionalSubtagByName, getParentNode, getPreviousSibling, getRequiredSubtagByName, getRequiredSubtagByName, getSubtags, getSubtagsByName, getSubtagsByName, getSubtagsByName, getSubtagsByName, getTotalTagCount, getUnescapedContent, getXMLNodeSubtags, hasContent, indexOf, removeSubtag, removeSubtagsByName, removeSubtagsByName, setParentNode, setSubtags
public XMLTag(String inName, Collection<XMLAttribute> inAttributes)
inName
- the tag nameinAttributes
- a Collection of XMLAttribute objectspublic XMLTag(String inName, Map<String,String> inAttributes)
inName
- the tag nameinAttributes
- a Map of attribute (names and values as String objects)public XMLTag(String inName, Collection inAttributes, String inContent)
inName
- the tag nameinAttributes
- a Collection of XMLAttribute objectsinContent
- the tag's contentpublic XMLTag(String inName, Map inAttributes, String inContent)
inName
- the tag nameinAttributes
- a ImageMap of attribute (names and values as String objects)inContent
- the tag's contentpublic XMLTag(InputStream inXML) throws XMLException, IOException
inXML
- an InputStream containing XML textXMLException
IOException
public XMLTag(Reader inXML) throws XMLException, IOException
inXML
- a Reader containing XML textXMLException
IOException
public XMLTag(File inXMLFile) throws XMLException, IOException
inXMLFile
- a File containing XML textXMLException
IOException
public static void useDoubleQuotes(boolean inValue)
public XMLTag setSortAttributesBeforeWriting(boolean inValue)
public XMLTag clone()
clone
in interface XMLizable
clone
in class XMLContainerImpl
public int compareTo(Object inObj2)
compareTo
in interface Comparable
public XMLNode setContent(CharSequence inContent)
setContent
in interface XMLContainer
setContent
in class XMLContainerImpl
public String getStartTag()
public boolean isEmptyTag()
isEmptyTag
in interface XMLNode
public XMLTag setTagName(XMLName inName)
setTagName
in interface XMLNode
public XMLTag setTagName(String inName)
setTagName
in interface XMLNode
public String getTagName()
getTagName
in interface XMLNode
public String getQualifiedTagName()
public void verifyTagName(XMLName inTagName)
verifyTagName
in interface XMLNode
public void verifyTagName(XMLName inTagName, Case inCaseSensitivity)
verifyTagName
in interface XMLNode
public void verifyTagName(String inTagName)
verifyTagName
in interface XMLNode
public void verifyTagName(String inTagName, Case inCaseSensitivity)
verifyTagName
in interface XMLNode
public XMLTag setAttribute(String inAttributeName, Object inValue)
setAttribute
in interface XMLNode
public XMLTag setAttribute(XMLName inAttributeName, Object inValue)
setAttribute
in interface XMLNode
public XMLTag setAttribute(XMLAttribute inAttribute)
setAttribute
in interface XMLNode
public void setAttributes(Collection<XMLAttribute> inAttributes)
setAttributes
in interface XMLNode
inAttributes
- the attributes to add to the xml nodepublic XMLAttribute getAttribute(XMLName inAttributeName)
getAttribute
in interface XMLNode
public XMLAttribute getAttribute(String inAttributeName)
getAttribute
in interface XMLNode
public boolean hasAttributes()
hasAttributes
in interface XMLNode
public boolean hasAttribute(XMLName inAttributeName)
hasAttribute
in interface XMLNode
public boolean hasAttribute(String inAttributeName)
hasAttribute
in interface XMLNode
public String getAttributeValue(XMLName inAttributeName)
getAttributeValue
in interface XMLNode
public String getAttributeValue(String inAttributeName)
getAttributeValue
in interface XMLNode
public Collection<XMLAttribute> getAttributes()
getAttributes
in interface XMLNode
public XMLAttribute removeAttribute(String inAttributeName)
removeAttribute
in interface XMLNode
public XMLAttribute removeAttribute(XMLName inAttributeName)
removeAttribute
in interface XMLNode
public XMLNamespace getNamespace()
getNamespace
in interface XMLNode
public XMLTag setNamespace(XMLNamespace inValue)
setNamespace
in interface XMLNode
public XMLTag setDefaultXMLNamespaceDeclaration(XMLNamespace inValue)
public XMLTag addXMLNamespaceDeclaration(XMLNamespace inValue)
public List<? extends XMLNode> findNodesByAttributeValue(XMLName inAttribute, String inValue)
findNodesByAttributeValue
in interface XMLNode
public List<? extends XMLNode> findNodesByAttributeValue(String inAttribute, String inValue)
findNodesByAttributeValue
in interface XMLNode
public void toXML(OutputStream inStream)
protected void toXML(Writer inWriter, XMLNamespaceSet inDeclaredNamespaces)
public String toIndentedXML(int inInitialIndentLevel, int inIndentSize)
toIndentedXML
in interface XMLizable
public void toIndentedXML(OutputStream inOutputStream, int inInitialIndentLevel, int inIndentSize)
toIndentedXML
in interface XMLizable
inOutputStream
- OutputStream to which the XML is written.public void toIndentedXML(Writer inWriter, int inInitialIndentLevel, int inIndentSize)
toIndentedXML
in interface XMLizable
public void toIndentedXML(Writer inWriter, int inInitialIndentLevel, int inIndentSize, XMLNamespaceSet inDeclaredNamespaces)
toIndentedXML
in interface XMLNode
public void replaceCharacterEntities()
replaceCharacterEntities
in interface XMLNode
protected void sortAttributes(List<XMLAttribute> inAttributes)