Class XMLElement

java.lang.Object
com.biglybt.core.xml.util.XMLElement

public class XMLElement extends Object
  • Field Details

    • 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
    • ATTRIBUTE_COMPARATOR

      private static final Comparator<String> ATTRIBUTE_COMPARATOR
    • CONTENT_COMPARATOR

      private static final Comparator<XMLElement> CONTENT_COMPARATOR
  • Constructor Details

    • XMLElement

      public XMLElement(String tag_name)
    • XMLElement

      public XMLElement(String tag_name, boolean auto_order)
  • Method Details

    • 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)
    • quote

      private String quote(String text)
    • 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