KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > i18n > client > ConstantsWithLookup


1 /*
2  * Copyright 2006 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

16 package com.google.gwt.i18n.client;
17
18 import java.util.Map JavaDoc;
19
20 /**
21  * Like {@link com.google.gwt.i18n.client.Constants}, a tag interface that
22  * facilitates locale-sensitive, compile-time binding of constant values
23  * supplied from properties files with the added ability to look up constants at
24  * runtime with a string key.
25  *
26  * <p>
27  * <code>ConstantsWithLookup</code> extends
28  * {@link com.google.gwt.i18n.client.Constants} and is identical in behavior,
29  * adding only a family of special-purpose lookup methods such as
30  * {@link ConstantsWithLookup#getString(String)}.
31  * </p>
32  *
33  * <p>
34  * It is generally preferable to extend <code>Constants</code> rather than
35  * <code>ConstantsWithLookup</code> because <code>ConstantsWithLookup</code>
36  * forces all constants to be retained in the compiled script, preventing the
37  * GWT compiler from pruning unused constant accessors.
38  * </p>
39  *
40  * <h3>Required Module</h3>
41  * Modules that use this interface should inherit
42  * <code>com.google.gwt.i18n.I18N</code>.
43  *
44  * {@gwt.include com/google/gwt/examples/i18n/InheritsExample.gwt.xml}
45  *
46  * <h3>Note</h3>
47  * You should not directly implement this interface or interfaces derived from
48  * it since an implementation is generated automatically when message interfaces
49  * are created using {@link com.google.gwt.core.client.GWT#create(Class)}.
50  *
51  * @see com.google.gwt.i18n.client.Constants
52  */

53 public interface ConstantsWithLookup extends Constants {
54   /**
55    * Look up <code>boolean</code> by method name.
56    *
57    * @param methodName method name
58    * @return boolean returned by method
59    */

60   public boolean getBoolean(String JavaDoc methodName);
61
62   /**
63    * Look up <code>double</code> by method name.
64    *
65    * @param methodName method name
66    * @return double returned by method
67    */

68   public double getDouble(String JavaDoc methodName);
69
70   /**
71    * Look up <code>float</code> by method name.
72    *
73    * @param methodName method name
74    * @return float returned by method
75    */

76   public float getFloat(String JavaDoc methodName);
77
78   /**
79    * Look up <code>int</code> by method name.
80    *
81    * @param methodName method name
82    * @return int returned by method
83    */

84   public int getInt(String JavaDoc methodName);
85
86   /**
87    * Look up <code>Map</code> by method name.
88    *
89    * @param methodName method name
90    * @return Map returned by method
91    */

92   public Map JavaDoc getMap(String JavaDoc methodName);
93
94   /**
95    * Look up <code>String</code> by method name.
96    *
97    * @param methodName method name
98    * @return String returned by method
99    */

100   public String JavaDoc getString(String JavaDoc methodName);
101
102   /**
103    * Look up <code>String[]</code> by method name.
104    *
105    * @param methodName method name
106    * @return String[] returned by method
107    */

108   public String JavaDoc[] getStringArray(String JavaDoc methodName);
109 }
110
Popular Tags