Class HTML.Tag
java.lang.Object
javax.swing.text.html.HTML.Tag
- Direct Known Subclasses:
HTML.UnknownTag
- Enclosing class:
HTML
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
FieldsModifier and TypeFieldDescriptionstatic final HTML.TagTag <a>static final HTML.TagTag <address>static final HTML.TagTag <applet>static final HTML.TagTag <area>static final HTML.TagTag <b>static final HTML.TagTag <base>static final HTML.TagTag <basefont>static final HTML.TagTag <big>static final HTML.TagTag <blockquote>static final HTML.TagTag <body>static final HTML.TagTag <br>static final HTML.TagTag <caption>static final HTML.TagTag <center>static final HTML.TagTag <cite>static final HTML.TagTag <code>static final HTML.TagAll comments are labeled with this tag.static final HTML.TagAll text content is labeled with this tag.static final HTML.TagTag <dd>static final HTML.TagTag <dfn>static final HTML.TagTag <dir>static final HTML.TagTag <div>static final HTML.TagTag <dl>static final HTML.TagTag <dt>static final HTML.TagTag <em>static final HTML.TagTag <font>static final HTML.TagTag <form>static final HTML.TagTag <frame>static final HTML.TagTag <frameset>static final HTML.TagTag <h1>static final HTML.TagTag <h2>static final HTML.TagTag <h3>static final HTML.TagTag <h4>static final HTML.TagTag <h5>static final HTML.TagTag <h6>static final HTML.TagTag <head>static final HTML.TagTag <hr>static final HTML.TagTag <html>static final HTML.TagTag <i>static final HTML.TagTag <img>static final HTML.TagAll text content must be in a paragraph element.static final HTML.TagTag <input>static final HTML.TagTag <isindex>static final HTML.TagTag <kbd>static final HTML.TagTag <li>static final HTML.TagTag <link>static final HTML.TagTag <map>static final HTML.TagTag <menu>static final HTML.TagTag <meta>static final HTML.TagTag <noframes>static final HTML.TagTag <object>static final HTML.TagTag <ol>static final HTML.TagTag <option>static final HTML.TagTag <p>static final HTML.TagTag <param>static final HTML.TagTag <pre>static final HTML.TagTag <s>static final HTML.TagTag <samp>static final HTML.TagTag <script>static final HTML.TagTag <select>static final HTML.TagTag <small>static final HTML.TagTag <span>static final HTML.TagTag <strike>static final HTML.TagTag <strong>static final HTML.TagTag <style>static final HTML.TagTag <sub>static final HTML.TagTag <sup>static final HTML.TagTag <table>static final HTML.TagTag <td>static final HTML.TagTag <textarea>static final HTML.TagTag <th>static final HTML.TagTag <title>static final HTML.TagTag <tr>static final HTML.TagTag <tt>static final HTML.TagTag <u>static final HTML.TagTag <ul>static final HTML.TagTag <var> -
Constructor Summary
ConstructorsModifierConstructorDescriptionTag()Constructs aTag.protectedCreates a newTagwith the specifiedid, and withcausesBreakandisBlockset tofalse.protectedCreates a newTagwith the specifiedid;causesBreakandisBlockare defined by the user. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif 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.booleanReturnstrueif this tag is pre-formatted, which is true if the tag is eitherPREorTEXTAREA.toString()Returns the string representation of the tag.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.booleanIndicates whether some other object is "equal to" this one.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.inthashCode()Returns a hash code value for this object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
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()Constructs aTag.- 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
-