public enum XmlEscapeLevel extends Enum<XmlEscapeLevel>
Levels defined for XML escape/unescape operations:
Note that, apart from the settings established by each of these levels, different XML versions might establish the required escaping of a series of control characteres (basically, all the allowed ones). These control character will be always escaped, from level 1. Besides, some characters considered invalid in such versions of XML might be directly removed from output.
Also note that no level 0 exists, in order to keep consistency with HTML escape levels defined in
HtmlEscapeLevel
.
For further information, see the Glossary and the References sections at the
documentation for the XmlEscape
class.
Enum Constant and Description |
---|
LEVEL_1_ONLY_MARKUP_SIGNIFICANT
Level 1 escape: escape only markup-significant characters (all five XML predefined entities):
<, >, &, " and '
|
LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT
Level 2 escape: escape markup-significant characters plus all non-ASCII characters (result will always be ASCII).
|
LEVEL_3_ALL_NON_ALPHANUMERIC
Level 3 escape: escape all non-alphanumeric characteres (escape all but those in the
A-Z, a-z and 0-9 ranges).
|
LEVEL_4_ALL_CHARACTERS
Level 4 escape: escape all characters, including alphanumeric.
|
Modifier and Type | Method and Description |
---|---|
static XmlEscapeLevel |
forLevel(int level)
Utility method for obtaining an enum value from its corresponding int level value.
|
int |
getEscapeLevel()
Return the int escape level.
|
static XmlEscapeLevel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static XmlEscapeLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final XmlEscapeLevel LEVEL_1_ONLY_MARKUP_SIGNIFICANT
public static final XmlEscapeLevel LEVEL_2_ALL_NON_ASCII_PLUS_MARKUP_SIGNIFICANT
public static final XmlEscapeLevel LEVEL_3_ALL_NON_ALPHANUMERIC
public static final XmlEscapeLevel LEVEL_4_ALL_CHARACTERS
public static XmlEscapeLevel[] values()
for (XmlEscapeLevel c : XmlEscapeLevel.values()) System.out.println(c);
public static XmlEscapeLevel 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 XmlEscapeLevel forLevel(int level)
Utility method for obtaining an enum value from its corresponding int level value.
level
- the levelpublic int getEscapeLevel()
Copyright © 2015 The UNBESCAPE team. All rights reserved.