* Creates an endpoint filter for an association. If there is a KEY_ASSOCIATION_VERSIONSTATEMENT, a filter
* will be created that matches exactly the given range.
*/
if ((properties != null) && properties.containsKey(KEY_ASSOCIATION_VERSIONSTATEMENT)) {
String versions = properties.get(KEY_ASSOCIATION_VERSIONSTATEMENT);
VersionRange versionRange = null;
try {
versionRange = VersionRange.parse(versions);
}
catch (IllegalArgumentException iae) {
throw new IllegalArgumentException("version " + ((versions != null) ? versions + " " : "(null) ") + "cannot be parsed into a valid version range statement.");
}
StringBuilder bundleStatement = new StringBuilder("(&(" + KEY_SYMBOLICNAME + "=" + RepositoryUtil.escapeFilterValue(obj.getAttribute(KEY_SYMBOLICNAME)) + ")");
bundleStatement.append("(" + KEY_VERSION + ">=" + versionRange.getLow() + ")");
if (!versionRange.isLowInclusive()) {
bundleStatement.append("(!(" + KEY_VERSION + "=" + versionRange.getLow() + "))");
}
if (versionRange.getHigh() != null) {
bundleStatement.append("(" + KEY_VERSION + "<=" + versionRange.getHigh() + ")");
if (!versionRange.isHighInclusive()) {
bundleStatement.append("(!(" + KEY_VERSION + "=" + versionRange.getHigh() + "))");
}
}
bundleStatement.append(")");