- java.lang.Object
-
- javax.swing.text.html.HTML.Tag
-
- 已知直接子类:
-
HTML.UnknownTag
- Enclosing class:
- HTML
public static class HTML.Tag extends Object
HTML标签的类型安全枚举。 虽然这组HTML标签是一个封闭的集合,但是我们已经将该集合设置为打开,以便人们可以将自己的标签类型添加到自定义解析器中,并仍然与读者进行通信。
-
-
Field Summary
Fields Modifier and Type Field 描述 static HTML.Tag
A
标记<a>static HTML.Tag
ADDRESS
标签<地址>static HTML.Tag
APPLET
标记<applet>static HTML.Tag
AREA
标签<area>static HTML.Tag
B
标记<b>static HTML.Tag
BASE
标签<base>static HTML.Tag
BASEFONT
标签<basefont>static HTML.Tag
BIG
标签<大>static HTML.Tag
BLOCKQUOTE
标签<blockquote>static HTML.Tag
BODY
标签<body>static HTML.Tag
BR
标签<br>static HTML.Tag
CAPTION
标签<caption>static HTML.Tag
CENTER
标签<center>static HTML.Tag
CITE
标签<cite>static HTML.Tag
CODE
标签<code>static HTML.Tag
COMMENT
所有评论均标有此标签。static HTML.Tag
CONTENT
所有文字内容均标有此标签。static HTML.Tag
DD
标签<dd>static HTML.Tag
DFN
标签<dfn>static HTML.Tag
DIR
标签<dir>static HTML.Tag
DIV
标签<div>static HTML.Tag
DL
标签<dl>static HTML.Tag
DT
标签<dt>static HTML.Tag
EM
标记<em>static HTML.Tag
FONT
标签<font>static HTML.Tag
FORM
标签<form>static HTML.Tag
FRAME
标记<frame>static HTML.Tag
FRAMESET
标签<frameset>static HTML.Tag
H1
标签<h1>static HTML.Tag
H2
标签<h2>static HTML.Tag
H3
标签<h3>static HTML.Tag
H4
标签<h4>static HTML.Tag
H5
标签<h5>static HTML.Tag
H6
标签<h6>static HTML.Tag
HEAD
标记<head>static HTML.Tag
HR
标签<hr>static HTML.Tag
HTML
标签<html>static HTML.Tag
I
标记<i>static HTML.Tag
IMG
标签<img>static HTML.Tag
IMPLIED
所有文本内容必须在段落元素中。static HTML.Tag
INPUT
标签<input>static HTML.Tag
ISINDEX
标签<isindex>static HTML.Tag
KBD
标签<kbd>static HTML.Tag
LI
标记<li>static HTML.Tag
LINK
标记<link>static HTML.Tag
MAP
标签<map>static HTML.Tag
MENU
标签<menu>static HTML.Tag
META
标签<meta>static HTML.Tag
NOFRAMES
标签<noframes>static HTML.Tag
OBJECT
标签<object>static HTML.Tag
OL
标记<ol>static HTML.Tag
OPTION
标签<选项>static HTML.Tag
P
标签<p>static HTML.Tag
PARAM
标签<param>static HTML.Tag
PRE
标签<pre>static HTML.Tag
S
标签<s>static HTML.Tag
SAMP
标签<samp>static HTML.Tag
SCRIPT
标记<script>static HTML.Tag
SELECT
标签<select>static HTML.Tag
SMALL
标签<small>static HTML.Tag
SPAN
标记<span>static HTML.Tag
STRIKE
标记<strike>static HTML.Tag
STRONG
标签<strong>static HTML.Tag
STYLE
标签<style>static HTML.Tag
SUB
标签<sub>static HTML.Tag
SUP
标签<sup>static HTML.Tag
TABLE
标签<table>static HTML.Tag
TD
标签<td>static HTML.Tag
TEXTAREA
标签<textarea>static HTML.Tag
TH
标签<th>static HTML.Tag
TITLE
标签<title>static HTML.Tag
TR
标签<tr>static HTML.Tag
TT
标签<tt>static HTML.Tag
U
标签<u>static HTML.Tag
UL
标记<ul>static HTML.Tag
VAR
标签<var>
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 boolean
breaksFlow()
返回true
如果此标签导致数据流的false
,否则返回false
。boolean
isBlock()
返回true
如果此标记是块标记,它是用于向文档添加结构的标记。boolean
isPreformatted()
如果此标签是预先格式化的,则返回true
,如果标记为PRE
或TEXTAREA
,则返回true。String
toString()
返回标签的字符串表示形式。
-
-
-
字段详细信息
-
A
public static final HTML.Tag A
标记<a>
-
ADDRESS
public static final HTML.Tag ADDRESS
标签<地址>
-
APPLET
public static final HTML.Tag APPLET
标记<applet>
-
AREA
public static final HTML.Tag AREA
标签<area>
-
B
public static final HTML.Tag B
标记<b>
-
BASE
public static final HTML.Tag BASE
标签<base>
-
BASEFONT
public static final HTML.Tag BASEFONT
标签<basefont>
-
BIG
public static final HTML.Tag BIG
标签<大>
-
BLOCKQUOTE
public static final HTML.Tag BLOCKQUOTE
标签<blockquote>
-
BODY
public static final HTML.Tag BODY
标签<body>
-
BR
public static final HTML.Tag BR
标签<br>
-
CAPTION
public static final HTML.Tag CAPTION
标签<caption>
-
CENTER
public static final HTML.Tag CENTER
标签<center>
-
CITE
public static final HTML.Tag CITE
标签<cite>
-
CODE
public static final HTML.Tag CODE
标签<code>
-
DD
public static final HTML.Tag DD
标签<dd>
-
DFN
public static final HTML.Tag DFN
标签<dfn>
-
DIR
public static final HTML.Tag DIR
标签<dir>
-
DIV
public static final HTML.Tag DIV
标签<div>
-
DL
public static final HTML.Tag DL
标签<dl>
-
DT
public static final HTML.Tag DT
标签<dt>
-
EM
public static final HTML.Tag EM
标记<em>
-
FONT
public static final HTML.Tag FONT
标签<font>
-
FORM
public static final HTML.Tag FORM
标签<form>
-
FRAME
public static final HTML.Tag FRAME
标记<frame>
-
FRAMESET
public static final HTML.Tag FRAMESET
标签<frameset>
-
H1
public static final HTML.Tag H1
标签<h1>
-
H2
public static final HTML.Tag H2
标签<h2>
-
H3
public static final HTML.Tag H3
标签<h3>
-
H4
public static final HTML.Tag H4
标签<h4>
-
H5
public static final HTML.Tag H5
标签<h5>
-
H6
public static final HTML.Tag H6
标签<h6>
-
HEAD
public static final HTML.Tag HEAD
标记<head>
-
HR
public static final HTML.Tag HR
标签<hr>
-
HTML
public static final HTML.Tag HTML
标签<html>
-
I
public static final HTML.Tag I
标记<i>
-
IMG
public static final HTML.Tag IMG
标签<img>
-
INPUT
public static final HTML.Tag INPUT
标签<input>
-
ISINDEX
public static final HTML.Tag ISINDEX
标签<isindex>
-
KBD
public static final HTML.Tag KBD
标签<kbd>
-
LI
public static final HTML.Tag LI
标记<li>
-
LINK
public static final HTML.Tag LINK
标记<link>
-
MAP
public static final HTML.Tag MAP
标签<map>
-
MENU
public static final HTML.Tag MENU
标签<menu>
-
META
public static final HTML.Tag META
标签<meta>
-
NOFRAMES
public static final HTML.Tag NOFRAMES
标签<noframes>
-
OBJECT
public static final HTML.Tag OBJECT
标签<object>
-
OL
public static final HTML.Tag OL
标记<ol>
-
OPTION
public static final HTML.Tag OPTION
标签<选项>
-
P
public static final HTML.Tag P
标签<p>
-
PARAM
public static final HTML.Tag PARAM
标签<param>
-
PRE
public static final HTML.Tag PRE
标签<pre>
-
SAMP
public static final HTML.Tag SAMP
标签<samp>
-
SCRIPT
public static final HTML.Tag SCRIPT
标记<script>
-
SELECT
public static final HTML.Tag SELECT
标签<select>
-
SMALL
public static final HTML.Tag SMALL
标签<small>
-
SPAN
public static final HTML.Tag SPAN
标记<span>
-
STRIKE
public static final HTML.Tag STRIKE
标记<strike>
-
S
public static final HTML.Tag S
标签<s>
-
STRONG
public static final HTML.Tag STRONG
标签<strong>
-
STYLE
public static final HTML.Tag STYLE
标签<style>
-
SUB
public static final HTML.Tag SUB
标签<sub>
-
SUP
public static final HTML.Tag SUP
标签<sup>
-
TABLE
public static final HTML.Tag TABLE
标签<table>
-
TD
public static final HTML.Tag TD
标签<td>
-
TEXTAREA
public static final HTML.Tag TEXTAREA
标签<textarea>
-
TH
public static final HTML.Tag TH
标签<th>
-
TITLE
public static final HTML.Tag TITLE
标签<title>
-
TR
public static final HTML.Tag TR
标签<tr>
-
TT
public static final HTML.Tag TT
标签<tt>
-
U
public static final HTML.Tag U
标签<u>
-
UL
public static final HTML.Tag UL
标记<ul>
-
VAR
public static final HTML.Tag VAR
标签<var>
-
IMPLIED
public static final HTML.Tag IMPLIED
所有文本内容必须在段落元素中。 如果遇到内容时一段不存在,则会生成一段。这是由HTML阅读器合成的标签。 由于元素是通过其标签类型来识别的,所以我们创建了一些假标签类型来标记制造的元素。
-
CONTENT
public static final HTML.Tag CONTENT
所有文字内容均标有此标签。这是由HTML阅读器合成的标签。 由于元素是通过其标签类型来识别的,所以我们创建了一些假标签类型来标记制造的元素。
-
COMMENT
public static final HTML.Tag COMMENT
所有评论均标有此标签。这是由HTML阅读器合成的标签。 由于元素是通过其标签类型来识别的,所以我们创建了一些假标签类型来标记制造的元素。
-
-
构造方法详细信息
-
Tag
public Tag()
- 从以下版本开始:
- 1.3
-
Tag
protected Tag(String id)
创建一个新的Tag
与指定的id
,并与causesBreak
和isBlock
设置为false
。- 参数
-
id
- 新标签的ID
-
Tag
protected Tag(String id, boolean causesBreak, boolean isBlock)
创建一个新的Tag
与指定的id
;causesBreak
和isBlock
由用户定义。- 参数
-
id
- 新标签的ID -
causesBreak
-true
如果此标签导致数据流中断 -
isBlock
-true
如果标签用于向文档添加结构
-
-
方法详细信息
-
isBlock
public boolean isBlock()
返回true
如果此标记是块标记,它是用于向文档添加结构的标记。- 结果
-
true
如果此标记是块标记,否则返回false
-
breaksFlow
public boolean breaksFlow()
返回true
如果此标记导致数据流中断,否则返回false
。- 结果
-
true
如果此标签导致数据流中断,否则返回false
-
isPreformatted
public boolean isPreformatted()
如果此标签是预格式的,则返回true
,如果标记为PRE
或TEXTAREA
,则返回true。- 结果
-
true
如果这个标签是预先格式化的,否则返回false
-
-