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.objects.messages;
7   
8   /**
9    * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a>
10   * @created Nov 15, 2007
11   */
12  public enum MessagesLocation {
13  
14      /** Searches for messages in the same path of the entity class. */
15      CLASS_LOCATION,
16      /** Searches for messages in the default /messages/** folder. */
17      MESSAGES_FOLDER;
18  
19      /**
20       * Returns the message location of a given name.
21       * 
22       * @param name
23       *            selected method name
24       * @return the Message location for the given name
25       */
26      static public MessagesLocation getMessageLocationByName(String name)
27      {
28          if (name.equalsIgnoreCase(CLASS_LOCATION.toString()))
29              return CLASS_LOCATION;
30  
31          return MESSAGES_FOLDER;
32      }
33  }