flex.messaging.util
Interface ResourceLoader

All Known Implementing Classes:
PropertyStringResourceLoader

public interface ResourceLoader

The root interface for classes that provide access to localized resources.


Method Summary
 Locale getDefaultLocale()
          The default locale to be used when locating resources.
 String getString(String key)
          Gets a string for the given key.
 String getString(String key, Locale locale)
          Gets a string for the given key and locale.
 String getString(String key, Locale locale, Object[] arguments)
          Gets a parameterized string for the given key and locale and substitutes the parameters using the passed array of arguments.
 String getString(String key, Object[] arguments)
          Gets a parameterized string for the given key and substitutes the parameters using the passed array of arguments.
 void init(Map properties)
          Initializes the ResourceLoader using the specified properties.
 void setDefaultLocale(Locale locale)
          Sets the default locale to be used when locating resources.
 void setDefaultLocale(String locale)
          Sets the default locale to be used when locating resources.
 

Method Detail

init

void init(Map properties)
Initializes the ResourceLoader using the specified properties.

Parameters:
properties - The initialization properties.

setDefaultLocale

void setDefaultLocale(String locale)
Sets the default locale to be used when locating resources. The string will be converted into a Locale.

Parameters:
locale - The default locale to be used.

setDefaultLocale

void setDefaultLocale(Locale locale)
Sets the default locale to be used when locating resources.

Parameters:
locale - The default locale to be used.

getDefaultLocale

Locale getDefaultLocale()
The default locale to be used when locating resources.


getString

String getString(String key)
Gets a string for the given key.

Parameters:
key - The key for the target string.
Returns:
The string for the given key.

getString

String getString(String key,
                 Object[] arguments)
Gets a parameterized string for the given key and substitutes the parameters using the passed array of arguments.

Parameters:
key - The key for the target string.
arguments - The arguments to substitute into the parameterized string.
Returns:
The substituted string for the given key.
Throws:
IllegalArgumentException - If the parameterized string is invalid, or if an argument in the arguments array is not of the type expected by the format element(s) that use it.

getString

String getString(String key,
                 Locale locale)
Gets a string for the given key and locale.

Parameters:
key - The key for the target string.
locale - The target locale for the string.
Returns:
The localized string for the given key.

getString

String getString(String key,
                 Locale locale,
                 Object[] arguments)
Gets a parameterized string for the given key and locale and substitutes the parameters using the passed array of arguments.

Parameters:
key - The key for the target string.
locale - The target locale for the string.
arguments - The arguments to substitute into the parameterized string.
Returns:
The substituted localized string for the given key.
Throws:
IllegalArgumentException - If the parameterized string is invalid, or if an argument in the arguments array is not of the type expected by the format element(s) that use it.


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/util/ResourceLoader.html