org.gudy.azureus2.core3.xml.util
Class XMLElement
java.lang.Object
org.gudy.azureus2.core3.xml.util.XMLElement
public class XMLElement
- extends Object
text_content
protected String text_content
- This is what the XMLElement holds. It is either:
a) A single string (text_content); or
b) A collection of XMLElements.
Both are null at construction time - only one can be
set.
contents
protected Collection<XMLElement> contents
attributes
protected Map<String,String> attributes
tag_name
protected final String tag_name
auto_order
protected boolean auto_order
XMLElement
public XMLElement(String tag_name)
XMLElement
public XMLElement(String tag_name,
boolean auto_order)
getTag
public String getTag()
getAttribute
public String getAttribute(String key)
addAttribute
public void addAttribute(String key,
String value)
addAttribute
public void addAttribute(String key,
int value)
addAttribute
public void addAttribute(String key,
boolean value)
addContent
public void addContent(String s)
- Should be called setContent really - the code in the XML/HTTP plugin
invokes this method under this name.
addContent
public void addContent(XMLElement e)
printTo
public void printTo(PrintWriter pw)
printTo
public void printTo(PrintWriter pw,
boolean spaced_out)
printTo
public void printTo(PrintWriter pw,
int indent)
printTo
public void printTo(PrintWriter pw,
int indent,
boolean spaced_out)
makeContent
public XMLElement makeContent(String tag_name)
makeContent
public XMLElement makeContent(String tag_name,
boolean auto_order)
clear
public void clear()
setAutoOrdering
public void setAutoOrdering(boolean mode)
toString
public String toString()
- Overrides:
toString
in class Object