View Javadoc

1   /*
2    * EL4J, the Extension Library for the J2EE, adds incremental enhancements to
3    * the spring framework, http://el4j.sf.net
4    * Copyright (C) 2009 by ELCA Informatique SA, Av. de la Harpe 22-24,
5    * 1000 Lausanne, Switzerland, http://www.elca.ch
6    *
7    * EL4J is published under the GNU Lesser General Public License (LGPL)
8    * Version 2.1. See http://www.gnu.org/licenses/
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU Lesser General Public License for more details.
14   *
15   * For alternative licensing, please contact info@elca.ch
16   */
17  package ch.elca.el4j.util.codelist;
18  
19  import java.util.Locale;
20  
21  import ch.elca.el4j.util.codingsupport.SerializableEnum;
22  
23  /**
24   * Interface to be implemented by java enums which represent codelists.
25   *
26   * This interface is inspired by a concept for a central maintenance and management
27   * of codelists. These are deployed to software components for pure offline use.
28   * According to the concept, the enums implementing this interface are generated
29   * by a java code generator.
30   * 
31   * For a convenient implementation of the described functionality use the 
32   * CodelistUtility class in this package. Since the extensibility of enum types 
33   * is not supported by the language construct, the functional implementation is 
34   * provided in the CodelistUtility class.
35   *
36   * @svnLink $Revision: 4103 $;$Date: 2010-01-21 11:11:14 +0100 (Do, 21. Jan 2010) $;$Author: jonasha $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/core/src/main/java/ch/elca/el4j/util/codelist/Codelist.java $
37   *
38   * @author Jonas Hauenstein (JHN)
39   */
40  
41  public interface Codelist extends SerializableEnum<String> {
42  	
43  	/**
44  	 * Getter for the globally unique ID of the code.
45  	 *
46  	 * This ID should be uniquely defined over all codes in all available codelists.
47  	 *
48  	 * @return The unique ID of the code
49  	 */
50  	public int getID();
51  	
52  	/**
53  	 * Getter for the intCode of the code.
54  	 *
55  	 * This is defined to be a number representing the code inside the codelist. 
56  	 *
57  	 * @return The intCode of the code
58  	 */
59  	public int getIntCode();
60  		
61  	/**
62  	 * Getter for the short textual description of the code in a given language.
63  	 *
64  	 * @param lang Java Locale of the desired language for the returned text
65  	 * @return The short textual description of the code
66  	 */
67  	public String getShortText(Locale lang);
68  	
69  	/**
70  	 * Getter for the long textual description of the code in a given language.
71  	 *
72  	 * @param lang Java Locale of the desired language for the returned text
73  	 * @return The short textual description of the code
74  	 */
75  	public String getLongText(Locale lang);
76  
77  }