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.Tag
A
Tag <a>static HTML.Tag
ADDRESS
Tag <address>static HTML.Tag
APPLET
Tag <applet>static HTML.Tag
AREA
Tag <area>static HTML.Tag
B
Tag <b>static HTML.Tag
BASE
Tag <base>static HTML.Tag
BASEFONT
Tag <basefont>static HTML.Tag
BIG
Tag <big>static HTML.Tag
BLOCKQUOTE
Tag <blockquote>static HTML.Tag
BODY
Tag <body>static HTML.Tag
BR
Tag <br>static HTML.Tag
CAPTION
Tag <caption>static HTML.Tag
CENTER
Tag <center>static HTML.Tag
CITE
Tag <cite>static HTML.Tag
CODE
Tag <code>static HTML.Tag
COMMENT
All comments are labeled with this tag.static HTML.Tag
CONTENT
All text content is labeled with this tag.static HTML.Tag
DD
Tag <dd>static HTML.Tag
DFN
Tag <dfn>static HTML.Tag
DIR
Tag <dir>static HTML.Tag
DIV
Tag <div>static HTML.Tag
DL
Tag <dl>static HTML.Tag
DT
Tag <dt>static HTML.Tag
EM
Tag <em>static HTML.Tag
FONT
Tag <font>static HTML.Tag
FORM
Tag <form>static HTML.Tag
FRAME
Tag <frame>static HTML.Tag
FRAMESET
Tag <frameset>static HTML.Tag
H1
Tag <h1>static HTML.Tag
H2
Tag <h2>static HTML.Tag
H3
Tag <h3>static HTML.Tag
H4
Tag <h4>static HTML.Tag
H5
Tag <h5>static HTML.Tag
H6
Tag <h6>static HTML.Tag
HEAD
Tag <head>static HTML.Tag
HR
Tag <hr>static HTML.Tag
HTML
Tag <html>static HTML.Tag
I
Tag <i>static HTML.Tag
IMG
Tag <img>static HTML.Tag
IMPLIED
All text content must be in a paragraph element.static HTML.Tag
INPUT
Tag <input>static HTML.Tag
ISINDEX
Tag <isindex>static HTML.Tag
KBD
Tag <kbd>static HTML.Tag
LI
Tag <li>static HTML.Tag
LINK
Tag <link>static HTML.Tag
MAP
Tag <map>static HTML.Tag
MENU
Tag <menu>static HTML.Tag
META
Tag <meta>static HTML.Tag
NOFRAMES
Tag <noframes>static HTML.Tag
OBJECT
Tag <object>static HTML.Tag
OL
Tag <ol>static HTML.Tag
OPTION
Tag <option>static HTML.Tag
P
Tag <p>static HTML.Tag
PARAM
Tag <param>static HTML.Tag
PRE
Tag <pre>static HTML.Tag
S
Tag <s>static HTML.Tag
SAMP
Tag <samp>static HTML.Tag
SCRIPT
Tag <script>static HTML.Tag
SELECT
Tag <select>static HTML.Tag
SMALL
Tag <small>static HTML.Tag
SPAN
Tag <span>static HTML.Tag
STRIKE
Tag <strike>static HTML.Tag
STRONG
Tag <strong>static HTML.Tag
STYLE
Tag <style>static HTML.Tag
SUB
Tag <sub>static HTML.Tag
SUP
Tag <sup>static HTML.Tag
TABLE
Tag <table>static HTML.Tag
TD
Tag <td>static HTML.Tag
TEXTAREA
Tag <textarea>static HTML.Tag
TH
Tag <th>static HTML.Tag
TITLE
Tag <title>static HTML.Tag
TR
Tag <tr>static HTML.Tag
TT
Tag <tt>static HTML.Tag
U
Tag <u>static HTML.Tag
UL
Tag <ul>static HTML.Tag
VAR
Tag <var> -
Constructor Summary
Constructors Modifier Constructor Description Tag()
protected
Tag(String id)
Creates a newTag
with the specifiedid
, and withcausesBreak
andisBlock
set tofalse
.protected
Tag(String id, boolean causesBreak, boolean isBlock)
Creates a newTag
with the specifiedid
;causesBreak
andisBlock
are defined by the user. -
Method Summary
Modifier and Type Method Description boolean
breaksFlow()
Returnstrue
if this tag causes a line break to the flow of data, otherwise returnsfalse
.boolean
isBlock()
Returnstrue
if this tag is a block tag, which is a tag used to add structure to a document.boolean
isPreformatted()
Returnstrue
if this tag is pre-formatted, which is true if the tag is eitherPRE
orTEXTAREA
.String
toString()
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 newTag
with the specifiedid
, and withcausesBreak
andisBlock
set tofalse
.- Parameters:
id
- the id of the new tag
-
Tag
Creates a newTag
with the specifiedid
;causesBreak
andisBlock
are defined by the user.- Parameters:
id
- the id of the new tagcausesBreak
-true
if this tag causes a break to the flow of dataisBlock
-true
if the tag is used to add structure to a document
-
-
Method Details
-
isBlock
public boolean isBlock()Returnstrue
if this tag is a block tag, which is a tag used to add structure to a document.- Returns:
true
if this tag is a block tag, otherwise returnsfalse
-
breaksFlow
public boolean breaksFlow()Returnstrue
if this tag causes a line break to the flow of data, otherwise returnsfalse
.- Returns:
true
if this tag causes a line break to the flow of data, otherwise returnsfalse
-
isPreformatted
public boolean isPreformatted()Returnstrue
if this tag is pre-formatted, which is true if the tag is eitherPRE
orTEXTAREA
.- Returns:
true
if this tag is pre-formatted, otherwise returnsfalse
-
toString
Returns the string representation of the tag.
-