Class QueryHelper


  • public abstract class QueryHelper
    extends Object
    Provides helper methods for handling a WHERE query.
    Author:
    Gethin James
    • Constructor Detail

      • QueryHelper

        public QueryHelper()
    • Method Detail

      • walk

        public static void walk​(Query query,
                                QueryHelper.WalkerCallback callback)
        Walks a query with a callback for each operation
        Parameters:
        query - the query
        callback - a callback
      • callbackTree

        protected static void callbackTree​(org.antlr.runtime.tree.Tree tree,
                                           QueryHelper.WalkerCallback callback,
                                           boolean negated)
        Processes a tree type and calls the corresponding callback method.
        Parameters:
        tree - Tree
        callback - WalkerCallback
        negated - boolean
      • getChildren

        public static List<org.antlr.runtime.tree.Tree> getChildren​(org.antlr.runtime.tree.Tree tree)
        Gets the children as a List
        Parameters:
        tree - Tree
        Returns:
        either emptyList or the children.
      • stripQuotes

        public static String stripQuotes​(String toBeStripped)
        Strips off any leading or trailing single quotes.
        Parameters:
        toBeStripped - String
        Returns:
        the String that has been stripped