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.
-
SGML_Tag()
- Construct a new tag with no name or attributes.
-
SGML_Tag(String)
- Given a string, creates an SGML tag with that name
-
addAttribute(String, String)
- Adds an attribute with the given value to the tag.
-
findValName(String)
- Returns the name of the attribute that has the given value.
-
getAttribute(String)
- Given an SGML attribute name returns the value or null if there
is none.
-
getAttributeName(int)
- Returns the name of the attribute at the position determined by
index.
-
getAttributeValue(int)
-
-
getName()
- Returns the name of the tag in cannonical format.
-
getText()
- Returns the textual representation of the SGML tag.
-
isXmlEmptyTag()
- Returns true if this tag is an XML style tag without
content or a corresponding end tag.
-
parseTag(String)
- Given a string that represents an SGML tag, returns the equivalent
object of type SGML tag.
-
setValName(String, String)
- Sets the name of the attribute with the given value.
-
setValue(String, String)
- Sets the value of the given attribute as specified.
-
setXmlEmptyTag(boolean)
- Sets the status of whether this tag is an XML style tag without
content or a corresponding end tag.
-
toString()
- Returns the SGML string equivalent of the tag.
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.
SGML_Tag
public SGML_Tag(String str)
- Given a string, creates an SGML tag with that name
parseTag
public static SGML_Tag parseTag(String tstr)
- Given a string that represents an SGML tag, returns the equivalent
object of type SGML tag.
addAttribute
public void addAttribute(String aname,
String value)
- Adds an attribute with the given value to the tag.
findValName
public String findValName(String value)
- Returns the name of the attribute that has the given value.
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.
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.
getText
public final String getText()
- Returns the textual representation of the SGML tag. Overrides the
HTML_Token method.
- Overrides:
- getText in class HTML_Token
isXmlEmptyTag
public boolean isXmlEmptyTag()
- Returns true if this tag is an XML style tag without
content or a corresponding end tag.
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.
setValue
public void setValue(String aname,
String value)
- Sets the value of the given attribute as specified.
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.
toString
public String toString()
- Returns the SGML string equivalent of the tag.
- Overrides:
- toString in class HTML_Token
getAttributeValue
public String getAttributeValue(int index)
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