View Javadoc

1   /**
2    * 2007, Digitalis Informatica. All rights reserved. Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos
3    * num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt
4    */
5   
6   package pt.digitalis.dif.dem;
7   
8   /**
9    * Defines the available callback types.
10   * 
11   * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a><br/>
12   * @created 2007/11/05
13   */
14  public enum CallbackType {
15      /** Callback disabled. */
16      OFF,
17      /** Keeps stage information including parameters passed only for future redirection */
18      SAVE_PARAMETERS,
19      /** Keeps session information so it will be possible to return to the Stage later. */
20      SAVE_SESSION,
21      /** Keeps stage information only for future redirection */
22      SIMPLE;
23  
24      /**
25       * Constructor by name
26       * 
27       * @param name
28       *            the name of the callback
29       * @return the corresponding callback type
30       */
31      static public CallbackType getCallbackTypeByName(String name)
32      {
33          if ("SAVE_SESSION".equalsIgnoreCase(name))
34              return SAVE_SESSION;
35          if ("SIMPLE".equalsIgnoreCase(name))
36              return SIMPLE;
37          if ("SAVE_PARAMETERS".equalsIgnoreCase(name))
38              return SAVE_PARAMETERS;
39          else
40              return OFF;
41      }
42  }