All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class websphinx.Tag

java.lang.Object
   |
   +----websphinx.Region
           |
           +----websphinx.Tag

public class Tag
extends Region
Tag in an HTML page.


Variable Index

 o A
Commonly useful tag names.
 o ABBREV
 o ACRONYM
 o ADDRESS
 o APPLET
 o AREA
 o B
 o BASE
 o BASEFONT
 o BDO
 o BGSOUND
 o BIG
 o BLINK
 o BLOCKQUOTE
 o BODY
 o BR
 o CAPTION
 o CENTER
 o CITE
 o CODE
 o COL
 o COLGROUP
 o COMMENT
 o DD
 o DEL
 o DFN
 o DIR
 o DIV
 o DL
 o DT
 o EM
 o EMBED
 o FONT
 o FORM
 o FRAME
 o FRAMESET
 o H1
 o H2
 o H3
 o H4
 o H5
 o H6
 o HEAD
 o HR
 o HTML
 o I
 o IMG
 o INPUT
 o ISINDEX
 o KBD
 o LI
 o LINK
 o LISTING
 o MAP
 o MARQUEE
 o MAX_LENGTH
Length of longest tag name.
 o MENU
 o META
 o NEXTID
 o NOBR
 o NOEMBED
 o NOFRAMES
 o OBJECT
 o OL
 o OPTION
 o P
 o PARAM
 o PLAINTEXT
 o PRE
 o SAMP
 o SCRIPT
 o SELECT
 o SMALL
 o SPACER
 o STRIKE
 o STRONG
 o STYLE
 o SUB
 o SUP
 o TABLE
 o TD
 o TEXTAREA
 o TH
 o TITLE
 o TR
 o TT
 o U
 o UL
 o VAR
 o WBR
 o XMP

Constructor Index

 o Tag(Page, int, int, String, boolean)
Make a Tag.

Method Index

 o countHTMLAttributes()
Get number of HTML attributes on this tag.
 o enumerateHTMLAttributes()
Enumerate the HTML attributes found on this tag.
 o getElement()
Get element to which this tag is the start or end tag.
 o getHTMLAttribute(String)
Get an HTML attribute's value.
 o getHTMLAttribute(String, String)
Get an HTML attribute's value, with a default value if it doesn't exist.
 o getHTMLAttributes()
Get all the HTML attributes found on this tag.
 o getTagName()
Get tag name.
 o hasHTMLAttribute(String)
Test if tag has an HTML attribute.
 o isBlockTag()
Test if tag is a block-level tag.
 o isBodyTag()
Test if tag belongs in the element.
 o isEndTag()
Test if tag is an end tag.
 o isFlowTag()
Test if tag is a flow-level tag.
 o isHeadTag()
Test if tag belongs in the element.
 o isStartTag()
Test if tag is a start tag.
 o removeHTMLAttribute(String)
Copy this tag, removing an HTML attribute.
 o replaceHTMLAttribute(String)
Copy this tag, setting an HTML attribute's value to TRUE.
 o replaceHTMLAttribute(String, String)
Copy this tag, setting an HTML attribute's value.
 o toHTMLAttributeName(String)
Convert a String to an HTML attribute name.
 o toTagName(String)
Convert a String to a tag name.

Variables

 o A
 public static final String A
