Class ParserBase

  • Direct Known Subclasses:
    Parser

    public class ParserBase
    extends java.lang.Object
    The base class for the parser.
    • Constructor Summary

      Constructors 
      Constructor Description
      ParserBase()
      Creates a new instance of parser for special use cases.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatNonKeywords​(java.util.BitSet nonKeywords)
      Formats a comma-separated list of keywords.
      int getLastParseIndex()
      Returns the last parse index.
      java.lang.Object parseColumnList​(java.lang.String sql, int offset)
      Parses a list of column names or numbers in parentheses.
      static java.util.BitSet parseNonKeywords​(java.lang.String[] nonKeywords)
      Parses the specified collection of non-keywords.
      static java.lang.String quoteIdentifier​(java.lang.String s, int sqlFlags)
      Add double quotes around an identifier if required.
      void setLiteralsChecked​(boolean literalsChecked)  
      void setSuppliedParameters​(java.util.ArrayList<Parameter> suppliedParameters)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ParserBase

        public ParserBase()
        Creates a new instance of parser for special use cases.
    • Method Detail

      • quoteIdentifier

        public static java.lang.String quoteIdentifier​(java.lang.String s,
                                                       int sqlFlags)
        Add double quotes around an identifier if required.
        Parameters:
        s - the identifier
        sqlFlags - formatting flags
        Returns:
        the quoted identifier
      • parseNonKeywords

        public static java.util.BitSet parseNonKeywords​(java.lang.String[] nonKeywords)
        Parses the specified collection of non-keywords.
        Parameters:
        nonKeywords - array of non-keywords in upper case
        Returns:
        bit set of non-keywords, or null
      • formatNonKeywords

        public static java.lang.String formatNonKeywords​(java.util.BitSet nonKeywords)
        Formats a comma-separated list of keywords.
        Parameters:
        nonKeywords - bit set of non-keywords, or null
        Returns:
        comma-separated list of non-keywords
      • setLiteralsChecked

        public final void setLiteralsChecked​(boolean literalsChecked)
      • setSuppliedParameters

        public final void setSuppliedParameters​(java.util.ArrayList<Parameter> suppliedParameters)
      • parseColumnList

        public java.lang.Object parseColumnList​(java.lang.String sql,
                                                int offset)
        Parses a list of column names or numbers in parentheses.
        Parameters:
        sql - the source SQL
        offset - the initial offset
        Returns:
        the array of column names (String[]) or numbers (int[])
        Throws:
        DbException - on syntax error
      • getLastParseIndex

        public final int getLastParseIndex()
        Returns the last parse index.
        Returns:
        the last parse index
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object