public enum HtmlTextEscapingMode extends Enum<HtmlTextEscapingMode>
The text in CDATA and RCDATA elements must not contain any
occurrences of the string "</"
(U+003C LESS-THAN SIGN, U+002F
SOLIDUS) followed by characters that case-insensitively match the
tag name of the element followed by one of U+0009 CHARACTER
TABULATION, U+000A LINE FEED (LF), U+000B LINE TABULATION, U+000C
FORM FEED (FF), U+0020 SPACE, U+003E GREATER-THAN SIGN (>
), or
U+002F SOLIDUS (/), unless that string is part of an escaping
text span.
See also http://www.whatwg.org/specs/web-apps/current-work/#cdata-rcdata-restrictions for the elements which fall in each category.
Enum Constant and Description |
---|
CDATA
A span of text where HTML special characters are interpreted literally,
as in a SCRIPT tag.
|
CDATA_SOMETIMES
Like
CDATA but only for certain browsers. |
PCDATA
Normally escaped character data that breaks around comments and tags.
|
PLAIN_TEXT
A span of text where HTML special characters are interpreted literally,
where there is no end tag.
|
RCDATA
A span of text and character entity references where HTML special
characters are interpreted literally, as in a TITLE tag.
|
VOID
Cannot contain data.
|
Modifier and Type | Method and Description |
---|---|
static HtmlTextEscapingMode |
getModeForTag(String canonTagName)
The mode used for content following a start tag with the given name.
|
static boolean |
isTagFollowedByLiteralContent(String canonTagName)
True if content immediately following the start tag must be treated as
special CDATA so that <'s are not treated as starting tags, comments
or directives.
|
static boolean |
isVoidElement(String canonTagName)
True iff the tag cannot contain any content -- will an HTML parser consider
the element to have ended immediately after the start tag.
|
static HtmlTextEscapingMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HtmlTextEscapingMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HtmlTextEscapingMode PCDATA
public static final HtmlTextEscapingMode CDATA
public static final HtmlTextEscapingMode CDATA_SOMETIMES
CDATA
but only for certain browsers.public static final HtmlTextEscapingMode RCDATA
public static final HtmlTextEscapingMode PLAIN_TEXT
public static final HtmlTextEscapingMode VOID
public static HtmlTextEscapingMode[] values()
for (HtmlTextEscapingMode c : HtmlTextEscapingMode.values()) System.out.println(c);
public static HtmlTextEscapingMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static HtmlTextEscapingMode getModeForTag(String canonTagName)
public static boolean isTagFollowedByLiteralContent(String canonTagName)
public static boolean isVoidElement(String canonTagName)
Copyright © 2018 OWASP. All rights reserved.