Commonly useful tag names. Derived from HTML Elements at Sandia National Labs.

 o ABBREV
 public static final String ABBREV
 o ACRONYM
 public static final String ACRONYM
 o ADDRESS
 public static final String ADDRESS
 o APPLET
 public static final String APPLET
 o AREA
 public static final String AREA
 o B
 public static final String B
 o BASE
 public static final String BASE
 o BASEFONT
 public static final String BASEFONT
 o BDO
 public static final String BDO
 o BGSOUND
 public static final String BGSOUND
 o BIG
 public static final String BIG
 o BLINK
 public static final String BLINK
 o BLOCKQUOTE
 public static final String BLOCKQUOTE
 o BODY
 public static final String BODY
 o BR
 public static final String BR
 o CAPTION
 public static final String CAPTION
 o CENTER
 public static final String CENTER
 o CITE
 public static final String CITE
 o CODE
 public static final String CODE
 o COL
 public static final String COL
 o COLGROUP
 public static final String COLGROUP
 o COMMENT
 public static final String COMMENT
 o DD
 public static final String DD
 o DEL
 public static final String DEL
 o DFN
 public static final String DFN
 o DIR
 public static final String DIR
 o DIV
 public static final String DIV
 o DL
 public static final String DL
 o DT
 public static final String DT
 o EM
 public static final String EM
 o EMBED
 public static final String EMBED
 o FONT
 public static final String FONT
 o FRAME
 public static final String FRAME
 o FRAMESET
 public static final String FRAMESET
 o FORM
 public static final String FORM
 o H1
 public static final String H1
 o H2
 public static final String H2
 o H3
 public static final String H3
 o H4
 public static final String H4
 o H5
 public static final String H5
 o H6
 public static final String H6
 o HEAD
 public static final String HEAD
 o HR
 public static final String HR
 o HTML
 public static final String HTML
 o I
 public static final String I
 o IMG
 public static final String IMG
 o INPUT
 public static final String INPUT
 o ISINDEX
 public static final String ISINDEX
 o KBD
 public static final String KBD
 o LI
 public static final String LI
 o LINK
 public static final String LINK
 o LISTING
 public static final String LISTING
 o MAP
 public static final String MAP
 o MARQUEE
 public static final String MARQUEE
 o MENU
 public static final String MENU
 o META
 public static final String META
 o NEXTID
 public static final String NEXTID
 o NOBR
 public static final String NOBR
 o NOEMBED
 public static final String NOEMBED
 o NOFRAMES
 public static final String NOFRAMES
 o OBJECT
 public static final String OBJECT
 o OL
 public static final String OL
 o OPTION
 public static final String OPTION
 o P
 public static final String P
 o PARAM
 public static final String PARAM
 o PLAINTEXT
 public static final String PLAINTEXT
 o PRE
 public static final String PRE
 o SAMP
 public static final String SAMP
 o SCRIPT
 public static final String SCRIPT
 o SELECT
 public static final String SELECT
 o SMALL
 public static final String SMALL
 o SPACER
 public static final String SPACER
 o STRIKE
 public static final String STRIKE
 o STRONG
 public static final String STRONG
 o STYLE
 public static final String STYLE
 o SUB
 public static final String SUB
 o SUP
 public static final String SUP
 o TABLE
 public static final String TABLE
 o TD
 public static final String TD
 o TEXTAREA
 public static final String TEXTAREA
 o TH
 public static final String TH
 o TITLE
 public static final String TITLE
 o TR
 public static final String TR
 o TT
 public static final String TT
 o U
 public static final String U
 o UL
 public static final String UL
 o VAR
 public static final String VAR
 o WBR
 public static final String WBR
 o XMP
 public static final String XMP
 o MAX_LENGTH
 public static int MAX_LENGTH
Length of longest tag name.

Constructors

 o Tag
 public Tag(Page page,
            int start,
            int end,
            String tagName,
            boolean startTag)
Make a Tag.

Parameters:
page - Page containing tag
start - Starting offset of tag in page
end - Ending offset of tag
tagName - Name of tag (like "p")
startTag - true for start tags (like "<p>"), false for end tags ("</p>")

Methods

 o getTagName
 public String getTagName()
Get tag name.

Returns:
tag name (like "p"), in lower-case, String.intern()'ed form.
 o getElement
 public Element getElement()
Get element to which this tag is the start or end tag.

Returns:
element, or null if tag has no element.
 o toTagName
 public static String toTagName(String name)
Convert a String to a tag name. Tag names are lower-case, intern()'ed Strings. Thus you can compare tag names with ==, as in: getTagName() == Tag.IMG.

