|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
wt.util.WTException
public class WTException
WTException is the base class for Windchill exceptions.
WTExecption is an exception that:
WTException:
try {
doSomething(obj);
}
catch (Exception e) {
Object[] param = { toString(), obj.getConceptualClassname() };
throw new WTException(e, RESOURCE, "17", param);
}
Localization of the WTException messages relies on the resource
bundle and text formatting features of Java. In the example above, RESOURCE
is a string constant that identifies the resource bundle containing the
localizable message for the exception.
Supported API: true
Extendable: true
ResourceBundle,
MessageFormat,
Serialized Form| Constructor Summary | |
|---|---|
WTException()
Constructs a Windchill exception with no specified detailed message or embedded throwable object. |
|
WTException(Object[] additionalMessages)
Constructs a Windchill exception with additional messages only. |
|
WTException(String s)
Constructs a Windchill exception with a non-localizable detailed message. |
|
WTException(String s,
Object[] additionalMessages)
Constructs a Windchill exception with a non-localizable standard message and additional messages. |
|
WTException(String rb,
String key,
Object[] params)
Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params. |
|
WTException(String rb,
String key,
Object[] params,
Object[] additionalMessages)
Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params. |
|
WTException(Throwable t)
Constructs a Windchill exception with a nested throwable. |
|
WTException(Throwable t,
Object[] additionalMessages)
Constructs a Windchill exception with a nested throwable and additional messages. |
|
WTException(Throwable t,
String s)
Constructs a Windchill exception with an embedded Throwable object and non-localizable detailed message. |
|
WTException(Throwable t,
String s,
Object[] additionalMessages)
Constructs a Windchill exception with an embedded Throwable object, a non-localizable detailed message, and additional messages. |
|
WTException(Throwable t,
String rb,
String key,
Object[] params)
Constructs a Windchill exception with an embedded Throwable object and a localizable detailed message. |
|
WTException(Throwable t,
String rb,
String key,
Object[] params,
Object[] additionalMessages)
Constructs a Windchill exception with an embedded Throwable object, a localizable detailed message, and additional messages. |
|
WTException(Throwable t,
WTMessage message)
Constructs a Windchill exception with a nested throwable and message. |
|
WTException(Throwable t,
WTMessage message,
Object[] additionalMessages)
Constructs a Windchill exception with a nested throwable, message, and additional messages. |
|
WTException(WTMessage message)
Constructs a Windchill exception given the passed-in message. |
|
WTException(WTMessage message,
Object[] additionalMessages)
Constructs a Windchill exception with a standard message and additional messages. |
|
| Method Summary | |
|---|---|
Object[] |
getAdditionalMessageArray()
Returns the raw "additional" messages object array. |
String |
getAdditionalMessages()
Returns the localized "additional" messages. |
String |
getAdditionalMessages(Locale locale)
Returns the localized "additional" messages. |
String |
getLocalizedMessage()
Returns the localized message, including nested exception. |
String |
getLocalizedMessage(boolean nested)
Returns the localized message, optionally including nested exception. |
String |
getLocalizedMessage(Locale locale)
Obtain a message, localized to the specified locale. |
String |
getLocalizedMessage(Locale locale,
boolean nested)
Returns the localized message, for the specified locale, optionally including nested exception. |
static String |
getNestedExceptionString(String msg)
Returns the localized form of a "nested exception is" string. |
static String |
getNestedExceptionString(String msg,
Locale locale)
Returns the localized form of a "nested exception is" string. |
Throwable |
getNestedThrowable()
Returns the embedded throwable object. |
String |
getStandardMessage()
Returns the localized "standard" message. |
String |
getStandardMessage(Locale locale)
Returns the localized "standard" message using the given locale. |
void |
printStackTrace()
Prints this WTException and the backtrace of its most deeply
nested embedded Throwable to the standard error stream. |
void |
printStackTrace(PrintStream s)
Prints this WTException and the backtrace of its most deeply
nested embedded Throwable to the specified print stream. |
void |
printStackTrace(PrintWriter s)
Prints this WTException and the backtrace of its most deeply
nested embedded Throwable to the specified print writer. |
protected void |
setLocalizedMessage(String rb,
String key,
Object[] params)
Sets the localized message for this WTException. |
String |
toString()
Returns a description of this WTException. |
String |
toString(boolean nested)
Returns a description of this WTException. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WTException()
public WTException(WTMessage message)
message - the messagepublic WTException(Object[] additionalMessages)
additionalMessages - the array of additional messages
public WTException(WTMessage message,
Object[] additionalMessages)
message - the standard messageadditionalMessages - the array of additional messagespublic WTException(String s)
s - the detailed message
public WTException(String s,
Object[] additionalMessages)
s - the standard messageadditionalMessages - the array of additional messages
public WTException(String rb,
String key,
Object[] params)
rb - the resoure bundle the key resides inkey - the key containing the message in the resource bundleparams - the parameters to substitute in the message
public WTException(String rb,
String key,
Object[] params,
Object[] additionalMessages)
rb - the resoure bundle the key resides inkey - the key containing the message in the resource bundleparams - the parameters to substitute in the messageadditionalMessages - the array of additional messagespublic WTException(Throwable t)
t - the nested throwable
public WTException(Throwable t,
WTMessage message)
t - the nested throwablemessage - the message
public WTException(Throwable t,
Object[] additionalMessages)
t - the nested throwableadditionalMessages - the array of additional messages
public WTException(Throwable t,
WTMessage message,
Object[] additionalMessages)
t - the nested throwablemessage - the messageadditionalMessages - the array of additional messages
public WTException(Throwable t,
String s)
t - the embedded Throwable. It may be null.s - the detailed message. It may be null.
public WTException(Throwable t,
String s,
Object[] additionalMessages)
t - the embedded Throwable. It may be null.s - the detailed message. It may be null.additionalMessages - the array of additional messages. It may be null.
public WTException(Throwable t,
String rb,
String key,
Object[] params)
t - the embedded Throwable. It may be null.rb - the name of the base resource bundle subclass containing
the localizable message.key - the key associated with the localizable messageparams - an optional set of objects to be formatted into
the localizable message text.ResourceBundle,
MessageFormat
public WTException(Throwable t,
String rb,
String key,
Object[] params,
Object[] additionalMessages)
t - the embedded Throwable. It may be null.rb - the name of the base resource bundle subclass containing
the localizable message.key - the key associated with the localizable messageparams - an optional set of objects to be formatted into
the localizable message text.additionalMessages - the array of additional messages. It may be null.ResourceBundle,
MessageFormat| Method Detail |
|---|
public Throwable getNestedThrowable()
public String getLocalizedMessage(Locale locale)
getLocalizedMessage in interface LocalizableMessagelocale -
public String getLocalizedMessage()
getLocalizedMessage in class Throwable
public String getLocalizedMessage(Locale locale,
boolean nested)
nested - include nested exceptions in messagepublic String getLocalizedMessage(boolean nested)
nested - include nested exceptions in message
public static String getNestedExceptionString(String msg,
Locale locale)
msg - current messagelocale - Locale to usepublic static String getNestedExceptionString(String msg)
msg - current messagepublic void printStackTrace()
WTException and the backtrace of its most deeply
nested embedded Throwable to the standard error stream.
printStackTrace in class Throwablepublic void printStackTrace(PrintStream s)
WTException and the backtrace of its most deeply
nested embedded Throwable to the specified print stream.
printStackTrace in class Throwablepublic void printStackTrace(PrintWriter s)
WTException and the backtrace of its most deeply
nested embedded Throwable to the specified print writer.
printStackTrace in class Throwable
protected void setLocalizedMessage(String rb,
String key,
Object[] params)
WTException.
rb - the name of the base resource bundle subclass containing
the localizable message.key - the key associated with the localizable messageparams - an optional set of objects to be formatted into
the localizable message text.
ResourceBundle,
MessageFormatpublic String toString()
WTException. The
description includes the descriptions of the nested throwable objects
that are embedded within this WTException.
toString in class Throwablepublic String toString(boolean nested)
WTException. The
description optionally includes the descriptions of the nested throwable
objects that are embedded within this WTException.
nested - include nested exceptions in messagepublic String getStandardMessage()
public String getStandardMessage(Locale locale)
locale - the locale to apply when localizing the standard messagepublic Object[] getAdditionalMessageArray()
public String getAdditionalMessages()
public String getAdditionalMessages(Locale locale)
locale - the locale to apply when localizing the standard message
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||