Class QueryHelper
- java.lang.Object
-
- org.alfresco.rest.framework.resource.parameters.where.QueryHelper
-
public abstract class QueryHelper extends java.lang.Object
Provides helper methods for handling a WHERE query.- Author:
- Gethin James
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
QueryHelper.WalkerCallback
An interface used when walking a query tree.static class
QueryHelper.WalkerCallbackAdapter
Default implementation.
-
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 Liststatic 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
-
-
-
Method Detail
-
walk
public static void walk(Query query, QueryHelper.WalkerCallback callback)
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
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
-
-