net.sf.sfac.lang
Class MultiLingualTextImpl

java.lang.Object
  extended by net.sf.sfac.lang.MultiLingualTextImpl
All Implemented Interfaces:
MultiLingualText
Direct Known Subclasses:
ValidationMessageImpl

public class MultiLingualTextImpl
extends Object
implements MultiLingualText

Implementation of the MultiLingualText interface based on the use of the LanguageSupport.

Author:
Olivier Berlanger

Constructor Summary
MultiLingualTextImpl(String messageKey, Object... messageParams)
           
 
Method Summary
 String getRawText()
           
 String getText()
          Get the value of the text for the default locale.
 String getText(Locale loc)
          Get the value of the text for the specified locale.
 String getText(String localeId)
          Get the value of the text for the specified locale.
protected  Object[] getTranslatedParams()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiLingualTextImpl

public MultiLingualTextImpl(String messageKey,
                            Object... messageParams)
Method Detail

getRawText

public String getRawText()

getText

public String getText()
Description copied from interface: MultiLingualText
Get the value of the text for the default locale.

Specified by:
getText in interface MultiLingualText
Returns:
the value of the text for the default locale.

getTranslatedParams

protected Object[] getTranslatedParams()

getText

public String getText(Locale loc)
Description copied from interface: MultiLingualText
Get the value of the text for the specified locale.
If a specific value for the given locale is not available, this method tries to find the most appropriate translation with the usual ResourceBundle mechanism.

Specified by:
getText in interface MultiLingualText
Returns:
the value of the text for the specified locale.

getText

public String getText(String localeId)
Description copied from interface: MultiLingualText
Get the value of the text for the specified locale.
If a specific value for the given locale is not available, this method tries to find the most appropriate translation with the usual ResourceBundle mechanism.

Specified by:
getText in interface MultiLingualText
Parameters:
localeId - the ID of the locale (language_country_variant)
Returns:
the value of the text for the specified locale.


Copyright © 2012. All Rights Reserved.