Parameters:
name - Name to convert (e.g., "P")
Returns:
tag name (e.g. "p"), in lower-case, String.intern()'ed form.
 o isStartTag
 public boolean isStartTag()
Test if tag is a start tag. Equivalent to !isEndTag().

Returns:
true if and only if tag is a start tag (like "<P>")
 o isEndTag
 public boolean isEndTag()
Test if tag is an end tag. Equivalent to !isStartTag().

Returns:
true if and only if tag is a start tag (like "</P>")
 o isBlockTag
 public boolean isBlockTag()
Test if tag is a block-level tag. Equivalent to !isFlowTag().

Returns:
true if and only if tag is a block-level tag (like "<P>")
 o isFlowTag
 public boolean isFlowTag()
Test if tag is a flow-level tag. Equivalent to !isBlockTag().

Returns:
true if and only if tag is a block-level tag (like "<A>")
 o isHeadTag
 public boolean isHeadTag()
Test if tag belongs in the element.

Returns:
true if and only if tag is a HEAD-level tag (like "<TITLE>")
 o isBodyTag
 public boolean isBodyTag()
Test if tag belongs in the element.

Returns:
true if and only if tag is a BODY-level tag (like "<A>")
 o toHTMLAttributeName
 public static String toHTMLAttributeName(String name)
Convert a String to an HTML attribute name. Attribute names are lower-case, intern()'ed Strings. Thus you can compare attribute names with ==.

Parameters:
name - Name to convert (e.g., "HREF")
Returns:
tag name (e.g. "href"), in lower-case, String.intern()'ed form.
 o hasHTMLAttribute
 public boolean hasHTMLAttribute(String name)
Test if tag has an HTML attribute.

Parameters:
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be converted with toHTMLAttributeName().
Returns:
true if tag has the attribute, false if not
 o getHTMLAttribute
 public String getHTMLAttribute(String name)
Get an HTML attribute's value.

Parameters:
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be converted with toHTMLAttributeName().
Returns:
value of attribute if it exists, TRUE if the attribute exists but has no value, or null if tag lacks the attribute.
 o getHTMLAttribute
 public String getHTMLAttribute(String name,
                                String defaultValue)
Get an HTML attribute's value, with a default value if it doesn't exist.

Parameters:
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be converted with toHTMLAttributeName().
defaultValue - default value to return if the attribute doesn't exist
Returns:
value of attribute if it exists, TRUE if the attribute exists but has no value, or defaultValue if tag lacks the attribute.
 o countHTMLAttributes
 public int countHTMLAttributes()
Get number of HTML attributes on this tag.

Returns:
number of HTML attributes
 o getHTMLAttributes
 public String[] getHTMLAttributes()
Get all the HTML attributes found on this tag.

Returns:
array of name-value pairs, alternating between names and values. Thus array[0] is a name, array[1] is a value, array[2] is a name, etc.
 o enumerateHTMLAttributes
 public Enumeration enumerateHTMLAttributes()
Enumerate the HTML attributes found on this tag.

Returns:
enumeration of the attribute names found on this tag.
 o removeHTMLAttribute
 public Tag removeHTMLAttribute(String name)
Copy this tag, removing an HTML attribute.

Parameters:
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be converted with toHTMLAttributeName().
Returns:
copy of this tag with named attribute removed. The copy is a region of a fresh page containing only the tag.
 o replaceHTMLAttribute
 public Tag replaceHTMLAttribute(String name)
Copy this tag, setting an HTML attribute's value to TRUE.

Parameters:
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be converted with toHTMLAttributeName().
Returns:
copy of this tag with named attribute set to TRUE. The copy is a region of a fresh page containing only the tag.
 o replaceHTMLAttribute
 public Tag replaceHTMLAttribute(String name,
                                 String value)
Copy this tag, setting an HTML attribute's value.

Parameters:
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be converted with toHTMLAttributeName().
value - New value for the attribute
Returns:
copy of this tag with named attribute set to value. The copy is a region of a fresh page containing only the tag.

All Packages  Class Hierarchy  This Package  Previous  Next  Index