public final class Encoders extends Object
All encoders returned by the factory are thread-safe.
Modifier and Type | Field and Description |
---|---|
static String |
CDATA
Name of CDATA context.
|
static String |
CSS_STRING
Name of CSS string context.
|
static String |
CSS_URL
Name of CSS URL context.
|
static String |
HTML
Name of HTML general context.
|
static String |
HTML_ATTRIBUTE
Name of HTML attribute
context.
|
static String |
HTML_CONTENT
Name of HTML content context.
|
static String |
HTML_UNQUOTED_ATTRIBUTE
Name of
unquoted HTML attribute
context.
|
static String |
JAVA
Name of Java String context.
|
static String |
JAVASCRIPT
Name of JavaScript general
context.
|
static String |
JAVASCRIPT_ATTRIBUTE
Name of
JavaScript attribute
context.
|
static String |
JAVASCRIPT_BLOCK
Name of JavaScript block
context.
|
static String |
JAVASCRIPT_SOURCE
Name of JavaScript source
context.
|
static String |
URI
Name of URI context.
|
static String |
URI_COMPONENT
Name of URI component
context.
|
static String |
XML
Name of XML general context.
|
static String |
XML_ATTRIBUTE
Name of XML attribute
context.
|
static String |
XML_COMMENT
Name of XML comment context.
|
static String |
XML_CONTENT
Name of XML content context.
|
Modifier and Type | Method and Description |
---|---|
static Encoder |
forName(String contextName)
Returns a new instance of an Encoder for the specified context.
|
public static final String HTML
public static final String HTML_CONTENT
public static final String HTML_ATTRIBUTE
public static final String HTML_UNQUOTED_ATTRIBUTE
public static final String XML
public static final String XML_CONTENT
public static final String XML_ATTRIBUTE
public static final String XML_COMMENT
public static final String CDATA
public static final String CSS_STRING
public static final String CSS_URL
public static final String JAVA
public static final String JAVASCRIPT
public static final String JAVASCRIPT_ATTRIBUTE
public static final String JAVASCRIPT_BLOCK
public static final String JAVASCRIPT_SOURCE
public static final String URI
public static final String URI_COMPONENT
public static Encoder forName(String contextName) throws NullPointerException, UnsupportedContextException
contextName
- the context name (one of the String constants defined
in this class)NullPointerException
- if contextName
is nullUnsupportedContextException
- if contextName
is not
recognized.Copyright © 2011–2020 OWASP (Open Web-Application Security Project). All rights reserved.