public
static
class
UrlQuerySanitizer.IllegalCharacterValueSanitizer
extends Object
implements
UrlQuerySanitizer.ValueSanitizer
java.lang.Object | |
↳ | android.net.UrlQuerySanitizer.IllegalCharacterValueSanitizer |
Sanitize values based on which characters they contain. Illegal characters are replaced with either space or '_', depending upon whether space is a legal character or not.
Constants | |
---|---|
int |
ALL_BUT_NUL_AND_ANGLE_BRACKETS_LEGAL
|
int |
ALL_BUT_NUL_LEGAL
|
int |
ALL_BUT_WHITESPACE_LEGAL
|
int |
ALL_ILLEGAL
|
int |
ALL_OK
Mask with all fields set to OK |
int |
ALL_WHITESPACE_OK
Mask with both regular space and other whitespace OK |
int |
AMP_AND_SPACE_LEGAL
|
int |
AMP_LEGAL
|
int |
AMP_OK
Allow ampersand characters ('&') |
int |
DQUOTE_OK
Allow double quote characters. |
int |
GT_OK
Allow greater-than characters. |
int |
LT_OK
Allow less-than characters. |
int |
NON_7_BIT_ASCII_OK
Allow characters with character codes 128 to 255. |
int |
NUL_OK
Allow nul characters ('\0') |
int |
OTHER_WHITESPACE_OK
Allow whitespace characters other than space. |
int |
PCT_OK
Allow percent-sign characters ('%') |
int |
SCRIPT_URL_OK
Allow text to start with a script URL such as "javascript:" or "vbscript:" |
int |
SPACE_LEGAL
|
int |
SPACE_OK
Allow space (' ') characters. |
int |
SQUOTE_OK
Allow single quote characters. |
int |
URL_AND_SPACE_LEGAL
|
int |
URL_LEGAL
|
Public constructors | |
---|---|
UrlQuerySanitizer.IllegalCharacterValueSanitizer(int flags)
Construct a sanitizer. |
Public methods | |
---|---|
String
|
sanitize(String value)
Sanitize a value. |
Inherited methods | |
---|---|
From
class
java.lang.Object
| |
From
interface
android.net.UrlQuerySanitizer.ValueSanitizer
|
int ALL_BUT_NUL_AND_ANGLE_BRACKETS_LEGAL
Constant Value: 1439 (0x0000059f)
int ALL_BUT_NUL_LEGAL
Constant Value: 1535 (0x000005ff)
int ALL_BUT_WHITESPACE_LEGAL
Constant Value: 1532 (0x000005fc)
int ALL_ILLEGAL
Constant Value: 0 (0x00000000)
int ALL_OK
Mask with all fields set to OK
Constant Value: 2047 (0x000007ff)
int ALL_WHITESPACE_OK
Mask with both regular space and other whitespace OK
Constant Value: 3 (0x00000003)
int AMP_AND_SPACE_LEGAL
Constant Value: 129 (0x00000081)
int AMP_LEGAL
Constant Value: 128 (0x00000080)
int AMP_OK
Allow ampersand characters ('&')
Constant Value: 128 (0x00000080)
int DQUOTE_OK
Allow double quote characters. ('"')
Constant Value: 8 (0x00000008)
int GT_OK
Allow greater-than characters. ('>')
Constant Value: 64 (0x00000040)
int LT_OK
Allow less-than characters. ('<')
Constant Value: 32 (0x00000020)
int NON_7_BIT_ASCII_OK
Allow characters with character codes 128 to 255.
Constant Value: 4 (0x00000004)
int OTHER_WHITESPACE_OK
Allow whitespace characters other than space. The other whitespace characters are '\t' '\f' '\n' '\r' and '\0x000b' (vertical tab)
Constant Value: 2 (0x00000002)
int PCT_OK
Allow percent-sign characters ('%')
Constant Value: 256 (0x00000100)
int SCRIPT_URL_OK
Allow text to start with a script URL such as "javascript:" or "vbscript:"
Constant Value: 1024 (0x00000400)
int SPACE_LEGAL
Constant Value: 1 (0x00000001)
int SPACE_OK
Allow space (' ') characters.
Constant Value: 1 (0x00000001)
int SQUOTE_OK
Allow single quote characters. ('\'')
Constant Value: 16 (0x00000010)
int URL_AND_SPACE_LEGAL
Constant Value: 405 (0x00000195)
int URL_LEGAL
Constant Value: 404 (0x00000194)
UrlQuerySanitizer.IllegalCharacterValueSanitizer (int flags)
Construct a sanitizer. The parameters set the behavior of the sanitizer.
Parameters | |
---|---|
flags |
int :
some combination of the XXX_OK flags.
|
String sanitize (String value)
Sanitize a value.
Returns | |
---|---|
String |
the sanitized value |