Package com.yahoo.javacc
Class UnicodeUtilities
- java.lang.Object
-
- com.yahoo.javacc.UnicodeUtilities
-
public class UnicodeUtilities extends java.lang.Object
- Author:
- Simon Thoresen Hult
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
UnicodeUtilities.Predicate
-
Constructor Summary
Constructors Constructor Description UnicodeUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
generateToken(UnicodeUtilities.Predicate predicate)
static java.lang.String
quote(java.lang.String str, char quote)
Adds a leading and trailing double quotation mark to the given string.static java.lang.String
unquote(java.lang.String str)
Removes leading and trailing quotation mark from the given string.
-
-
-
Method Detail
-
quote
public static java.lang.String quote(java.lang.String str, char quote)
Adds a leading and trailing double quotation mark to the given string. This will escape whatever content is within the string literal.- Parameters:
str
- The string to quote.quote
- The quote character.- Returns:
- The quoted string.
-
unquote
public static java.lang.String unquote(java.lang.String str)
Removes leading and trailing quotation mark from the given string. This method will properly unescape whatever content is withing the string literal as well.- Parameters:
str
- The string to unquote.- Returns:
- The unquoted string.
-
generateToken
public static java.lang.String generateToken(UnicodeUtilities.Predicate predicate)
-
-