it.eng.spagobi.commons.utilities.messages
Interface IMessageBuilder

All Known Implementing Classes:
MessageBuilder

public interface IMessageBuilder

This is the interface for classes that implements logic to retrieve localized messages to be used in JSP pages


Method Summary
 java.lang.String getI18nMessage(java.util.Locale locale, java.lang.String code)
          Internationalization of user messages via DB
 java.lang.String getI18nMessage(java.lang.String code, javax.servlet.http.HttpServletRequest request)
          Internationalization of user messages via DB
 java.lang.String getMessage(java.lang.String code)
          Returns the message associated with code in the default bundle
 java.lang.String getMessage(java.lang.String code, javax.servlet.http.HttpServletRequest request)
          Returns the message associated with code in the default bundle.
 java.lang.String getMessage(java.lang.String code, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          If the specified locale is valid, returns the message associated with code in the default bundle with the specified locale; otherwise returns the message associated with code in the default bundle with request locale.
 java.lang.String getMessage(java.lang.String code, java.util.Locale locale)
          If the specified locale is valid, returns the message associated with code in the default bundle with the specified locale; otherwise returns the message associated with code in the default bundle with default locale.
 java.lang.String getMessage(java.lang.String code, java.lang.String bundle)
          Returns the message associated with code in the given bundle.
 java.lang.String getMessage(java.lang.String code, java.lang.String bundle, javax.servlet.http.HttpServletRequest request)
          Returns the message associated with code in the given bundle.
 java.lang.String getMessage(java.lang.String code, java.lang.String bundle, javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
          If the specified locale is valid, returns the message associated with code in the input bundle with the specified locale; otherwise returns the message associated with code in the input bundle with request locale.
 java.lang.String getMessage(java.lang.String code, java.lang.String bundle, java.util.Locale locale)
          If the specified locale is valid, returns the message associated with code in the input bundle with the specified locale; otherwise returns the message associated with code in the input bundle with default locale.
 java.lang.String getMessageTextFromResource(java.lang.String resourceName, javax.servlet.http.HttpServletRequest request)
          Gets a localized information text given the resource name which contains the text information.
 java.lang.String getMessageTextFromResource(java.lang.String resourceName, java.util.Locale locale)
          If the specified locale is valid, returns the localized text contained into the resource with the specified locale; otherwise returns the localized text contained into the resource with default locale.
 

Method Detail

getMessage

java.lang.String getMessage(java.lang.String code)
Returns the message associated with code in the default bundle

Parameters:
code: - the message code

getMessage

java.lang.String getMessage(java.lang.String code,
                            java.util.Locale locale)
If the specified locale is valid, returns the message associated with code in the default bundle with the specified locale; otherwise returns the message associated with code in the default bundle with default locale.

Parameters:
code - the code
locale - the locale
Returns:
if the specified locale is valid, returns the message associated with code in the default bundle with the specified locale; otherwise returns the message associated with code in the default bundle with default locale

getMessage

java.lang.String getMessage(java.lang.String code,
                            java.lang.String bundle)
Returns the message associated with code in the given bundle.

Parameters:
code - the code
bundle - the bundle
Returns:
the message associated with code in the given bundle

getMessage

java.lang.String getMessage(java.lang.String code,
                            java.lang.String bundle,
                            java.util.Locale locale)
If the specified locale is valid, returns the message associated with code in the input bundle with the specified locale; otherwise returns the message associated with code in the input bundle with default locale.

Parameters:
code - the code
bundle - the bundle
locale - the locale
Returns:
if the specified locale is valid, returns the message associated with code in the input bundle with the specified locale; otherwise returns the message associated with code in the input bundle with default locale

getMessage

java.lang.String getMessage(java.lang.String code,
                            javax.servlet.http.HttpServletRequest request)
Returns the message associated with code in the default bundle.

Parameters:
code - the code
request - the request
Returns:
the message associated with code in the default bundle

getMessage

java.lang.String getMessage(java.lang.String code,
                            javax.servlet.http.HttpServletRequest request,
                            java.util.Locale locale)
If the specified locale is valid, returns the message associated with code in the default bundle with the specified locale; otherwise returns the message associated with code in the default bundle with request locale.

Parameters:
code - the code
request - the request
locale - the locale
Returns:
if the specified locale is valid, returns the message associated with code in the default bundle with the specified locale; otherwise returns the message associated with code in the default bundle with request locale

getMessage

java.lang.String getMessage(java.lang.String code,
                            java.lang.String bundle,
                            javax.servlet.http.HttpServletRequest request)
Returns the message associated with code in the given bundle.

Parameters:
code - the code
bundle - the bundle
request - the request
Returns:
the message associated with code in the given bundle

getMessage

java.lang.String getMessage(java.lang.String code,
                            java.lang.String bundle,
                            javax.servlet.http.HttpServletRequest request,
                            java.util.Locale locale)
If the specified locale is valid, returns the message associated with code in the input bundle with the specified locale; otherwise returns the message associated with code in the input bundle with request locale.

Parameters:
code - the code
bundle - the bundle
request - the request
locale - the locale
Returns:
if the specified locale is valid, returns the message associated with code in the input bundle with the specified locale; otherwise returns the message associated with code in the input bundle with request locale

getMessageTextFromResource

java.lang.String getMessageTextFromResource(java.lang.String resourceName,
                                            javax.servlet.http.HttpServletRequest request)
Gets a localized information text given the resource name which contains the text information. The resource will be searched into the classpath of the application

Parameters:
resourceName - The complete name of the resource.
request - The http request for locale retrieving
Returns:
the localized text contained into the resource

getMessageTextFromResource

java.lang.String getMessageTextFromResource(java.lang.String resourceName,
                                            java.util.Locale locale)
If the specified locale is valid, returns the localized text contained into the resource with the specified locale; otherwise returns the localized text contained into the resource with default locale.

Parameters:
resourceName - The complete name of the resource
locale - the locale
Returns:
if the specified locale is valid, returns the localized text contained into the resource with the specified locale; otherwise returns the localized text contained into the resource with default locale

getI18nMessage

java.lang.String getI18nMessage(java.util.Locale locale,
                                java.lang.String code)
Internationalization of user messages via DB

Parameters:
locale -
code -
Returns:

getI18nMessage

java.lang.String getI18nMessage(java.lang.String code,
                                javax.servlet.http.HttpServletRequest request)
Internationalization of user messages via DB

Parameters:
code -
request -
Returns: