java.lang.Object
javax.swing.text.html.HTML.Tag
- Direct Known Subclasses:
HTML.UnknownTag
- Enclosing class:
- HTML
public static class HTML.Tag extends Object
Typesafe enumeration for an HTML tag. Although the
set of HTML tags is a closed set, we have left the
set open so that people can add their own tag types
to their custom parser and still communicate to the
reader.
-
Field Summary
Fields Modifier and Type Field Description static HTML.TagATag <a>static HTML.TagADDRESSTag <address>static HTML.TagAPPLETTag <applet>static HTML.TagAREATag <area>static HTML.TagBTag <b>static HTML.TagBASETag <base>static HTML.TagBASEFONTTag <basefont>static HTML.TagBIGTag <big>static HTML.TagBLOCKQUOTETag <blockquote>static HTML.TagBODYTag <body>static HTML.TagBRTag <br>static HTML.TagCAPTIONTag <caption>static HTML.TagCENTERTag <center>static HTML.TagCITETag <cite>static HTML.TagCODETag <code>static HTML.TagCOMMENTAll comments are labeled with this tag.static HTML.TagCONTENTAll text content is labeled with this tag.static HTML.TagDDTag <dd>static HTML.TagDFNTag <dfn>static HTML.TagDIRTag <dir>static HTML.TagDIVTag <div>static HTML.TagDLTag <dl>static HTML.TagDTTag <dt>static HTML.TagEMTag <em>static HTML.TagFONTTag <font>static HTML.TagFORMTag <form>static HTML.TagFRAMETag <frame>static HTML.TagFRAMESETTag <frameset>static HTML.TagH1Tag <h1>static HTML.TagH2Tag <h2>static HTML.TagH3Tag <h3>static HTML.TagH4Tag <h4>static HTML.TagH5Tag <h5>static HTML.TagH6Tag <h6>static HTML.TagHEADTag <head>static HTML.TagHRTag <hr>static HTML.TagHTMLTag <html>static HTML.TagITag <i>static HTML.TagIMGTag <img>static HTML.TagIMPLIEDAll text content must be in a paragraph element.static HTML.TagINPUTTag <input>static HTML.TagISINDEXTag <isindex>static HTML.TagKBDTag <kbd>static HTML.TagLITag <li>static HTML.TagLINKTag <link>static HTML.TagMAPTag <map>static HTML.TagMENUTag <menu>static HTML.TagMETATag <meta>static HTML.TagNOFRAMESTag <noframes>static HTML.TagOBJECTTag <object>static HTML.TagOLTag <ol>static HTML.TagOPTIONTag <option>static HTML.TagPTag <p>static HTML.TagPARAMTag <param>static HTML.TagPRETag <pre>static HTML.TagSTag <s>static HTML.TagSAMPTag <samp>static HTML.TagSCRIPTTag <script>static HTML.TagSELECTTag <select>static HTML.TagSMALLTag <small>static HTML.TagSPANTag <span>static HTML.TagSTRIKETag <strike>static HTML.TagSTRONGTag <strong>static HTML.TagSTYLETag <style>static HTML.TagSUBTag <sub>static HTML.TagSUPTag <sup>static HTML.TagTABLETag <table>static HTML.TagTDTag <td>static HTML.TagTEXTAREATag <textarea>static HTML.TagTHTag <th>static HTML.TagTITLETag <title>static HTML.TagTRTag <tr>static HTML.TagTTTag <tt>static HTML.TagUTag <u>static HTML.TagULTag <ul>static HTML.TagVARTag <var> -
Constructor Summary
Constructors Modifier Constructor Description Tag()protectedTag(String id)Creates a newTagwith the specifiedid, and withcausesBreakandisBlockset tofalse.protectedTag(String id, boolean causesBreak, boolean isBlock)Creates a newTagwith the specifiedid;causesBreakandisBlockare defined by the user. -
Method Summary
Modifier and Type Method Description booleanbreaksFlow()Returnstrueif this tag causes a line break to the flow of data, otherwise returnsfalse.booleanisBlock()Returnstrueif this tag is a block tag, which is a tag used to add structure to a document.booleanisPreformatted()Returnstrueif this tag is pre-formatted, which is true if the tag is eitherPREorTEXTAREA.StringtoString()Returns the string representation of the tag.
-
Field Details
-
A
Tag <a> -
ADDRESS
Tag <address> -
APPLET
Tag <applet> -
AREA
Tag <area> -
B
Tag <b> -
BASE
Tag <base> -
BASEFONT
Tag <basefont> -
BIG
Tag <big> -
BLOCKQUOTE
Tag <blockquote> -
BODY
Tag <body> -
BR
Tag <br> -
CAPTION
Tag <caption> -
CENTER
Tag <center> -
CITE
Tag <cite> -
CODE
Tag <code> -
DD
Tag <dd> -
DFN
Tag <dfn> -
DIR
Tag <dir> -
DIV
Tag <div> -
DL
Tag <dl> -
DT
Tag <dt> -
EM
Tag <em> -
FONT
Tag <font> -
FORM
Tag <form> -
FRAME
Tag <frame> -
FRAMESET
Tag <frameset> -
H1
Tag <h1> -
H2
Tag <h2> -
H3
Tag <h3> -
H4
Tag <h4> -
H5
Tag <h5> -
H6
Tag <h6> -
HEAD
Tag <head> -
HR
Tag <hr> -
HTML
Tag <html> -
I
Tag <i> -
IMG
Tag <img> -
INPUT
Tag <input> -
ISINDEX
Tag <isindex> -
KBD
Tag <kbd> -
LI
Tag <li> -
LINK
Tag <link> -
MAP
Tag <map> -
MENU
Tag <menu> -
META
Tag <meta> -
NOFRAMES
Tag <noframes> -
OBJECT
Tag <object> -
OL
Tag <ol> -
OPTION
Tag <option> -
P
Tag <p> -
PARAM
Tag <param> -
PRE
Tag <pre> -
SAMP
Tag <samp> -
SCRIPT
Tag <script> -
SELECT
Tag <select> -
SMALL
Tag <small> -
SPAN
Tag <span> -
STRIKE
Tag <strike> -
S
Tag <s> -
STRONG
Tag <strong> -
STYLE
Tag <style> -
SUB
Tag <sub> -
SUP
Tag <sup> -
TABLE
Tag <table> -
TD
Tag <td> -
TEXTAREA
Tag <textarea> -
TH
Tag <th> -
TITLE
Tag <title> -
TR
Tag <tr> -
TT
Tag <tt> -
U
Tag <u> -
UL
Tag <ul> -
VAR
Tag <var> -
IMPLIED
All text content must be in a paragraph element. If a paragraph didn't exist when content was encountered, a paragraph is manufactured.This is a tag synthesized by the HTML reader. Since elements are identified by their tag type, we create a some fake tag types to mark the elements that were manufactured.
-
CONTENT
All text content is labeled with this tag.This is a tag synthesized by the HTML reader. Since elements are identified by their tag type, we create a some fake tag types to mark the elements that were manufactured.
-
COMMENT
All comments are labeled with this tag.This is a tag synthesized by the HTML reader. Since elements are identified by their tag type, we create a some fake tag types to mark the elements that were manufactured.
-
-
Constructor Details
-
Tag
public Tag()- Since:
- 1.3
-
Tag
Creates a newTagwith the specifiedid, and withcausesBreakandisBlockset tofalse.- Parameters:
id- the id of the new tag
-
Tag
Creates a newTagwith the specifiedid;causesBreakandisBlockare defined by the user.- Parameters:
id- the id of the new tagcausesBreak-trueif this tag causes a break to the flow of dataisBlock-trueif the tag is used to add structure to a document
-
-
Method Details
-
isBlock
public boolean isBlock()Returnstrueif this tag is a block tag, which is a tag used to add structure to a document.- Returns:
trueif this tag is a block tag, otherwise returnsfalse
-
breaksFlow
public boolean breaksFlow()Returnstrueif this tag causes a line break to the flow of data, otherwise returnsfalse.- Returns:
trueif this tag causes a line break to the flow of data, otherwise returnsfalse
-
isPreformatted
public boolean isPreformatted()Returnstrueif this tag is pre-formatted, which is true if the tag is eitherPREorTEXTAREA.- Returns:
trueif this tag is pre-formatted, otherwise returnsfalse
-
toString
Returns the string representation of the tag.
-