View Javadoc
1   package com.atlassian.plugin.spring.scanner;
2   
3   /**
4    * An enum representing the products that we can filter beans by.
5    * This enum is used not only within this library, but may also be used by
6    * any other library/plugin that needs a list of products to filter by.
7    *
8    * Example: Atlassian Connect uses this enum to filter out product-specific
9    * connect modules. Moral of the story: Don't remove this.
10   */
11  public enum ProductFilter {
12      ALL, JIRA, CONFLUENCE, BAMBOO, BITBUCKET, STASH, CROWD, FECRU, REFAPP;
13  
14      public static boolean hasProduct(String productName) {
15          try {
16              ProductFilter filter = valueOf(productName);
17              return (null != filter);
18          } catch (IllegalArgumentException e) {
19              return false;
20          }
21      }
22  
23      public String getPerProductFile(final String fileStem) {
24          return fileStem + "-" + name().toLowerCase();
25      }
26  }