public class EscapeStrings
extends java.lang.Object
Constructor and Description |
---|
EscapeStrings() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escapeString(java.lang.String in,
char[] allowable,
char esc)
Replace all characters in the String
in not present in the String allowable with
their hexidecimal values (encoded as ASCII) and preceeded by the String esc
The |
static java.lang.String |
id2www_ce(java.lang.String in)
Replace characters that are not allowed in WWW URLs using rules specific
to Constraint Expressions.
|
static java.lang.String |
id2www(java.lang.String in)
Replace characters that are not allowed in DAP2 identifiers.
|
static void |
main(java.lang.String[] args) |
static java.lang.String |
normalizeToXML(java.lang.String s)
This method is used to normalize strings prior
to their inclusion in XML documents.
|
static java.lang.String |
unescapeString(java.lang.String in,
char escape,
java.lang.String except)
Given a string that contains WWW escape sequences, translate those escape
sequences back into ASCII characters.
|
static java.lang.String |
www2ce(java.lang.String in)
Given a string that contains WWW escape sequences, translate those escape
sequences back into ASCII characters, with the exception of the escaped
space (0x20) character which appears as "%20".
|
static java.lang.String |
www2id(java.lang.String in)
Given a string that contains WWW escape sequences, translate those escape
sequences back into ASCII characters.
|
public static java.lang.String normalizeToXML(java.lang.String s)
s
- The String to be normalized.public static java.lang.String id2www_ce(java.lang.String in)
in
- The string in which to replace characters.public static java.lang.String escapeString(java.lang.String in, char[] allowable, char esc) throws java.lang.Exception
in
not present in the String allowable
with
their hexidecimal values (encoded as ASCII) and preceeded by the String esc
The in
- The string in which to replace characters.allowable
- The set of allowable characters.esc
- The escape String (typically "%" for a URI or "\" for a regular expression).java.lang.Exception
public static java.lang.String id2www(java.lang.String in)
in
- The string in which to replace characters.public static java.lang.String unescapeString(java.lang.String in, char escape, java.lang.String except)
in
- The string to modify.escape
- The character used to signal the begining of an escape sequence.except
- If there is some escape code that should not be removed by
this call (e.g., you might not want to remove spaces, %20) use this
parameter to specify that code. The function will then transform all
escapes except that one.public static java.lang.String www2id(java.lang.String in)
in
- The string to modify.public static java.lang.String www2ce(java.lang.String in)
in
- The string to modify.public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception