KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > i18n > Bundle


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.excalibur.i18n;
9
10 import java.util.Map JavaDoc;
11 import java.util.Locale JavaDoc;
12
13 /**
14  * This is the interface of the ResourceBundle, for used for i18n support.
15  *
16  * @author <a HREF="mailto:neeme@apache.org">Neeme Praks</a>
17  * @version CVS $Revision: 1.6 $ $Date: 2002/01/02 19:04:56 $ $Author: neeme $
18  */

19 public interface Bundle {
20
21     String JavaDoc ROLE = "org.apache.avalon.excalibur.i18n.Bundle";
22
23     /**
24      * Get the bundle info.
25      */

26     BundleInfo getBundleInfo();
27
28     /**
29      * Set the bundle info.
30      */

31     void setBundleInfo(BundleInfo bundleInfo);
32
33     /**
34      * Set the bundle info mapper.
35      */

36     void setMapper(BundleInfoMapper mapper);
37
38     /**
39      * Get the parent bundle of the current bundle.
40      *
41      * @return the parent bundle
42      */

43     Bundle getParent();
44
45     /**
46      * Set the parent bundle of the current bundle.
47      *
48      * @param parent the parent bundle
49      */

50     void setParent(Bundle parent);
51
52     /**
53      * Get value by key.
54      *
55      * @param key key
56      * @return value
57      * @exception MissingResourceException if value was not found
58      */

59     String JavaDoc getString(String JavaDoc key);
60
61     /**
62      * Get value by key and substitute variables.
63      *
64      * @param key key
65      * @param values map with variable values
66      * @return value with variable values substituted
67      * @exception MissingResourceException if value was not found
68      */

69     String JavaDoc getString(String JavaDoc key, Map JavaDoc values);
70
71     /**
72      * Convert the &quot;user view&quot; of the lookup key to the
73      * &quot;system view&quot;. Used to hide the implemented storage
74      * mechanism and/or XML file schema.
75      *
76      * @param key user key
77      * @return system key
78      */

79     String JavaDoc convertKey(String JavaDoc userKey);
80
81     /**
82      * Returns the last modification time of this bundle, in milliseconds.
83      *
84      * @return last modification time, -1 if N/A
85      */

86     long getLastModified();
87
88     /**
89      * Sets the last modification time of this bundle, in milliseconds.
90      *
91      * @param lastModified last modification time
92      */

93     void setLastModified(long lastModified);
94 }
95
Popular Tags