/**
  * @param patternMatcher matches a set of elements
  * @param extension the extension to match
  * @return true if one of the element is matched
  */
 public static boolean matches(Pattern patternMatcher, Extension extension) {
   return matches(
       patternMatcher,
       extension.getId().getId(),
       extension.getDescription(),
       extension.getSummary(),
       extension.getName(),
       extension.getFeatures());
 }
Пример #2
0
  /**
   * Matches an extension in a case insensitive way.
   *
   * @param patternMatcher the pattern to match
   * @param filters the filters
   * @param extension the extension to match
   * @return true if one of the element is matched
   * @since 7.0M2
   */
  public static boolean matches(
      Pattern patternMatcher, Collection<Filter> filters, Extension extension) {
    if (matches(
        patternMatcher,
        extension.getId().getId(),
        extension.getDescription(),
        extension.getSummary(),
        extension.getName(),
        extension.getFeatures())) {
      for (Filter filter : filters) {
        if (!matches(filter, extension)) {
          return false;
        }
      }

      return true;
    }

    return false;
  }