View Javadoc

1   package ch.qos.cal10n.verifier;
2   
3   import java.util.List;
4   import java.util.Locale;
5   
6   /**
7    * An interface for verifying that given an enum type, the keys match those
8    * found in the corresponding resource bundles.
9    * 
10   * <p>
11   * See also {@link MessageKeyVerifier} for a concrete implementation.
12   * 
13   * @author Ceki G&uuml;lc&uuml;
14   * 
15   */
16  public interface IMessageKeyVerifier {
17  
18    // WARNING: The name of this class is referenced in String form
19    // to do class loader tricks. Do not change the name of this class
20    // without looking at the maven-plugin.
21  
22    /**
23     * Get the of enum type that this verifier is related to to.
24     * 
25     * @return
26     */
27    public Class<? extends Enum<?>> getEnumType();
28  
29    /**
30     * Get the name of enum type to this verifier is related to to.
31     * 
32     * @return
33     */
34    public String getEnumTypeAsStr();
35  
36    /**
37     * Verify that the keys defined in the enumClass match those found in the
38     * resource bundle corresponding to a certain locale
39     * 
40     * @param locale
41     * @return
42     */
43    public List<Cal10nError> verify(Locale locale);
44  
45    /**
46     * Verify that the keys defined in the enumClass match those found in the
47     * corresponding resource bundle for all locales declared in the enum type
48     * via the {@link @LocaleNames} annotation.
49     * 
50     * @param locale
51     * @return
52     */
53    public List<Cal10nError> verifyAllLocales();
54  
55    /**
56     * Same as {@link #verify(Locale)} except that the return type is
57     * List<String>.
58     * 
59     * @param locale
60     * @return
61     */
62    public List<String> typeIsolatedVerify(Locale locale);
63  
64    /**
65     * Get the locales specified in the enumType (via annotations)
66     * 
67     * @return
68     */
69    public String[] getLocaleNames();
70  
71    /**
72     * Get the name of the resource bundle specified in the enumType (via
73     * annotations)
74     * 
75     * @return
76     */
77    public String getResourceBundleName();
78  }