public class Escape
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BACKSLASHESCAPE |
static java.lang.String[][] |
DEFAULTTRANSTABLE |
static java.lang.String |
ENTITYESCAPES |
static java.lang.String |
hexchars |
Constructor and Description |
---|
Escape() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
backslashEscape(java.lang.String s,
java.lang.String wrt)
Escape control chars plus
selected other characters in a string using backslash
The definitive list is in netcdf-c/ncgen/ncgen.l.
|
static java.util.List<java.lang.String> |
backslashsplit(java.lang.String s,
char sep)
Split a string with respect to a separator
character and taking backslashes into consideration.
|
static java.lang.String |
backslashUnescape(java.lang.String s)
Remove backslashed characters in a string
|
static java.lang.String |
bytes2hex(byte[] bytes) |
static java.lang.String |
cleanString(java.lang.String s)
Clean up a string: currently means:
1.
|
static boolean |
entitychar(char c) |
static java.lang.String |
entityEscape(java.lang.String s,
java.lang.String wrt)
Escape selected characters in a string using XML entities
|
static java.lang.String |
entityUnescape(java.lang.String s) |
static java.lang.String |
entityUnescape(java.lang.String s,
java.lang.String[][] translations) |
static int |
fromHex(char c) |
static boolean |
isHexDigit(char c) |
static java.lang.String |
toHex(int i) |
static java.lang.String |
urlDecode(java.lang.String s) |
static java.lang.String |
urlEncodeQuery(java.lang.String s) |
public static final java.lang.String[][] DEFAULTTRANSTABLE
public static final java.lang.String BACKSLASHESCAPE
public static final java.lang.String ENTITYESCAPES
public static final java.lang.String hexchars
public static boolean entitychar(char c)
public static java.lang.String entityEscape(java.lang.String s, java.lang.String wrt)
s
- string to escapewrt
- which chars to escapepublic static java.lang.String entityUnescape(java.lang.String s)
public static java.lang.String entityUnescape(java.lang.String s, java.lang.String[][] translations)
public static java.lang.String backslashEscape(java.lang.String s, java.lang.String wrt)
s
- the string to escapewrt
- what printable characters to escape;
control characters and '\\' are always escaped.public static java.lang.String backslashUnescape(java.lang.String s)
public static java.util.List<java.lang.String> backslashsplit(java.lang.String s, char sep)
s
- The string to splitsep
- The character on which to splitpublic static java.lang.String toHex(int i)
public static int fromHex(char c)
public static boolean isHexDigit(char c)
public static java.lang.String bytes2hex(byte[] bytes)
public static java.lang.String urlDecode(java.lang.String s)
public static java.lang.String urlEncodeQuery(java.lang.String s)
public static java.lang.String cleanString(java.lang.String s)
s
- string to clean