com.sap.exception

Class BaseExceptionInfo

java.lang.Object
  extended bycom.sap.exception.BaseExceptionInfo
All Implemented Interfaces:
Serializable

public class BaseExceptionInfo
extends Object
implements Serializable

This class encapsulates the work necessary for implementing the IBaseException interface. It can be viewed as a helper class for exception classes implementing the IBaseException interface directly without inheriting from BaseException or BaseRuntimeException.

See Also:
IBaseException, BaseException, BaseRuntimeException, Serialized Form

Constructor Summary
BaseExceptionInfo(Category cat, int severity, Location loc, LocalizableText locMessage, Throwable action, Throwable cause)
          Deprecated. Category and severity must not be used inside of Exception API. The method is left for backward compatibility.
BaseExceptionInfo(Category cat, int severity, Location loc, ResourceAccessor accessor, String patternKey, Object[] parameters, Throwable action, Throwable rootCause)
          Deprecated. Category and severity must not be used inside of Exception API. The method is left for backward compatibility.
BaseExceptionInfo(LocalizableText locMessage, Throwable action)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(LocalizableText locMessage, Throwable action, Throwable cause)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(Location loc, LocalizableText locMessage, Throwable action)
          Constructor for specifying a localizable message and the action cause.
BaseExceptionInfo(Location loc, LocalizableText locMessage, Throwable action, Throwable cause)
          Constructor for specifying a localizable message, the action cause and the root cause.
BaseExceptionInfo(Location loc, ResourceAccessor accessor, LocalizableText.Msg msg, Throwable action, Throwable cause)
          Constructor for specifying a localizable message, the action cause and the root cause.
BaseExceptionInfo(Location loc, ResourceAccessor accessor, String patternKey, Object[] parameters, Throwable action)
          Constructor for specifying a localizable message and the action cause.
BaseExceptionInfo(Location loc, ResourceAccessor accessor, String patternKey, Object[] parameters, Throwable action, Throwable rootCause)
          Constructor for specifying a localizable message, the action cause and the root cause.
BaseExceptionInfo(Location loc, ResourceAccessor accessor, String patternKey, Throwable action)
          Constructor for specifying a localizable message and the action cause.
BaseExceptionInfo(Location loc, ResourceAccessor accessor, String patternKey, Throwable action, Throwable rootCause)
          Constructor for specifying a localizable message, the action cause and the root cause.
BaseExceptionInfo(Location loc, Throwable action)
          Simple constructor specifying the action cause.
BaseExceptionInfo(Location loc, Throwable action, Throwable cause)
          Constructor for specifying the action and root cause.
BaseExceptionInfo(ResourceAccessor accessor, LocalizableText.Msg msg, Throwable action, Throwable cause)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(ResourceAccessor accessor, String patternKey, Object[] parameters, Throwable action)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(ResourceAccessor accessor, String patternKey, Object[] parameters, Throwable action, Throwable rootCause)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(ResourceAccessor accessor, String patternKey, Throwable action)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(ResourceAccessor accessor, String patternKey, Throwable action, Throwable rootCause)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(Throwable action)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
BaseExceptionInfo(Throwable action, Throwable cause)
          Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.
 
Method Summary
 void finallyLocalize()
          Finally localizes the LocalizableText message of the action throwable (if there is one attached).
 void finallyLocalize(Locale loc)
          Finally localizes the LocalizableText message of the action throwable (if there is one attached).
 void finallyLocalize(Locale loc, TimeZone timeZone)
          Finally localizes the LocalizableText message of the action throwable (if there is one attached).
 void finallyLocalize(TimeZone timeZone)
          Finally localizes the LocalizableText message of the action throwable.
 Throwable getCause()
          Getter method for root cause.
 LocalizableText getLocalizableMessage()
          Getter method for localizable message.
 String getLocalizedMessage()
          Gets localized action message.
 String getLocalizedMessage(Locale loc)
          Gets localized action message.
 String getLocalizedMessage(Locale loc, TimeZone timeZone)
          Gets localized action message.
 String getLocalizedMessage(TimeZone timeZone)
          Gets localized action message.
 Category getLogCategory()
          Getter method for logging category.
 Location getLogLocation()
          Getter method for logging location.
 int getLogSeverity()
          Getter method for logging severity.
 String getNestedLocalizedMessage()
          Chains localized messages of the nested exceptions.
 String getNestedLocalizedMessage(Locale loc)
          Chains localized messages of the nested exceptions.
 String getNestedLocalizedMessage(Locale loc, TimeZone timeZone)
          Chains localized message of the nested exceptions.
 String getNestedLocalizedMessage(TimeZone timeZone)
          Chains localized message of the nested exceptions.
 String getNestedStackTraceString()
          Get stack trace information as a string.
 String getStackTraceString()
          Gets stack trace information of this exception.
 Throwable initCause(Throwable cause)
          Initializes the cause of this exception to the specified value.
 void log()
          Deprecated. Instead of this method it should be used some suitable method from Logging API. The method is left for backward compatibility.
 void printStackTrace()
          Prints the action exception and its backtrace to the standard error stream.
 void printStackTrace(PrintStream s)
          Prints the action object and its backtrace to the specified print stream.
 void printStackTrace(PrintWriter s)
          Prints the action object and its backtrace to the specified print writer.
 void restoreLogSettings()
          Restores log settings to their original value before method setLogSettings(Category, int, Location) has been used.
 void setLogSettings(Category cat, int severity, Location loc)
          Deprecated. Category and severity must not be used inside of Exception API. The method is left for backward compatibility.
 void trace(int severity, Location loc)
          Stores the stack trace of the action in the specified location.
 void trace(int severity, Location loc, String subloc)
          Stores the stack trace of the action in the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseExceptionInfo

