wt.util
Class LocalizableMessageCollection

java.lang.Object
  extended bywt.util.LocalizableMessageCollection
All Implemented Interfaces:
LocalizableMessage, Message, Serializable

public class LocalizableMessageCollection
extends Object
implements LocalizableMessage, Serializable

LocalizableMessageCollection is an implementation of the LocalizableMessage interface that represents a collection of LocalizableMessage objects to be used as a text insert parameter in a WTMessage. The getLocalizedMessage(Locale) method returns a string containing the localized messages for each object in the collection (for example, a collection of EnumeratedType objects).

Supported API: false

Extendable: false

See Also:
EnumeratedType, LocalizableMessage, WTMessage, Serialized Form

Field Summary
private static String CLASSNAME
           
private  ArrayList collection
           
private static String RESOURCE
           
private  String separatorKey
           
private  String separatorResource
           
 
Constructor Summary
LocalizableMessageCollection(Collection collection)
          Constructs a message containing a collection of LocalizableMessage objects.
LocalizableMessageCollection(Collection collection, String rb, String key)
          Constructs a message containing a collection of LocalizableMessage objects.
 
Method Summary
 String getLocalizedMessage(Locale locale)
          Obtain a message, localized to the specified locale.
private  void validateCollection(Collection collection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

collection

private ArrayList collection

separatorResource

private String separatorResource

separatorKey

private String separatorKey
Constructor Detail

LocalizableMessageCollection

public LocalizableMessageCollection(Collection collection)
                             throws WTInvalidParameterException
Constructs a message containing a collection of LocalizableMessage objects. The localized messages for each object in the collection are combined into a string, with values separated by a default list separator.

Supported API: false

Parameters:
collection - a collection of LocalizableMessage objects
Throws:
WTInvalidParameterException

LocalizableMessageCollection

public LocalizableMessageCollection(Collection collection,
                                    String rb,
                                    String key)
                             throws WTInvalidParameterException
Constructs a message containing a collection of LocalizableMessage objects. The localized messages for each object in the collection are combined into a string, with values separated by the list separator identified by the specified resource bundle name and key.

Supported API: false

Parameters:
collection - a collection of LocalizableMessage objects
rb - the name of the resource bundle containing the localizable message for the list separator
key - the key associated with the localizable message for the list separator
Throws:
WTInvalidParameterException
Method Detail

getLocalizedMessage

public String getLocalizedMessage(Locale locale)
Obtain a message, localized to the specified locale.

Supported API: false

Specified by:
getLocalizedMessage in interface LocalizableMessage
Parameters:
locale -
Returns:
String

validateCollection

private void validateCollection(Collection collection)
                         throws WTInvalidParameterException
Throws:
WTInvalidParameterException