|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectHTMLElements
Contains static methods which group HTML element names by the characteristics of their associated elements.
An HTML element is a normal element with a name that matches one of the HTML element names (ignoring case). This type of element spans the logical HTML element as described in the HTML 4.01 specification section 3.2.1, which may be implicitly terminated if it specifies an optional end tag.
The term Non-HTML element refers to a normal element with a name that does not match one of the HTML element names. This type of element must be either a single tag element or explicitly terminated.
All of the sets returned by the methods in this class may be modified to customise the behaviour of the parser. Care must be taken however to ensure that the sets only contain tag names in lower case.
Below is a table summarising the default characteristics of each HTML element. See also the index of elements in the HTML 4.01 specification for the official table containing similar information.
HTMLElementName,
Element| Field Summary |
| Fields inherited from interface HTMLElementName |
A, ABBR, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DEL, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HEAD, HR, HTML, I, IFRAME, IMG, INPUT, INS, ISINDEX, KBD, LABEL, LEGEND, LI, LINK, MAP, MENU, META, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTGROUP, OPTION, P, PARAM, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR |
| Method Summary | |
static java.util.Set |
getBlockLevelElementNames()
Returns a set containing the names of all the block-level elements. |
static java.util.Set |
getDeprecatedElementNames()
Returns a set containing the names of all deprecated elements in HTML 4.01. |
static java.util.List |
getElementNames()
Returns a list containing all of the HTML element names. |
static java.util.Set |
getEndTagForbiddenElementNames()
Returns a set containing the names of all of the HTML elements for which the end tag is forbidden. |
static java.util.Set |
getEndTagOptionalElementNames()
Returns a set containing the names of all of the HTML elements for which the end tag is optional. |
static java.util.Set |
getEndTagRequiredElementNames()
Returns a set containing the names of all of the HTML elements for which the end tag is required. |
static java.util.Set |
getInlineLevelElementNames()
Returns a set containing the names of all the inline-level elements. |
static java.util.Set |
getNestingForbiddenElementNames()
Returns a set containing the names of all of the HTML elements which should never contain elements of the same name, either as direct or indirect descendants. |
static java.util.Set |
getNonterminatingElementNames(java.lang.String endTagOptionalElementName)
Returns the names of elements that do NOT implicitly terminate an HTML element with the specified name. |
static java.util.Set |
getStartTagOptionalElementNames()
Returns a set containing the names of all of the HTML elements for which the start tag is optional. |
static java.util.Set |
getTerminatingEndTagNames(java.lang.String endTagOptionalElementName)
Returns the names of end tags that implicitly terminate an HTML element with the specified name. |
static java.util.Set |
getTerminatingStartTagNames(java.lang.String endTagOptionalElementName)
Returns the names of start tags that implicitly terminate an HTML element with the specified name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final java.util.List getElementNames()
The returned list is in alphabetical order.
public static java.util.Set getBlockLevelElementNames()
The element names contained in this set are:
ADDRESS, BLOCKQUOTE, CENTER, DIR, DIV,
DL, FIELDSET, FORM,
H1, H2, H3, H4, H5, H6,
HR, ISINDEX, MENU, NOFRAMES, NOSCRIPT,
OL, P, PRE, TABLE, UL
This set is defined in the HTML 4.01 Transitional DTD, but more detailed information can be found in the HTML 4.01 specification section 7.5.3 - Block-level and inline elements and the CSS2 specification section 9.2.1 - Block-level elements and block boxes.
The CSS2 display property can be used to override the normal box type of an element.
getInlineLevelElementNames()public static java.util.Set getInlineLevelElementNames()
The element names contained in this set are:
A, ABBR, ACRONYM, APPLET, B, BASEFONT,
BDO, BIG, BR, BUTTON, CITE, CODE,
DEL, DFN, EM, FONT, I, IFRAME, IMG,
INPUT, INS, KBD, LABEL, MAP, OBJECT,
Q, S, SAMP, SCRIPT, SELECT, SMALL,
SPAN, STRIKE, STRONG, SUB, SUP, TEXTAREA,
TT, U, VAR
This set is defined in the HTML 4.01 Transitional DTD, but more detailed information can be found in the HTML 4.01 specification section 7.5.3 - Block-level and inline elements and the CSS2 specification section 9.2.2 - Inline-level elements and inline boxes.
The CSS2 display property can be used to override the normal box type of an element.
The HTML Document Type Definitions
forbid the presence of block-level elements inside inline-level elements,
but it is tolerated by all popular browsers in various situations, even in XHTML documents.
The most notorious example of this is the common inclusion of block-level elements inside FONT elements.
getBlockLevelElementNames()public static java.util.Set getDeprecatedElementNames()
public static java.util.Set getEndTagForbiddenElementNames()
See the element parsing rules for HTML elements with forbidden end tags for more information.
The index of elements in the HTML 4.01 specification includes the letter 'F' in the "End Tag" column for elements whose end tag is forbidden.
getEndTagOptionalElementNames(),
getEndTagRequiredElementNames()public static java.util.Set getEndTagOptionalElementNames()
Elements with these names may be implicitly terminated by a subsequent
terminating start tag or
terminating end tag.
A list of the these terminating tags, and the names of non-terminating elements
that can be nested within the element, can be found in the documentation of each relevant element in the HTMLElementName class.
See the element parsing rules for HTML elements with optional end tags for more information.
The index of elements in the HTML 4.01 specification includes the letter 'O' in the "End Tag" column for elements whose end tag is optional.