public BaseExceptionInfo(Throwable action)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Simple constructor specifying the action cause.

Parameters:
action - the caused throwable
Throws:
IllegalArgumentException - if action is null

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         Throwable action)
Simple constructor specifying the action cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
action - the caused throwable
Throws:
IllegalArgumentException - if action is null

BaseExceptionInfo

public BaseExceptionInfo(Throwable action,
                         Throwable cause)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying the action and root cause.

Parameters:
action - the caused throwable
cause - the root cause
Throws:
IllegalArgumentException - if action is null or cause is equal to action (A throwable cannot be its own cause.)

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         Throwable action,
                         Throwable cause)
Constructor for specifying the action and root cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
action - the caused throwable
cause - the root cause
Throws:
IllegalArgumentException - if action is null or cause is equal to action (A throwable cannot be its own cause.)

BaseExceptionInfo

public BaseExceptionInfo(LocalizableText locMessage,
                         Throwable action)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying a localizable message and the action cause.

Parameters:
locMessage - localizable message
action - the caused throwable
Throws:
IllegalArgumentException - if action is null

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         LocalizableText locMessage,
                         Throwable action)
Constructor for specifying a localizable message and the action cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
locMessage - localizable message
action - the caused throwable
Throws:
IllegalArgumentException - if action is null

BaseExceptionInfo

public BaseExceptionInfo(LocalizableText locMessage,
                         Throwable action,
                         Throwable cause)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
locMessage - localizable message
action - the caused throwable
cause - the root cause
Throws:
IllegalArgumentException - if action is null or cause is equal to action (A throwable cannot be its own cause.)

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         LocalizableText locMessage,
                         Throwable action,
                         Throwable cause)
Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
locMessage - localizable message
action - the caused throwable
cause - the root cause
Throws:
IllegalArgumentException - if action is null or cause is equal to action (A throwable cannot be its own cause.)

BaseExceptionInfo

public BaseExceptionInfo(Category cat,
                         int severity,
                         Location loc,
                         LocalizableText locMessage,
                         Throwable action,
                         Throwable cause)
Deprecated. Category and severity must not be used inside of Exception API. The method is left for backward compatibility.

Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
cat - logging category
severity - logging severity
loc - logging location
locMessage - localizable message
action - the caused throwable
cause - the root cause
Throws:
IllegalArgumentException - if action is null or cause is equal to action (A throwable cannot be its own cause.)

BaseExceptionInfo

public BaseExceptionInfo(ResourceAccessor accessor,
                         String patternKey,
                         Throwable action)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying a localizable message and the action cause.

Parameters:
accessor - resource accessor
patternKey - pattern key
action - the caused throwable
Throws:
IllegalArgumentException - if action is null or cause is equal to action (A throwable cannot be its own cause.)

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         ResourceAccessor accessor,
                         String patternKey,
                         Throwable action)
Constructor for specifying a localizable message and the action cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
accessor - resource accessor
patternKey - pattern key
action - the caused throwable
Throws:
IllegalArgumentException - if action is null or cause is equal to action (A throwable cannot be its own cause.)

BaseExceptionInfo

public BaseExceptionInfo(ResourceAccessor accessor,
                         String patternKey,
                         Throwable action,
                         Throwable rootCause)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
accessor - resource accessor
patternKey - pattern key for text message
action - the caused throwable
rootCause - throwable object, which caused this exception

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         ResourceAccessor accessor,
                         String patternKey,
                         Throwable action,
                         Throwable rootCause)
Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
accessor - resource accessor
patternKey - pattern key for text message
action - the caused throwable
rootCause - throwable object, which caused this exception

BaseExceptionInfo

public BaseExceptionInfo(ResourceAccessor accessor,
                         String patternKey,
                         Object[] parameters,
                         Throwable action)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying a localizable message and the action cause.

