KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > api > cintoo > messages > bundle > ResourceBundleFactory


1 package api.cintoo.messages.bundle;
2
3 import java.io.InputStream JavaDoc;
4 import java.io.IOException JavaDoc;
5 import java.util.List JavaDoc;
6 import java.util.Locale JavaDoc;
7
8 /**
9  * Factory to crate BaseBundles of a certain kind.
10  *
11  * @author Stephan J. Schmidt
12  * @version $id$
13  * @since 1.0
14  */

15 public interface ResourceBundleFactory {
16   /**
17    * Load a bundle from an input stream.
18    *
19    * @param input Input stream to load bundle from
20    * @param locale Locale for that bundle, bundle
21    * should set the locale as it's own
22    * @return bundle which has been loaded
23    */

24   public BaseBundle loadBundle(InputStream JavaDoc input, Locale JavaDoc locale) throws IOException JavaDoc;
25
26   /**
27    * Expand a base name to file names.
28    * For example "base" and the locale "de_DE" could
29    * be expanded by a factory for xml bundles to
30    * base.xml, base_de.xml and base_de_DE.xml
31    *
32    * @param name base name to use for expansion
33    * @param locale locale to use for name expansion
34    * @return list of names which were expanded from the base name
35    */

36   public List JavaDoc<String JavaDoc> expand(String JavaDoc name, Locale JavaDoc locale);
37 }
38
Popular Tags