Class QueryHelper


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

      Constructors 
      Constructor Description
      QueryHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      static java.util.List<org.antlr.runtime.tree.Tree> getChildren​(org.antlr.runtime.tree.Tree tree)
      Gets the children as a List
      static java.lang.String stripQuotes​(java.lang.String toBeStripped)
      Strips off any leading or trailing single quotes.
      static void walk​(Query query, QueryHelper.WalkerCallback callback)
      Walks a query with a callback for each operation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 java.util.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 java.lang.String stripQuotes​(java.lang.String toBeStripped)
        Strips off any leading or trailing single quotes.
        Parameters:
        toBeStripped - String
        Returns:
        the String that has been stripped