Parameters:
accessor - resource accessor
patternKey - pattern key for text message
parameters - message parameters
action - the caused throwable

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         ResourceAccessor accessor,
                         String patternKey,
                         Object[] parameters,
                         Throwable action)
Constructor for specifying a localizable message and the action cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
accessor - resource accessor
patternKey - pattern key for text message
parameters - message parameters
action - the caused throwable

BaseExceptionInfo

public BaseExceptionInfo(ResourceAccessor accessor,
                         String patternKey,
                         Object[] parameters,
                         Throwable action,
                         Throwable rootCause)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
accessor - resource accessor
patternKey - pattern key for text message
parameters - message parameters
rootCause - throwable object, which caused this exception

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         ResourceAccessor accessor,
                         String patternKey,
                         Object[] parameters,
                         Throwable action,
                         Throwable rootCause)
Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
accessor - resource accessor
patternKey - pattern key for text message
parameters - message parameters
action - the caused throwable
rootCause - throwable object, which caused this exception

BaseExceptionInfo

public BaseExceptionInfo(Category cat,
                         int severity,
                         Location loc,
                         ResourceAccessor accessor,
                         String patternKey,
                         Object[] parameters,
                         Throwable action,
                         Throwable rootCause)
Deprecated. Category and severity must not be used inside of Exception API. The method is left for backward compatibility.

Constructor for specifying a localizable message, the action cause and the root cause. In addition, the logging category, severity and location for deferred writing can be specified.

Parameters:
cat - logging category
severity - logging severity
loc - logging location
accessor -
patternKey -
parameters -
action -
rootCause - throwable object, which caused this exception

BaseExceptionInfo

public BaseExceptionInfo(ResourceAccessor accessor,
                         LocalizableText.Msg msg,
                         Throwable action,
                         Throwable cause)
Deprecated. Every constructor must have an location as input parameter to make possible automatic exception tracing. The method is left for backward compatibility.

Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
accessor - the resource accessor
msg - message containing pattern key and arguments
action - the caused throwable
cause - throwable object, which caused this exception

BaseExceptionInfo

public BaseExceptionInfo(Location loc,
                         ResourceAccessor accessor,
                         LocalizableText.Msg msg,
                         Throwable action,
                         Throwable cause)
Constructor for specifying a localizable message, the action cause and the root cause.

Parameters:
loc - logging location which will be used in case of automatic tracing
accessor - the resource accessor
msg - message containing pattern key and arguments
action - the caused throwable
cause - throwable object, which caused this exception
Method Detail

initCause

public Throwable initCause(Throwable cause)
Initializes the cause of this exception to the specified value. (The cause is the throwable that caused this exception to get thrown.)

This method can be called at most once. That means the cause can be specified only once.

