Class HTML
java.lang.Object
javax.swing.text.html.HTML
Constants used in the 
HTMLDocument.  These
 are basically tag and attribute definitions.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classTypesafe enumeration representing an HTML attribute.static classTypesafe enumeration for an HTML tag.static classClass represents unknown HTML tag.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringNULL_ATTRIBUTE_VALUEused in cases where the value for the attribute has not been specified.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic HTML.Attribute[]Returns the set of HTML attributes recognized.static HTML.Tag[]Returns the set of actual HTML tags that are recognized by the default HTML reader.static HTML.AttributegetAttributeKey(String attName) Fetches an attribute constant for a well-known attribute name (i.e. one of the attributes in the set {FACE, COMMENT, SIZE, COLOR, CLEAR, BACKGROUND, BGCOLOR, TEXT, LINK, VLINK, ALINK, WIDTH, HEIGHT, ALIGN, NAME, HREF, REL, REV, TITLE, TARGET, SHAPE, COORDS, ISMAP, NOHREF, ALT, ID, SRC, HSPACE, VSPACE, USEMAP, LOWSRC, CODEBASE, CODE, ARCHIVE, VALUE, VALUETYPE, TYPE, CLASS, STYLE, LANG, DIR, DECLARE, CLASSID, DATA, CODETYPE, STANDBY, BORDER, SHAPES, NOSHADE, COMPACT, START, ACTION, METHOD, ENCTYPE, CHECKED, MAXLENGTH, MULTIPLE, SELECTED, ROWS, COLS, DUMMY, CELLSPACING, CELLPADDING, VALIGN, HALIGN, NOWRAP, ROWSPAN, COLSPAN, PROMPT, HTTPEQUIV, CONTENT, LANGUAGE, VERSION, N, FRAMEBORDER, MARGINWIDTH, MARGINHEIGHT, SCROLLING, NORESIZE, MEDIA, ENDTAG}).static intgetIntegerAttributeValue(AttributeSet attr, HTML.Attribute key, int def) Fetches an integer attribute value.static HTML.TagFetches a tag constant for a well-known tag name (i.e. one of the tags in the set {A, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BIG, BLOCKQUOTE, BODY, BR, CAPTION, CENTER, CITE, CODE, DD, DFN, DIR, DIV, DL, DT, EM, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IMG, INPUT, ISINDEX, KBD, LI, LINK, MAP, MENU, META, NOBR, NOFRAMES, OBJECT, OL, OPTION, P, PARAM, PRE, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, S, STRONG, STYLE, SUB, SUP, TABLE, TD, TEXTAREA, TH, TITLE, TR, TT, U, UL, VAR}.
- 
Field Details- 
NULL_ATTRIBUTE_VALUENULL_ATTRIBUTE_VALUEused in cases where the value for the attribute has not been specified.- See Also:
 
 
- 
- 
Constructor Details- 
HTMLpublic HTML()Constructs aHTML.
 
- 
- 
Method Details- 
getAllTagsReturns the set of actual HTML tags that are recognized by the default HTML reader. This set does not include tags that are manufactured by the reader.- Returns:
- the set of actual HTML tags that are recognized by the default HTML reader
 
- 
getTagFetches a tag constant for a well-known tag name (i.e. one of the tags in the set {A, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BIG, BLOCKQUOTE, BODY, BR, CAPTION, CENTER, CITE, CODE, DD, DFN, DIR, DIV, DL, DT, EM, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IMG, INPUT, ISINDEX, KBD, LI, LINK, MAP, MENU, META, NOBR, NOFRAMES, OBJECT, OL, OPTION, P, PARAM, PRE, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, S, STRONG, STYLE, SUB, SUP, TABLE, TD, TEXTAREA, TH, TITLE, TR, TT, U, UL, VAR}. If the given name does not represent one of the well-known tags, thennullwill be returned.- Parameters:
- tagName- the- Stringname requested
- Returns:
- a tag constant corresponding to the tagName, ornullif not found
 
- 
getIntegerAttributeValueFetches an integer attribute value. Attribute values are stored as a string, and this is a convenience method to convert to an actual integer.- Parameters:
- attr- the set of attributes to use to try to fetch a value
- key- the key to use to fetch the value
- def- the default value to use if the attribute isn't defined or there is an error converting to an integer
- Returns:
- an attribute value
 
- 
getAllAttributeKeysReturns the set of HTML attributes recognized.- Returns:
- the set of HTML attributes recognized
 
- 
getAttributeKeyFetches an attribute constant for a well-known attribute name (i.e. one of the attributes in the set {FACE, COMMENT, SIZE, COLOR, CLEAR, BACKGROUND, BGCOLOR, TEXT, LINK, VLINK, ALINK, WIDTH, HEIGHT, ALIGN, NAME, HREF, REL, REV, TITLE, TARGET, SHAPE, COORDS, ISMAP, NOHREF, ALT, ID, SRC, HSPACE, VSPACE, USEMAP, LOWSRC, CODEBASE, CODE, ARCHIVE, VALUE, VALUETYPE, TYPE, CLASS, STYLE, LANG, DIR, DECLARE, CLASSID, DATA, CODETYPE, STANDBY, BORDER, SHAPES, NOSHADE, COMPACT, START, ACTION, METHOD, ENCTYPE, CHECKED, MAXLENGTH, MULTIPLE, SELECTED, ROWS, COLS, DUMMY, CELLSPACING, CELLPADDING, VALIGN, HALIGN, NOWRAP, ROWSPAN, COLSPAN, PROMPT, HTTPEQUIV, CONTENT, LANGUAGE, VERSION, N, FRAMEBORDER, MARGINWIDTH, MARGINHEIGHT, SCROLLING, NORESIZE, MEDIA, ENDTAG}). If the given name does not represent one of the well-known attributes, thennullwill be returned.- Parameters:
- attName- the- Stringrequested
- Returns:
- the Attributecorresponding toattName
 
 
-