Class QueryHelper
java.lang.Object
org.alfresco.rest.framework.resource.parameters.where.QueryHelper
Provides helper methods for handling a WHERE query.
- Author:
- Gethin James
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classQueryHelper.QueryResolver<S extends QueryHelper.QueryResolver<?>>Helper class allowing WHERE query resolving using query walker.static interfaceAn interface used when walking a query tree.static classDefault implementation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidcallbackTree(org.antlr.runtime.tree.Tree tree, QueryHelper.WalkerCallback callback, boolean negated) Processes a tree type and calls the corresponding callback method.static List<org.antlr.runtime.tree.Tree>getChildren(org.antlr.runtime.tree.Tree tree) Gets the children as a Liststatic StringstripQuotes(String toBeStripped) Strips off any leading or trailing single quotes.static voidwalk(Query query, QueryHelper.WalkerCallback callback) Walks a query with a callback for each operation
-
Constructor Details
-
QueryHelper
public QueryHelper()
-
-
Method Details
-
walk
Walks a query with a callback for each operation- Parameters:
query- the querycallback- 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- Treecallback- WalkerCallbacknegated- boolean
-
getChildren
Gets the children as a List- Parameters:
tree- Tree- Returns:
- either emptyList or the children.
-
stripQuotes
Strips off any leading or trailing single quotes.- Parameters:
toBeStripped- String- Returns:
- the String that has been stripped
-
resolve
-