[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[p2-dev] Updated Query API

The effort to decouple the collector from the query has started.  The patch in 260012 [1] has been released, and if you create your own queries, you may have to updated your code. 

In particular, you now have to decide if your query is a Match query or not.  A match query means that you wrote your query by implementing the IsMatch() method (perform is final).  In a Match query, each element can be evaluated independently of one another.  Extend MatchQuery if this is the case.  If you override perform(), then you should now extend ContextQuery.  Get LatestIU is an example of a context query (you need the context of all the elements to make a decision as to which one is the greatest).

The patch also does two more things:
1. Makes Collectors queryable (you can call query on the collector)
2. Introduces CompositeQuery.  A composite query takes a number of sub-queries, and calls each one in succession, passing the results of one query as input to the next.

For example, getIU(name=EMF) --> getLatestIU.  This will get the latest EMF IU.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=260012


R. Ian Bull, PhD
Software Developer, EclipseSource