com.filenet.wcm.toolkit.server.util.prefs
Class PrefsLabel

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.prefs.PrefsLabel

public class PrefsLabel
extends java.lang.Object


Constructor Summary
PrefsLabel()
          Default constructor.
PrefsLabel(java.util.Locale defaultLocale, java.lang.String defaultValue)
          Constructor that takes defaultValue and defaultLocale which is used to add the resource
PrefsLabel(java.lang.String defaultValue)
          Constructor that take defaultValue
 
Method Summary
 void clear()
          Clears the resource map
 java.lang.String getDefaultResource()
          Returns default resource
 boolean getFormatBundleResources()
          Returns true if this object is set to format the values found in resource bundles using MessageFormat.format() method
 java.lang.String getKeyAttribute()
          Returns key attribute
 java.lang.String getLocalizationKey()
          Returns localization key
 java.lang.String getResource(java.util.Locale locale)
          Returns a resource for a given locale.
 void setDefaultResource(java.lang.String defaultResource)
          Sets default Resours
 void setFormatBundleResources(boolean formatBundleResources)
          Sets a flat configuring this object to format the values found in resource bundles using MessageFormat.format() method.
 void setKeyAttribute(java.lang.String keyAttribute)
          Sets key attribute
 void setLocalizationKey(java.lang.String localizationKey)
          Sets localization key
 void setResource(java.util.Locale locale, java.lang.String value)
          Sets the resource for the given locale.
static java.lang.String[] toStringArray(PrefsLabel[] labels, java.util.Locale locale)
          Converts array of PrefLabel object into an array of String objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefsLabel

public PrefsLabel()
Default constructor. DefaultResource becomes an empty String.


PrefsLabel

public PrefsLabel(java.lang.String defaultValue)
Constructor that take defaultValue

Parameters:
defaultValue -

PrefsLabel

public PrefsLabel(java.util.Locale defaultLocale,
                  java.lang.String defaultValue)
Constructor that takes defaultValue and defaultLocale which is used to add the resource

Parameters:
defaultValue -
defaultLocale -
Method Detail

getResource

public java.lang.String getResource(java.util.Locale locale)
Returns a resource for a given locale. If locale is null, returns default resource. If resource is not present and localizationKey exists, look it up in the resource bundle. If nothing is found, return defaultResource and add the defaultResource as the value for the given locale

Parameters:
locale -
Returns:
Localized String

setResource

public void setResource(java.util.Locale locale,
                        java.lang.String value)
Sets the resource for the given locale. If defaultResource is null or empty, value becomes the default resource

Parameters:
locale - Locale object. Cannot be null.
value - String object representing the resource. Cannot be null or empty.

getFormatBundleResources

public boolean getFormatBundleResources()
Returns true if this object is set to format the values found in resource bundles using MessageFormat.format() method

Returns:
boolean value. Default is true.

setFormatBundleResources

public void setFormatBundleResources(boolean formatBundleResources)
Sets a flat configuring this object to format the values found in resource bundles using MessageFormat.format() method. By default, this value is set to true.


getLocalizationKey

public java.lang.String getLocalizationKey()
Returns localization key

Returns:
localization key

setLocalizationKey

public void setLocalizationKey(java.lang.String localizationKey)
Sets localization key

Parameters:
localizationKey - localization key

getKeyAttribute

public java.lang.String getKeyAttribute()
Returns key attribute

Returns:
key attribute

setKeyAttribute

public void setKeyAttribute(java.lang.String keyAttribute)
Sets key attribute

Parameters:
keyAttribute - key attribute

getDefaultResource

public java.lang.String getDefaultResource()
Returns default resource

Returns:
default resource

setDefaultResource

public void setDefaultResource(java.lang.String defaultResource)
Sets default Resours

Parameters:
defaultResource - default resource

toStringArray

public static java.lang.String[] toStringArray(PrefsLabel[] labels,
                                               java.util.Locale locale)
Converts array of PrefLabel object into an array of String objects

Parameters:
labels -
locale -
Returns:
array of String objects

clear

public void clear()
Clears the resource map



© Copyright IBM Corp. 2002, 2007. All Rights Reserved.