net.sf.sfac.lang
Class MultiLingualRuntimeException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by net.sf.sfac.lang.MultiLingualRuntimeException
All Implemented Interfaces:
Serializable, MultiLingualText

public class MultiLingualRuntimeException
extends RuntimeException
implements MultiLingualText

A runtime exception implementing the MultiLingualText interface.

Author:
Olivier Berlanger
See Also:
Serialized Form

Constructor Summary
MultiLingualRuntimeException(String messageKey, Object... messageParams)
           
MultiLingualRuntimeException(Throwable cause, String messageKey, Object... messageParams)
           
 
Method Summary
 String getMessage()
           
 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.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiLingualRuntimeException

public MultiLingualRuntimeException(String messageKey,
                                    Object... messageParams)

MultiLingualRuntimeException

public MultiLingualRuntimeException(Throwable cause,
                                    String messageKey,
                                    Object... messageParams)
Method Detail

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

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.

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.