|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.context.query.QueryBuilder
public class QueryBuilder
A QueryBuilder allows for modular assembly of context graph queries.
Query assembly is performed by chaining a sequence of graph traversal and filtering operations together in order to select a particular set of the input node set's descendants.
| Method Summary | |
|---|---|
Query |
build()
Returns a query that represents the currently assembled transformation. |
QueryBuilder |
chain(Query query)
Applies the given query on the currently selected node set. |
QueryBuilder |
children()
Selects the union of the current node sets child nodes. |
QueryBuilder |
descendants()
Selects the merged descendant set of the current node set. |
QueryBuilder |
empty()
Selects an empty node set. |
QueryBuilder |
ensureUnique()
Asserts that the current node set is a singleton. |
QueryBuilder |
filter(Matcher<? super TreeNode> filter)
Filters the current node set using the supplied Matcher. |
QueryBuilder |
parent()
Selects the parent of the current node. |
static QueryBuilder |
queryBuilder()
Creates a new query builder instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static QueryBuilder queryBuilder()
A newly constructed query builder represents the identity query. It simply returns the input node set as the output node set.
public QueryBuilder filter(Matcher<? super TreeNode> filter)
Matcher.
Nodes in the current node set that are not selected by the supplied matcher are removed.
filter - matcher to apply
public QueryBuilder children()
public QueryBuilder parent()
public QueryBuilder descendants()
More precisely this recursively merges the children of each member of the node-set in to the output node set until the set ceases to grow.
public QueryBuilder chain(Query query)
query - query to apply
public QueryBuilder ensureUnique()
If the current node set is not of size 1 then the query will terminate with
an IllegalStateException.
public QueryBuilder empty()
public Query build()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||