com.esri.aims.mtier.resources
Class Res

java.lang.Object
  |
  +--com.esri.aims.mtier.resources.Res

public class Res
extends Object

Simple-to-use access methods for Class resources that are typically stored within a JAR. Use the getImage method to load an image from a JAR, or getProperties to load a Properties set.

This class also provides keyed access to ResourceBundles. You can use getBundleText() to obtain simpe text, such as might be used with a menu name. Use formatMessage() to construct a complex message using text from the ResourceBundle and parameters that you supply. Several helper methods are available for quickly constructing a message with zero, one or two parameters.


Field Summary
static String DefaultResourceBundleLocation
          the default image size "hint" / public static final int DEFAULT_IMAGE_SIZE = 4096; /** the default ResourceBundle location - for ArcIMS middle tier message text.
 
Method Summary
static String formatMessage(String key, Object[] params)
           
static String formatMessage(String key, Object[] params, Locale locale)
           
static String formatMessage(String bundleLocation, String key, Object[] params)
           
static String formatMessage(String bundleLocation, String key, Object[] params, Locale locale)
           
static String formatMessage0(String key)
           
static String formatMessage0(String bundleLocation, String key)
           
static String formatMessage1(String key, Object param)
           
static String formatMessage1(String bundleLocation, String key, Object param)
           
static String formatMessage2(String key, Object param1, Object param2)
           
static String formatMessage2(String bundleLocation, String key, Object param1, Object param2)
           
static String formatMessage3(String key, Object param1, Object param2, Object param3)
           
static String formatMessage3(String bundleLocation, String key, Object param1, Object param2, Object param3)
           
static String formatMessage4(String key, Object param1, Object param2, Object param3, Object param4)
           
static String formatMessage4(String bundleLocation, String key, Object param1, Object param2, Object param3, Object param4)
           
static String getBundleText(String key)
          obtain a message from the SDK ResourceBundle for the given key.
static String getBundleText(String key, Locale locale)
           
static String getBundleText(String bundleLocation, String key)
          obtain a message from the specified ResourceBundle for the given key.
static String getBundleText(String bundleLocation, String key, Locale locale)
           
static Properties getProperties(Class c, String r)
          obtain a Properties set that is associated with a particular class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DefaultResourceBundleLocation

public static String DefaultResourceBundleLocation
the default image size "hint" / public static final int DEFAULT_IMAGE_SIZE = 4096; /** the default ResourceBundle location - for ArcIMS middle tier message text. This value is currently "com.esri.aims.sdk.msg.Messages"

Method Detail

getProperties

public static Properties getProperties(Class c,
                                       String r)
                                throws IOException
obtain a Properties set that is associated with a particular class.

Parameters:
c - the class that the image is associated with
r - the resource name
Throws:
IOException - for any problem detected by the system

getBundleText

public static String getBundleText(String key)
obtain a message from the SDK ResourceBundle for the given key. If any error occurs while reading the ResourceBundle, the message returned relates to that error instead.

Parameters:
key - resource bundle key
Returns:
default resource bundle value corresponding to the key
See Also:
getBundleText(String,String)

getBundleText

public static String getBundleText(String bundleLocation,
                                   String key)
obtain a message from the specified ResourceBundle for the given key. If any error occurs while reading the ResourceBundle, the message returned relates to that error instead.

Parameters:
bundleLocation - resource bundle location, as package path name
key - resource bundle key
Returns:
default resource bundle value corresponding to the key
See Also:
DefaultResourceBundleLocation

getBundleText

public static String getBundleText(String key,
                                   Locale locale)

getBundleText

public static String getBundleText(String bundleLocation,
                                   String key,
                                   Locale locale)

formatMessage

public static String formatMessage(String key,
                                   Object[] params)

formatMessage

public static String formatMessage(String bundleLocation,
                                   String key,
                                   Object[] params)

formatMessage

public static String formatMessage(String key,
                                   Object[] params,
                                   Locale locale)

formatMessage

public static String formatMessage(String bundleLocation,
                                   String key,
                                   Object[] params,
                                   Locale locale)

formatMessage0

public static String formatMessage0(String key)

formatMessage0

public static String formatMessage0(String bundleLocation,
                                    String key)

formatMessage1

public static String formatMessage1(String key,
                                    Object param)

formatMessage1

public static String formatMessage1(String bundleLocation,
                                    String key,
                                    Object param)

formatMessage2

public static String formatMessage2(String key,
                                    Object param1,
                                    Object param2)

formatMessage2

public static String formatMessage2(String bundleLocation,
                                    String key,
                                    Object param1,
                                    Object param2)

formatMessage3

public static String formatMessage3(String key,
                                    Object param1,
                                    Object param2,
                                    Object param3)

formatMessage3

public static String formatMessage3(String bundleLocation,
                                    String key,
                                    Object param1,
                                    Object param2,
                                    Object param3)

formatMessage4

public static String formatMessage4(String key,
                                    Object param1,
                                    Object param2,
                                    Object param3,
                                    Object param4)

formatMessage4

public static String formatMessage4(String bundleLocation,
                                    String key,
                                    Object param1,
                                    Object param2,
                                    Object param3,
                                    Object param4)