KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > magnolia > cms > i18n > Messages


1 /**
2  *
3  * Magnolia and its source-code is licensed under the LGPL.
4  * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5  * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6  * you are required to provide proper attribution to obinary.
7  * If you reproduce or distribute the document without making any substantive modifications to its content,
8  * please use the following attribution line:
9  *
10  * Copyright 1993-2005 obinary Ltd. (http://www.obinary.com) All rights reserved.
11  *
12  */

13 package info.magnolia.cms.i18n;
14
15 import java.util.Iterator JavaDoc;
16 import java.util.Locale JavaDoc;
17
18
19 /**
20  * @author Philipp Bracher
21  * @version $Revision: 6341 $ ($Author: philipp $)
22  */

23 public interface Messages {
24
25     /**
26      * @return current locale
27      */

28     public Locale JavaDoc getLocale();
29
30     /**
31      * If no basename is provided this method returns DEFAULT_BASENAME
32      * @return current basename
33      */

34     public String JavaDoc getBasename();
35
36     /**
37      * Get the message from the bundle
38      * @param key the key
39      * @return message
40      */

41     public String JavaDoc get(String JavaDoc key);
42
43     /**
44      * Replace the parameters in the string: the entered text {0} is not a valid email
45      * @param key the key
46      * @param args the replacement strings
47      * @return message
48      */

49     public String JavaDoc get(String JavaDoc key, Object JavaDoc[] args);
50
51     /**
52      * You can provide a default value if the key is not found
53      * @param key key
54      * @param defaultMsg the default message
55      * @return the message
56      */

57     public String JavaDoc getWithDefault(String JavaDoc key, String JavaDoc defaultMsg);
58
59     /**
60      * With default value and replacement strings
61      * @param key key
62      * @param args replacement strings
63      * @param defaultMsg default message
64      * @return message
65      */

66     public String JavaDoc getWithDefault(String JavaDoc key, Object JavaDoc[] args, String JavaDoc defaultMsg);
67
68     /**
69      * Iterate over the keys
70      * @return iterator
71      */

72     public Iterator JavaDoc keys();
73
74     /**
75      * Reload the messages
76      * @throws Exception
77      */

78     public void reload() throws Exception JavaDoc;
79
80 }
Popular Tags