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 interface
An interface used when walking a query tree.static class
Default implementation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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 List<org.antlr.runtime.tree.Tree>
getChildren
(org.antlr.runtime.tree.Tree tree) Gets the children as a Liststatic String
stripQuotes
(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
-
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
-