Parameters:
cause - the cause (which is saved for later retrieval by the getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Returns:
a reference to this exception instance.
Throws:
IllegalArgumentException - if cause is this throwable. (A throwable cannot be its own cause.)
IllegalStateException - if the cause was already set

printStackTrace

public void printStackTrace()
Prints the action exception and its backtrace to the standard error stream. This method prints a stack trace for the actionexception object on the error output stream that is the value of the field System.err.


printStackTrace

public void printStackTrace(PrintStream s)
Prints the action object and its backtrace to the specified print stream.

Parameters:
s - PrintStream to use for output

printStackTrace

public void printStackTrace(PrintWriter s)
Prints the action object and its backtrace to the specified print writer.

Parameters:
s - PrintWriter to use for output

getStackTraceString

public String getStackTraceString()
Gets stack trace information of this exception. The stack traces of the nested exceptions are not chained.

Returns:
the stack trace of this exception as a string

getNestedStackTraceString

public String getNestedStackTraceString()
Get stack trace information as a string. Chain the stack traces of nested exceptions. The caused trace is displayed first.

Returns:
the stack trace as a string

getCause

public Throwable getCause()
Getter method for root cause.

Returns:
throwable object which caused this exception or null

getLocalizableMessage

public LocalizableText getLocalizableMessage()
Getter method for localizable message.

Returns:
localizable message or null

finallyLocalize

public void finallyLocalize()
Finally localizes the LocalizableText message of the action throwable (if there is one attached).

That means no further localization process can be performed on that object. If there is a nested exception implementing IBaseException, it will be localized recursively.

The default locale and the default time zone are used for localization.


finallyLocalize

public void finallyLocalize(Locale loc)
Finally localizes the LocalizableText message of the action throwable (if there is one attached).

That means no further localization process can be performed on that object. If there is a nested exception implementing IBaseException, it will be localized recursively.

The specified locale and the default time zone are used for localization. If the locale parameter is null, the default locale will be used.

Parameters:
loc - locale

finallyLocalize

public void finallyLocalize(TimeZone timeZone)
Finally localizes the LocalizableText message of the action throwable. (if there is one attached).

That means no further localization process can be performed on that object. If there is a nested exception implementing IBaseException, it will be localized recursively.

The specified time zone and the default locale are used for localization. If the time zone parameter is null, the default time zone will be used.

Parameters:
timeZone - time zone

finallyLocalize

public void finallyLocalize(Locale loc,
                            TimeZone timeZone)
Finally localizes the LocalizableText message of the action throwable (if there is one attached).

That means no further localization process can be performed on that object.If there is a nested exception implementing IBaseException, it will be localized recursively.

The specified locale and the specified time zone are used for localization. If the time zone parameter or the locale parameter are null, the default values will be used respectively.

Parameters:
loc - locale
timeZone - time zone

getLocalizedMessage

public String getLocalizedMessage()
Gets localized action message.

The default locale and default time zone are used for localization. These values have no effect if the finallyLocalize method has already been called.

Returns:
message string or null

getLocalizedMessage

public String getLocalizedMessage(Locale loc)
Gets localized action message.

The specified locale and the default time zone are used for localization. The default locale will be used if the Locale parameter is null.

These values have no effect if the finallyLocalize method has been already called.

Parameters:
loc - locale
Returns:
message string or null

getLocalizedMessage

public String getLocalizedMessage(TimeZone timeZone)
Gets localized action message.

The specified time zone and the default locale are used for localization. The default time zone will be used, if the time zone parameter is null.

These values have no effect if the finallyLocalize method has been already called.

Parameters:
timeZone - time zone
Returns:
message string or null

getLocalizedMessage

public String getLocalizedMessage(Locale loc,
                                  TimeZone timeZone)
Gets localized action message.

The specified time zone and locale are used for localization. The default time zone and the default locale will be used, if the time zone parameter and the locale are null respectively.

These values have no effect if the finallyLocalize method has been already called.

Parameters:
loc - locale
timeZone - time zone
Returns:
message string or null

getNestedLocalizedMessage

public String getNestedLocalizedMessage()
Chains localized messages of the nested exceptions.

The default locale and the default time zone are used for localization.

These values have no effect if the finallyLocalize method has already been called.

Returns:
message string or null

getNestedLocalizedMessage

public String getNestedLocalizedMessage(Locale loc)
Chains localized messages of the nested exceptions.

The specified locale and the default time zone are used for localization. The default locale will be used if the Locale parameter is null.

These values have no effect if the finallyLocalize method has been already called.

Parameters:
loc - locale
Returns:
message string containing the localized messages of the nested exceptions or null

getNestedLocalizedMessage

public String getNestedLocalizedMessage(TimeZone timeZone)
Chains localized message of the nested exceptions.

The specified time zone and the default locale are used for localization. The default time zone will be used, if the time zone parameter is null.

These values have no effect if the finallyLocalize method has been already called.

Parameters:
timeZone - time zone
Returns:
message string containing the localized messages of the nested exceptions or null

getNestedLocalizedMessage

public String getNestedLocalizedMessage(Locale loc,
                                        TimeZone timeZone)
Chains localized message of the nested exceptions.

The specified time zone and locale are used for localization. The default time zone and the default locale will be used, if the time zone parameter or the locale parameter are null respectively.

These values have no effect if the finallyLocalize method has been already called.

Parameters:
loc - locale
timeZone - time zone
Returns:
message string containing the localized messages of the nested exceptions or null

getLogCategory

public Category getLogCategory()
Getter method for logging category.

If no category is specified, null is returned.

Returns:
logging category

getLogSeverity

public int getLogSeverity()
Getter method for logging severity.

If no severity is specified, Severity.NONE is returned.

Returns:
logging severity

getLogLocation

public Location getLogLocation()
Getter method for logging location.

If no location is specified, null is returned.

Returns:
logging location

setLogSettings

public void setLogSettings(Category cat,
                           int severity,
                           Location loc)
Deprecated. Category and severity must not be used inside of Exception API. The method is left for backward compatibility.

Setter method for logging information.

Parameters:
cat - logging category
severity - logging severity
loc - logging location

log

public void log()
Deprecated. Instead of this method it should be used some suitable method from Logging API. The method is left for backward compatibility.

Logs the localizable information of the action throwable.


trace

public void trace(int severity,
                  Location loc)
Stores the stack trace of the action in the specified location.

The used category is defined by the action's IBaseException.audit property.

Parameters:
severity - severity of message
loc - location message stems from

trace

public void trace(int severity,
                  Location loc,
                  String subloc)
Stores the stack trace of the action in the specified location.

The used category is defined by the action's IBaseException.audit property.

Parameters:
severity - severity of message
loc - location message stems from
subloc - name of sublocation

restoreLogSettings

public void restoreLogSettings()
Restores log settings to their original value before method setLogSettings(Category, int, Location) has been used.

See Also:
setLogSettings(Category, int, Location)


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.