Class Parser


  • public class Parser
    extends Object
    Static utilities for use in SQL parsing.
    Author:
    AO Industries, Inc.
    • Method Detail

      • indexOfNotQuoted

        public static int indexOfNotQuoted​(String expr,
                                           char ch,
                                           int fromIndex)
        Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section.
      • indexOfNotQuoted

        public static int indexOfNotQuoted​(String expr,
                                           char ch)
        Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section.
      • indexOfNotQuoted

        public static int indexOfNotQuoted​(String expr,
                                           String str,
                                           int fromIndex)
        Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section.
      • indexOfNotQuoted

        public static int indexOfNotQuoted​(String expr,
                                           String str)
        Find a match only outside quoted section of the expressions. Quoted by ", with "" being the escape for a " within the quoted section.
      • unquote

        public static String unquote​(String str)
        Unquotes a string, removing " characters, except "" being the escape for a " within a quoted section.
      • quote

        public static String quote​(String str)
        Quotes a string if needed. Currently this only when is empty, contains " or . or a character outside normal ASCII range. Unicode is not considered for use without quoting, since this is only used to quote AOServ table/column names, which are all ASCII.