Class Literal

java.lang.Object
org.exoplatform.web.controller.regexp.Literal

public class Literal extends Object
Author:
Julien Viet
  • 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

      public String getEscape(char value)
      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:
      IOException
      NullPointerException