Class Literal
java.lang.Object
org.exoplatform.web.controller.regexp.Literal
- Author:
- Julien Viet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidescapeTo(char value, Appendable appendable) getEscape(char value) Return the char value as a string literal in a regexp.static booleanisEscaped(char c) Return true if the char should be escaped.
-
Constructor Details
-
Literal
public Literal()
-
-
Method Details
-
isEscaped
public static boolean isEscaped(char c) Return true if the char should be escaped. Note that the implementation sometime may escape the char although the context in which it is used would not require its escape.- Parameters:
c- the char to test- Returns:
- true when the char should be escaped.
-
getEscape
Return the char value as a string literal in a regexp. Note that the implementation does not tries to optimize the value with respect to the AST context, (for instance (?) would be fine as (?) but it will rewritten as (\?).- Parameters:
value- the value- Returns:
- the escaped string
-
escapeTo
public static void escapeTo(char value, Appendable appendable) throws IOException, NullPointerException - Throws:
IOExceptionNullPointerException
-