Resource Query Language or RQL is a query language which provides a nice way of querying a data store, SQL database etc. via a URI. For more details on RQL see this Sitepen blog article by Kris Zyp and the Dojo Foundation's Persevere RQL repository on Github. The short of it is that you can write queries in URI's like this:
UsageThe parser generates an ASTNode object representing the root node of an Abstract Syntax Tree (AST). Create a class that implements ASTVisitor in order to traverse the tree.
RQLParser parser = new RQLParser(); MyVisitor visitor = new MyVisitor(); ASTNode node = parser.parse("(name=jack|name=jill)&age>30"); Object result = node.accept(visitor);
ExamplesSee the ListFilter class, which is an ASTVisitor which filters a list of bean objects.
Get it from Maven
<dependency> <groupId>net.jazdw</groupId> <artifactId>rql-parser</artifactId> <version>0.3.1</version> </dependency>