cst.common.system
Class CSTMessages

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.lang.Object>
          extended by cst.common.system.CSTMessages
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>

public class CSTMessages
extends java.util.HashMap<java.lang.String,java.lang.Object>

A class for accessing the CSTMessages.properties resource bundle. This class is used to give the calling routine access to strings which represent information messages, error messages and labels for form components. The application should contain no hard-coded strings. Instead, developers should provide a new entry in the properties file.

The properties file contains many parameterised messages. For example, consider this entry in the properties file:

 activity.error.invalidActivity=\"{0}\" is not a valid activity.
 
The first parameter value is provided by the client code and passed to this class. The call
 CSTMessages.getMessage("activity.error.invalidActivity", "physical fitness test"); 
 

would produce the message:

 "Physical fitness test" is not a valid activity.
 

 Copyright 2010 Medical Research Council Unit for Lifelong Health and Ageing
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You 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.
 See the License for the specific language governing permissions and
 limitations under the License.  
 

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static java.lang.String EMPTY_STRING
           
 
Constructor Summary
CSTMessages()
           
 
Method Summary
static java.lang.String getMessage(java.lang.String key)
           
static java.lang.String getMessage(java.lang.String key, java.lang.String parameter0)
           
static java.lang.String getMessage(java.lang.String key, java.lang.String parameter0, java.lang.String parameter1)
           
static java.lang.String getMessage(java.lang.String key, java.lang.String parameter0, java.lang.String parameter1, java.lang.String parameter2)
           
static java.lang.String getMessage(java.lang.String key, java.lang.String parameter0, java.lang.String parameter1, java.lang.String parameter2, java.lang.String parameter3)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

EMPTY_STRING

public static final java.lang.String EMPTY_STRING
See Also:
Constant Field Values
Constructor Detail

CSTMessages

public CSTMessages()
Method Detail

getMessage

public static java.lang.String getMessage(java.lang.String key)

getMessage

public static java.lang.String getMessage(java.lang.String key,
                                          java.lang.String parameter0)

getMessage

public static java.lang.String getMessage(java.lang.String key,
                                          java.lang.String parameter0,
                                          java.lang.String parameter1)

getMessage

public static java.lang.String getMessage(java.lang.String key,
                                          java.lang.String parameter0,
                                          java.lang.String parameter1,
                                          java.lang.String parameter2)

getMessage

public static java.lang.String getMessage(java.lang.String key,
                                          java.lang.String parameter0,
                                          java.lang.String parameter1,
                                          java.lang.String parameter2,
                                          java.lang.String parameter3)