jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.htform
Interface ResourceConsumer

All Known Implementing Classes:
ResourceConsumerImpl, Servlet

public interface ResourceConsumer

An interface for anything that consumes resources.

Version:
$Revision: 1.3.4.1 $
Author:
Simon Brooke

Field Summary
static java.lang.String RESOURCEBUNDLEMAGICTOKEN
          The magic token on which I look up the value of my resource bundle name in my configuration
 
Method Summary
 java.lang.Object getResource(java.lang.String key, Context context)
          Deprecated. i18n code is still experimental and the only call I commit to supporting in the longer term is grs(String,Context)
 java.lang.String getResourceString(java.lang.String key, Context context)
          Deprecated. i18n code is still experimental and the only call I commit to supporting in the longer term is grs(String,Context)
 java.lang.String grs(java.lang.String key)
          Deprecated. use grs(String,Context)
 java.lang.String grs(java.lang.String key, Context context)
          shorthand for getResourceString; identical to it.
 

Field Detail

RESOURCEBUNDLEMAGICTOKEN

public static final java.lang.String RESOURCEBUNDLEMAGICTOKEN
The magic token on which I look up the value of my resource bundle name in my configuration

See Also:
Constant Field Values
Method Detail

getResource

public java.lang.Object getResource(java.lang.String key,
                                    Context context)
                             throws java.util.MissingResourceException
Deprecated. i18n code is still experimental and the only call I commit to supporting in the longer term is grs(String,Context)

return the value of the resource with the given key as whatever sort of object it happens to be. In the end if the resource cannot be found throw an exception.

Parameters:
key - the key to search for
Throws:
java.util.MissingResourceException - if the key cannot be found.

getResourceString

public java.lang.String getResourceString(java.lang.String key,
                                          Context context)
Deprecated. i18n code is still experimental and the only call I commit to supporting in the longer term is grs(String,Context)

return as a string the value of the resource with the given key. If in the end the resource cannot be found just return the key.

Parameters:
key - the key to search for

grs

public java.lang.String grs(java.lang.String key,
                            Context context)
shorthand for getResourceString; identical to it.

See Also:
getResourceString(String,Context)

grs

public java.lang.String grs(java.lang.String key)
Deprecated. use grs(String,Context)

In Jacquard 1.8 I had a one arg grs(); this is here for backwards compatibility only. I still haven't fully sussed the best way to do i18n, and this way only does server-side i18n which definitely isn't good enough. But since I published the API I'd better support it.


jacquard 1.12.0 by The Web Engineering Factory and Toolworks