| Modifier and Type | Class and Description |
|---|---|
static class |
MySQLCodec.Mode
Specifies the SQL Mode the target MySQL Server is running with.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
ANSI_MODE
Target MySQL Server is running in "http://dev.mysql.com/doc/refman/5.0/en/ansi-mode.html" ANSI Mode
|
private MySQLCodec.Mode |
mode |
static int |
MYSQL_MODE
Target MySQL Server is running in Standard MySQL (Default) mode.
|
| Constructor and Description |
|---|
MySQLCodec(int mode)
Deprecated.
|
MySQLCodec(MySQLCodec.Mode mode)
Instantiate the MySQL Codec with the given SQL
MySQLCodec.Mode. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Character |
decodeCharacter(PushbackString input)
Returns the decoded version of the next character from the input string and advances the
current character in the PushbackString.
|
private java.lang.Character |
decodeCharacterANSI(PushbackString input)
decodeCharacterANSI decodes the next character from ANSI SQL escaping
|
private java.lang.Character |
decodeCharacterMySQL(PushbackString input)
decodeCharacterMySQL decodes all the potential escaped characters that MySQL is prepared to escape
|
java.lang.String |
encodeCharacter(char[] immune,
java.lang.Character c)
Default implementation that should be overridden in specific codecs.
|
private java.lang.String |
encodeCharacterANSI(java.lang.Character c)
encodeCharacterANSI encodes for ANSI SQL.
|
private java.lang.String |
encodeCharacterMySQL(java.lang.Character c)
Encode a character suitable for MySQL
|
containsCharacter, decode, encode, getHexForNonAlphanumeric, toHex, toOctalpublic static final int MYSQL_MODE
public static final int ANSI_MODE
private MySQLCodec.Mode mode
public MySQLCodec(int mode)
mode - Mode has to be one of {MYSQL_MODE|ANSI_MODE} to allow correct encodingMySQLCodec(org.owasp.esapi.codecs.MySQLCodec.Mode)public MySQLCodec(MySQLCodec.Mode mode)
MySQLCodec.Mode.mode - The mode the target server is running inpublic java.lang.String encodeCharacter(char[] immune,
java.lang.Character c)
encodeCharacter in class Codecimmune - c - the Character to encodeprivate java.lang.String encodeCharacterANSI(java.lang.Character c)
c - character to encodeprivate java.lang.String encodeCharacterMySQL(java.lang.Character c)
c - Character to encodepublic java.lang.Character decodeCharacter(PushbackString input)
decodeCharacter in class Codecinput - the Character to decodeprivate java.lang.Character decodeCharacterANSI(PushbackString input)
input - A PushBackString containing characters you'd like decodedprivate java.lang.Character decodeCharacterMySQL(PushbackString input)
input - A string you'd like to be decoded