All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class HTML.SGML_Tag

java.lang.Object
   |
   +----HTML.HTML_Token
           |
           +----HTML.SGML_Tag

public class SGML_Tag
extends HTML_Token
Class that represents a single SGML tag.


Constructor Index

 o SGML_Tag()
Construct a new tag with no name or attributes.
 o SGML_Tag(String)
Given a string, creates an SGML tag with that name

Method Index

 o addAttribute(String, String)
Adds an attribute with the given value to the tag.
 o findValName(String)
Returns the name of the attribute that has the given value.
 o getAttribute(String)
Given an SGML attribute name returns the value or null if there is none.
 o getAttributeName(int)
Returns the name of the attribute at the position determined by index.
 o getAttributeValue(int)
 o getName()
Returns the name of the tag in cannonical format.
 o getText()
Returns the textual representation of the SGML tag.
 o isXmlEmptyTag()
Returns true if this tag is an XML style tag without content or a corresponding end tag.
 o parseTag(String)
Given a string that represents an SGML tag, returns the equivalent object of type SGML tag.
 o setValName(String, String)
Sets the name of the attribute with the given value.
 o setValue(String, String)
Sets the value of the given attribute as specified.
 o setXmlEmptyTag(boolean)
Sets the status of whether this tag is an XML style tag without content or a corresponding end tag.
 o toString()
Returns the SGML string equivalent of the tag.

Constructors

 o SGML_Tag
 public SGML_Tag()
Construct a new tag with no name or attributes. To be valid SGML, at least a name must be set.

 o SGML_Tag
 public SGML_Tag(String str)
Given a string, creates an SGML tag with that name

Methods

 o parseTag
 public static SGML_Tag parseTag(String tstr)
Given a string that represents an SGML tag, returns the equivalent object of type SGML tag.

 o addAttribute
 public void addAttribute(String aname,
                          String value)
Adds an attribute with the given value to the tag.

 o findValName
 public String findValName(String value)
Returns the name of the attribute that has the given value.

 o getAttribute
 public String getAttribute(String aname)
Given an SGML attribute name returns the value or null if there is none. Since SGML is case-insensitive, the name is returned in a cannonical format, i.e., upper case.

 o getName
 public String getName()
Returns the name of the tag in cannonical format. Since SGML is case-insensitive, this returns the name in upper case. If we change to XML, this should return the name without changing the case.

 o getText
 public final String getText()
Returns the textual representation of the SGML tag. Overrides the HTML_Token method.

Overrides:
getText in class HTML_Token
 o isXmlEmptyTag
 public boolean isXmlEmptyTag()
Returns true if this tag is an XML style tag without content or a corresponding end tag.

 o setValName
 public void setValName(String value,
                        String aname)
Sets the name of the attribute with the given value. Used to assign default names to attributes that don't have them.

 o setValue
 public void setValue(String aname,
                      String value)
Sets the value of the given attribute as specified.

 o setXmlEmptyTag
 public void setXmlEmptyTag(boolean xmlEmptyTag)
Sets the status of whether this tag is an XML style tag without content or a corresponding end tag. If true, the string representation of this tag will contain a "/" before the closing angle bracket.

 o toString
 public String toString()
Returns the SGML string equivalent of the tag.

Overrides:
toString in class HTML_Token
 o getAttributeValue
 public String getAttributeValue(int index)
 o getAttributeName
 public String getAttributeName(int index)
Returns the name of the attribute at the position determined by index.


All Packages  Class Hierarchy  This Package  Previous  Next  Index