public enum ProtectionContext extends Enum<ProtectionContext>
The specified rules refer to http://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet
Enum Constant and Description |
---|
HTML_HTML_CONTENT
Escape HTML for use inside element content (rules #6 and - to some degree - #1),
using a policy to remove potentially malicous HTML
|
PLAIN_HTML_CONTENT
Escape plain text for use inside HTML content (rule #1)
|
Modifier and Type | Method and Description |
---|---|
static ProtectionContext |
fromName(String name)
Gets a protection context from the specified name.
|
String |
getName()
Gets the name of the protection context.
|
static ProtectionContext |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ProtectionContext[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ProtectionContext HTML_HTML_CONTENT
public static final ProtectionContext PLAIN_HTML_CONTENT
public static ProtectionContext[] values()
for (ProtectionContext c : ProtectionContext.values()) System.out.println(c);
public static ProtectionContext 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 String getName()
public static ProtectionContext fromName(String name)
name
- The name to get the protection context fromnull
if an invalid protection context
has been specifiedCopyright © 2017 The Apache Software Foundation. All rights reserved.