Interface ConstantsWithLookup

public interface ConstantsWithLookup
extends Constants
Like Constants, a tag interface that facilitates locale-sensitive, compile-time binding of constant values supplied from properties files with the added ability to look up constants at runtime with a string key.

ConstantsWithLookup extends Constants and is identical in behavior, adding only a family of special-purpose lookup methods such as ConstantsWithLookup.getString(String).

It is generally preferable to extend Constants rather than ConstantsWithLookup because ConstantsWithLookup forces all constants to be retained in the compiled script, preventing the GWT compiler from pruning unused constant accessors.

Required Module

Modules that use this interface should inherit com.google.gwt.i18n.I18N.
<!--                                                                        -->
<!-- Copyright 2007 Google Inc.                                             -->
<!-- Licensed under the Apache License, Version 2.0 (the "License"); you    -->
<!-- may not use this file except in compliance with the License. You may   -->
<!-- may obtain a copy of the License at                                    -->
<!--                                                                        -->
<!-- http://www.apache.org/licenses/LICENSE-2.0                             -->
<!--                                                                        -->
<!-- Unless required by applicable law or agreed to in writing, software    -->
<!-- distributed under the License is distributed on an "AS IS" BASIS,      -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        -->
<!-- implied. License for the specific language governing permissions and   -->
<!-- limitations under the License.                                         -->

<module>
  <!-- other inherited modules, such as com.google.gwt.user.User -->
  <inherits name="com.google.gwt.i18n.I18N"/>
  <!-- additional module settings -->
</module>

Note

You should not directly implement this interface or interfaces derived from it since an implementation is generated automatically when message interfaces are created using GWT.create(Class).

Methods

getBoolean(String)Look up boolean by method name.
getDouble(String)Look up double by method name.
getFloat(String)Look up float by method name.
getInt(String)Look up int by method name.
getMap(String)Look up Map by method name.
getString(String)Look up String by method name.
getStringArray(String)Look up String[] by method name.

See Also

Constants

Method Detail

getBoolean

public boolean getBoolean(String methodName)
Look up boolean by method name.

Parameters

methodName
method name

Return Value

boolean returned by method

getDouble

public double getDouble(String methodName)
Look up double by method name.

Parameters

methodName
method name

Return Value

double returned by method

getFloat

public float getFloat(String methodName)
Look up float by method name.

Parameters

methodName
method name

Return Value

float returned by method

getInt

public int getInt(String methodName)
Look up int by method name.

Parameters

methodName
method name

Return Value

int returned by method

getMap

public Map getMap(String methodName)
Look up Map by method name.

Parameters

methodName
method name

Return Value

Map returned by method

getString

public String getString(String methodName)
Look up String by method name.

Parameters

methodName
method name

Return Value

String returned by method

getStringArray

public String[] getStringArray(String methodName)
Look up String[] by method name.

Parameters

methodName
method name

Return Value

String[] returned by method