org.gudy.azureus2.core3.xml.util
Class XMLElement

java.lang.Object
  extended by org.gudy.azureus2.core3.xml.util.XMLElement

public class XMLElement
extends Object


Field Summary
protected  Map<String,String> attributes
           
protected  boolean auto_order
           
protected  Collection<XMLElement> contents
           
protected  String tag_name
           
protected  String text_content
          This is what the XMLElement holds.
 
Constructor Summary
XMLElement(String tag_name)
           
XMLElement(String tag_name, boolean auto_order)
           
 
Method Summary
 void addAttribute(String key, boolean value)
           
 void addAttribute(String key, int value)
           
 void addAttribute(String key, String value)
           
 void addContent(String s)
          Should be called setContent really - the code in the XML/HTTP plugin invokes this method under this name.
 void addContent(XMLElement e)
           
 void clear()
           
 String getAttribute(String key)
           
 String getTag()
           
 XMLElement makeContent(String tag_name)
           
 XMLElement makeContent(String tag_name, boolean auto_order)
           
 void printTo(PrintWriter pw)
           
 void printTo(PrintWriter pw, boolean spaced_out)
           
 void printTo(PrintWriter pw, int indent)
           
 void printTo(PrintWriter pw, int indent, boolean spaced_out)
           
 void setAutoOrdering(boolean mode)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

XMLElement

public XMLElement(String tag_name)

XMLElement

public XMLElement(String tag_name,
                  boolean auto_order)
Method Detail

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