|
Yes, of course. That method was removed, sorry. The only way to
check if a requirement has a specific namespace is to write an IU
that satisfies all requirements with that namespace, regardless of
name and version. You should be able to write something like: IInstallableUnit myPackageMatchingIU = new InstallableUnit() { @Override public boolean satisfies(IRequirement r) { return r instanceof RequiredCapability && "java.package".equals(((RequiredCapability)r).getNamespace()); } }; and then use that UI in the query like this: QueryUtil.createQuery("select(x | x.requirements.exists(r | $0 ~= r && exists(y | y ~= r)))", myPackageMatchingIU) Looking at your example, I think I misinterpreted your question. I thought of a "known installable unit" as "some unit in a known queried set". I guess you already have an explicitly known unit. In that case, the query should be written: QueryUtil.createMatchQuery("requirements.exists(r | $0 ~= r && $1 ~= r))", myPackageMatchingIU, myKnownIU) Dropping the need for the specific "java.package" requirement makes it even simpler. Now you don't need the special IU. Just write: QueryUtil.createMatchQuery("requirements.exists(r | $1 ~= r)", myKnownIU) HTH, Thomas Hallgren On 2011-02-01 14:27, Thomas Hallgren wrote:
|
_______________________________________________ p2-dev mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/p2-dev
