public abstract class Codec extends Object
Encoder
Constructor and Description |
---|
Codec()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
static boolean |
containsCharacter(char c,
char[] array)
Utility to search a char[] for a specific char.
|
String |
decode(String input)
Decode a String that was encoded using the encode method in this Class
|
Character |
decodeCharacter(PushbackString input)
Returns the decoded version of the next character from the input string and advances the
current character in the PushbackString.
|
String |
encode(char[] immune,
String input)
Encode a String so that it can be safely used in a specific context.
|
String |
encodeCharacter(char[] immune,
Character c)
Default implementation that should be overridden in specific codecs.
|
static String |
getHexForNonAlphanumeric(char c)
Lookup the hex value of any character that is not alphanumeric.
|
static String |
toHex(char c) |
static String |
toOctal(char c) |
public String encode(char[] immune, String input)
immune
- input
- the String to encodepublic String encodeCharacter(char[] immune, Character c)
immune
- c
- the Character to encodepublic String decode(String input)
input
- the String to decodepublic Character decodeCharacter(PushbackString input)
input
- the Character to decodepublic static String getHexForNonAlphanumeric(char c)
c
- The character to lookup.public static String toOctal(char c)
public static String toHex(char c)
public static boolean containsCharacter(char c, char[] array)
c
- array
- Copyright © 2015 The Open Web Application Security Project (OWASP). All rights reserved.