SAP NetWeaver '04

com.sap.netweaver.bc.rf.util.exception
Class ResourceMessage

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.util_api.jar]
com.sap.netweaver.bc.rf.util.exception.ResourceMessage

public class ResourceMessage

Class implementing a resource message wrapping the standard exception location class due to the bad implementation and bad name scheme in that package and the fact that the package seems to be totally misnamed as com.sap.localization being just a localization package for the exception framework. This class also allows to store messages not necesssarily being localized in order to support easy exception creation.


Constructor Summary
ResourceMessage(java.lang.ClassLoader resourceBundleClassLoader, java.lang.String resourceBundleName, java.lang.String key)
          Construct object of class ResourceMessage.
ResourceMessage(java.lang.ClassLoader resourceBundleClassLoader, java.lang.String resourceBundleName, java.lang.String key, java.lang.Object[] args)
          Construct object of class ResourceMessage.
ResourceMessage(ResourceAccessor resourceAccessor, java.lang.String key)
          Construct object of class ResourceMessage.
ResourceMessage(ResourceAccessor resourceAccessor, java.lang.String key, java.lang.Object[] args)
          Construct object of class ResourceMessage.
ResourceMessage(java.lang.String message)
          Construct object of class ResourceMessage.
ResourceMessage(java.lang.String message, java.lang.Object[] args)
          Construct object of class ResourceMessage.
 
Method Summary
 void finallyLocalize()
          Finally localize the message according to locale and timezone.
 void finallyLocalize(java.util.Locale locale)
          Finally localize the message according to locale and timezone.
 void finallyLocalize(java.util.Locale locale, java.util.TimeZone timeZone)
          Finally localize the message according to locale and timezone.
 void finallyLocalize(java.util.TimeZone timeZone)
          Finally localize the message according to locale and timezone.
 java.lang.String format()
          Format message according to locale and timezone.
 java.lang.String format(java.util.Locale locale)
          Format message according to locale and timezone.
 java.lang.String format(java.util.Locale locale, java.util.TimeZone timeZone)
          Format message according to locale and timezone.
 java.lang.String format(java.util.TimeZone timeZone)
          Format message according to locale and timezone.
 java.util.Locale getLocale()
          Get actual locale to be used for the message.
 java.util.TimeZone getTimeZone()
          Get actual time zone to be used for the message.
 void setLocale(java.util.Locale locale)
          Set actual locale to be used for the message.
 void setTimeZone(java.util.TimeZone timeZone)
          Set actual time zone to be used for the message.
 

Constructor Detail

ResourceMessage

public ResourceMessage(java.lang.String message)
Construct object of class ResourceMessage.
Parameters:
message - not localized message

ResourceMessage

public ResourceMessage(java.lang.String message,
                       java.lang.Object[] args)
Construct object of class ResourceMessage.
Parameters:
message - not localized message
args - message arguments inserted by MessageFormat means

ResourceMessage

public ResourceMessage(java.lang.ClassLoader resourceBundleClassLoader,
                       java.lang.String resourceBundleName,
                       java.lang.String key)
Construct object of class ResourceMessage.
Parameters:
resourceBundleClassLoader - class loader having access to the resource bundle
resourceBundleName - resource bundle name used to look up resource bundle
key - resource identifier for localized message

ResourceMessage

public ResourceMessage(java.lang.ClassLoader resourceBundleClassLoader,
                       java.lang.String resourceBundleName,
                       java.lang.String key,
                       java.lang.Object[] args)
Construct object of class ResourceMessage.
Parameters:
resourceBundleClassLoader - class loader having access to the resource bundle
resourceBundleName - resource bundle name used to look up resource bundle
key - resource identifier for localized message
args - message arguments inserted by MessageFormat means

ResourceMessage

public ResourceMessage(ResourceAccessor resourceAccessor,
                       java.lang.String key)
Construct object of class ResourceMessage.
Parameters:
resourceAccessor - resource accessor for localized message
key - resource identifier for localized message

ResourceMessage

public ResourceMessage(ResourceAccessor resourceAccessor,
                       java.lang.String key,
                       java.lang.Object[] args)
Construct object of class ResourceMessage.
Parameters:
resourceAccessor - resource accessor for localized message
key - resource identifier for localized message
args - message arguments inserted by MessageFormat means
Method Detail

setLocale

public void setLocale(java.util.Locale locale)
Set actual locale to be used for the message.
Parameters:
locale - actual locale to be used for the message

getLocale

public java.util.Locale getLocale()
Get actual locale to be used for the message.
Returns:
actual locale to be used for the message

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)
Set actual time zone to be used for the message.
Parameters:
timeZone - actual time zone to be used for the message

getTimeZone

public java.util.TimeZone getTimeZone()
Get actual time zone to be used for the message.
Returns:
actual time zone to be used for the message

format

public java.lang.String format()
                        throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Format message according to locale and timezone.
Returns:
localized message
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

format

public java.lang.String format(java.util.Locale locale)
                        throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Format message according to locale and timezone.
Parameters:
locale - locale
Returns:
localized message
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

format

public java.lang.String format(java.util.TimeZone timeZone)
                        throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Format message according to locale and timezone.
Parameters:
timeZone - time zone
Returns:
localized message
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

format

public java.lang.String format(java.util.Locale locale,
                               java.util.TimeZone timeZone)
                        throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Format message according to locale and timezone.
Parameters:
locale - locale
timeZone - time zone
Returns:
localized message
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize()
                     throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Finally localize the message according to locale and timezone. The ability to do localization on demand gets lost.
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize(java.util.Locale locale)
                     throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Finally localize the message according to locale and timezone. The ability to do localization on demand gets lost.
Parameters:
locale - locale
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize(java.util.TimeZone timeZone)
                     throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Finally localize the message according to locale and timezone. The ability to do localization on demand gets lost.
Parameters:
timeZone - time zone
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize(java.util.Locale locale,
                            java.util.TimeZone timeZone)
                     throws com.sap.netweaver.bc.rf.util.exception.LocalizationException
Finally localize the message according to locale and timezone. The ability to do localization on demand gets lost.
Parameters:
locale - locale
timeZone - time zone
Throws:
com.sap.netweaver.bc.rf.util.exception.LocalizationException - Exception raised in failure situation

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.