Class XTag

java.lang.Object
net.cnri.simplexml.XTag

public class XTag extends Object
This represents an SGML/XML tag. This can either have a set of sub-tags, or have a single value.
  • Constructor Details

  • Method Details

    • shallowCloneTag

      public XTag shallowCloneTag()
    • isContainer

      public boolean isContainer()
    • addSubTag

      public void addSubTag(XTag subTagValue)
    • getSubTagCount

      public int getSubTagCount()
    • getSubTag

      public XTag getSubTag(int i)
    • getSubTag

      public XTag getSubTag(String tagName)
    • removeSubTag

      public XTag removeSubTag(int index)
    • getSubTags

      public List<XTag> getSubTags()
    • removeSubTag

      public boolean removeSubTag(XTag subtag)
      Remove the given subtag from the list of subtags. If the given tag was in the list of subtags, return true. Otherwise this returns false.
    • hasSubTag

      public boolean hasSubTag(String tagName)
    • setSuppressNewLine

      public void setSuppressNewLine(boolean suppressNewLine)
    • getName

      public String getName()
    • getValue

      public Object getValue()
    • getStrValue

      public String getStrValue()
    • getIntValue

      public int getIntValue() throws Exception
      Throws:
      Exception
    • getLongValue

      public long getLongValue() throws Exception
      Throws:
      Exception
    • getDoubleValue

      public double getDoubleValue() throws Exception
      Throws:
      Exception
    • getUrlValue

      public URL getUrlValue() throws Exception
      Throws:
      Exception
    • getBoolValue

      public boolean getBoolValue()
    • getBoolSubTag

      public boolean getBoolSubTag(String tagName, boolean defaultVal)
    • getStrSubTag

      public String getStrSubTag(String tagName, String defaultVal)
    • getIntSubTag

      public int getIntSubTag(String tagName, int defaultVal)
    • getLongSubTag

      public long getLongSubTag(String tagName, long defaultVal)
    • getDoubleSubTag

      public double getDoubleSubTag(String tagName, double defaultVal)
    • getUrlSubTag

      public URL getUrlSubTag(String tagName, URL defaultVal)
    • getStrListSubTag

      public String[] getStrListSubTag(String tagName)
    • setValue

      public void setValue(String value)
    • setAttribute

      public void setAttribute(String name, String val)
    • setAttribute

      public void setAttribute(String name, boolean val)
    • setAttribute

      public void setAttribute(String name, int val)
    • getAttribute

      public String getAttribute(String attrName, String defaultVal)
    • getAttribute

      public String getAttribute(String attrName)
    • getBoolAttribute

      public boolean getBoolAttribute(String attrName, boolean defaultVal)
    • getStrAttribute

      public String getStrAttribute(String tagName, String defaultVal)
    • getIntAttribute

      public int getIntAttribute(String attrName, int defaultVal)
    • getLongAttribute

      public long getLongAttribute(String attrName, long defaultVal)
    • getDoubleAttribute

      public double getDoubleAttribute(String attrName, double defaultVal)
    • getAttributes

      public Map<String,String> getAttributes()
    • write

      public void write(OutputStream out) throws IOException
      Throws:
      IOException
    • write

      public void write(Writer out) throws IOException
      Throws:
      IOException
    • write

      public void write(Writer out, boolean pretty, String prefix) throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object