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

Class ResourceMessage

java.lang.Object
  extended bycom.sap.localization.LocalizableTextFormatter
      extended bycom.sap.netweaver.bc.rf.util.exception.ResourceMessage
All Implemented Interfaces:
Localizable, LocalizableText, Serializable

public class ResourceMessage
extends LocalizableTextFormatter

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.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.sap.localization.LocalizableText
LocalizableText.Key0, LocalizableText.Key1, LocalizableText.Key2, LocalizableText.Key3, LocalizableText.Key4, LocalizableText.Key5, LocalizableText.Key6, LocalizableText.Msg
 
Field Summary
 
Fields inherited from interface com.sap.localization.Localizable
defaultLocale
 
Constructor Summary
ResourceMessage(ClassLoader resourceBundleClassLoader, String resourceBundleName, String key)
          Construct object of class ResourceMessage.
ResourceMessage(ClassLoader resourceBundleClassLoader, String resourceBundleName, String key, Object[] args)
          Construct object of class ResourceMessage.
ResourceMessage(ResourceAccessor resourceAccessor, String key)
          Construct object of class ResourceMessage.
ResourceMessage(ResourceAccessor resourceAccessor, String key, Object[] args)
          Construct object of class ResourceMessage.
ResourceMessage(String message)
          Construct object of class ResourceMessage.
ResourceMessage(String message, Object[] args)
          Construct object of class ResourceMessage.
 
Method Summary
 void finallyLocalize()
          Finally localize the message according to locale and timezone.
 void finallyLocalize(Locale locale)
          Finally localize the message according to locale and timezone.
 void finallyLocalize(Locale locale, TimeZone timeZone)
          Finally localize the message according to locale and timezone.
 void finallyLocalize(TimeZone timeZone)
          Finally localize the message according to locale and timezone.
 String format()
          Format message according to locale and timezone.
 String format(Locale locale)
          Format message according to locale and timezone.
 String format(Locale locale, TimeZone timeZone)
          Format message according to locale and timezone.
 String format(TimeZone timeZone)
          Format message according to locale and timezone.
 Locale getLocale()
          Get actual locale to be used for the message.
 TimeZone getTimeZone()
          Get actual time zone to be used for the message.
 void setLocale(Locale locale)
          Set actual locale to be used for the message.
 void setTimeZone(TimeZone timeZone)
          Set actual time zone to be used for the message.
 
Methods inherited from class com.sap.localization.LocalizableTextFormatter
clearCache, clearLocalizableTextFormatter, createKey0, createKey1, createKey2, createKey3, createKey4, createKey5, createKey6, formatString, formatString, formatString, formatString, formatString, getApplicationName, getArguments, getCacheEntry, getPatternKey, getResourceAccessor, getResourceBundleName, isCacheSetting, isFinallySetting, isLocalFormat, setApplicationName, setArguments, setCacheSetting, setLocalFormat, setPatternKey, setResourceAccessor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceMessage

public ResourceMessage(String message)
Construct object of class ResourceMessage.

Parameters:
message - not localized message

ResourceMessage

public ResourceMessage(String message,
                       Object[] args)
Construct object of class ResourceMessage.

Parameters:
message - not localized message
args - message arguments inserted by MessageFormat means

ResourceMessage

public ResourceMessage(ClassLoader resourceBundleClassLoader,
                       String resourceBundleName,
                       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(ClassLoader resourceBundleClassLoader,
                       String resourceBundleName,
                       String key,
                       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,
                       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,
                       String key,
                       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(Locale locale)
Set actual locale to be used for the message.

Parameters:
locale - actual locale to be used for the message

getLocale

public Locale getLocale()
Get actual locale to be used for the message.

Returns:
actual locale to be used for the message

setTimeZone

public void setTimeZone(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 TimeZone getTimeZone()
Get actual time zone to be used for the message.

Returns:
actual time zone to be used for the message

format

public String format()
              throws LocalizationException
Format message according to locale and timezone.

Returns:
localized message
Throws:
LocalizationException - Exception raised in failure situation

format

public String format(Locale locale)
              throws LocalizationException
Format message according to locale and timezone.

Parameters:
locale - locale
Returns:
localized message
Throws:
LocalizationException - Exception raised in failure situation

format

public String format(TimeZone timeZone)
              throws LocalizationException
Format message according to locale and timezone.

Parameters:
timeZone - time zone
Returns:
localized message
Throws:
LocalizationException - Exception raised in failure situation

format

public String format(Locale locale,
                     TimeZone timeZone)
              throws LocalizationException
Format message according to locale and timezone.

Parameters:
locale - locale
timeZone - time zone
Returns:
localized message
Throws:
LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize()
                     throws LocalizationException
Finally localize the message according to locale and timezone. The ability to do localization on demand gets lost.

Throws:
LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize(Locale locale)
                     throws LocalizationException
Finally localize the message according to locale and timezone. The ability to do localization on demand gets lost.

Parameters:
locale - locale
Throws:
LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize(TimeZone timeZone)
                     throws LocalizationException
Finally localize the message according to locale and timezone. The ability to do localization on demand gets lost.

Parameters:
timeZone - time zone
Throws:
LocalizationException - Exception raised in failure situation

finallyLocalize

public void finallyLocalize(Locale locale,
                            TimeZone timeZone)
                     throws 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:
LocalizationException - Exception raised in failure situation


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. 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.