View Javadoc

1   package com.atlassian.plugin.servlet.filter;
2   
3   /**
4    * The dispatching conditions that are taken into account when deciding to match a filter.  These match to the dispatcher
5    * values allowed in the Servlet API version 2.4.
6    *
7    * @since 2.5.0
8    */
9   public enum FilterDispatcherCondition
10  {
11        REQUEST,
12        INCLUDE,
13        FORWARD,
14        ERROR;
15  
16      /**
17       * Determines if a dispatcher value is a valid condition
18       *
19       * @param dispatcher The dispatcher value.  Null allowed.
20       * @return True if valid, false otherwise
21       */
22      public static boolean contains(String dispatcher)
23      {
24          for (FilterDispatcherCondition cond : values())
25          {
26              if (cond.toString().equals(dispatcher))
27              {
28                  return true;
29              }
30          }
31          return false;
32      }
33  }