Class LangUtil

java.lang.Object
com.twineworks.tweakflow.util.LangUtil

public class LangUtil extends Object
  • Constructor Details

    • LangUtil

      public LangUtil()
  • Method Details

    • escapeString

      public static String escapeString(String s)
    • getStringLiteral

      public static String getStringLiteral(String s)
    • escapeSingleQuotedString

      public static String escapeSingleQuotedString(String s)
    • getSingleQuotedStringLiteral

      public static String getSingleQuotedStringLiteral(String s)
    • bytesToHex

      public static String bytesToHex(byte[] bytes)
    • escapeIdentifier

      public static String escapeIdentifier(String id)
    • escapeTimeZoneIdentifier

      public static String escapeTimeZoneIdentifier(String id)
    • getKeyLiteral

      public static String getKeyLiteral(String id)
    • isPossiblyDateTime

      public static boolean isPossiblyDateTime(String str)
      Returns whether the given string has a chance to parse correctly using toDateTime()
      Parameters:
      str -
      Returns:
    • toDateTime

      public static DateTimeValue toDateTime(String str, SourceInfo sourceInfo)
      Converts a string conforming to language rules to a datetime value. Suitable to parse a string as provided by the lexer.
      Parameters:
      str - the string to convert to a datetime
      sourceInfo - location of source in case we're parsing sourcecode
      Returns: