Package wt.util
Class WTException
java.lang.Object
java.lang.Throwable
java.lang.Exception
wt.util.WTException
- All Implemented Interfaces:
Serializable,LocalizableMessage,Message
- Direct Known Subclasses:
AccessControlException,AdministrativeDomainException,AlreadyCheckedOutException,ChangeException2,CheckedOutByOtherException,CheckInOutException,ClassificationReportException,CollectionContainsDeletedException,CollectionContainsStaleException,CommandException,ConfigException,ConflictException,ConstraintException,ContentException,DeleteCompletedException,wt.effectivity.EffectivityException,EffGroupException,EPMException,EPMNonOverrideableConflictException,ESIException,ESITargetAssignmentException,FederationServicesException,FolderException,IllegalContentException,IllegalFormatException,IncompatibleUnitsException,IndexPolicyException,InvalidAlgorithmArgumentException,InvalidAttributeException,InvalidFunctionArgumentException,InvalidNavigateSourceException,InvalidRoleException,LifeCycleException,LockException,ManagerException,MappingManagerException,MaturityException,ModificationNotAllowedException,NonEventFailedException,NotCheckedOutException,ObjectNoLongerExistsException,ObjectNotForLinkException,wt.objectstorage.exception.ObjectStorageException,OccurrenceException,OrganizationServicesException,OwnershipException,PartialContentControlLinkResultException,PersistenceException,QMLException,QueryException,QueryException,QueueException,ReceivedDeliveryException,ReplicaException,ReservationException,ResetReadyException,ReviseException,RouterException,SchedulerException,SeriesException,SignatureInvalidException,StringLimitException,TaskDelegateException,TeamException,TranslationException,UnitFormatException,VersionControlException,ViewException,ViewMarkUpException,WfException,WorkInProgressException,wt.inf.container.WTContainerException,WTDeliveryException,WTIntrospectionException,WTResourceException,XPathException
WTException is the base class for Windchill exceptions.
WTException is an exception that:
- May embed exceptions and errors thrown by lower level methods.
- Support localizable messages.
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
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a Windchill exception with no specified detailed message or embedded throwable object.WTException(Object[] additionalMessages) Constructs a Windchill exception with additional messages only.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.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.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
Modifier and TypeMethodDescriptionObject[]Returns the raw "additional" messages object array.Returns the localized "additional" messages.getAdditionalMessages(Locale locale) Returns the localized "additional" messages.Returns the localized message, including nested exception.getLocalizedMessage(boolean nested) Returns the localized message, optionally including nested exception.getLocalizedMessage(Locale locale, boolean nested) Returns the localized message, for the specified locale, optionally including nested exception.static StringReturns the localized form of a "nested exception is" string.static StringgetNestedExceptionString(String msg, Locale locale) Returns the localized form of a "nested exception is" string.Returns the embedded throwable object.Returns the localized "standard" message.getStandardMessage(Locale locale) Returns the localized "standard" message using the given locale.Returns the rawWTMessageobject (which may be null).voidPrints thisWTExceptionand the backtrace of its most deeply nested embedded Throwable to the standard error stream.voidPrints thisWTExceptionand the backtrace of its most deeply nested embedded Throwable to the specified print stream.voidPrints thisWTExceptionand the backtrace of its most deeply nested embedded Throwable to the specified print writer.protected voidsetLocalizedMessage(String rb, String key, Object[] params) Sets the localized message for thisWTException.toString()Returns a description of thisWTException.toString(boolean nested) Returns a description of thisWTException.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Constructor Details
-
WTException
public WTException()Constructs a Windchill exception with no specified detailed message or embedded throwable object.
Supported API: true -
WTException
Constructs a Windchill exception given the passed-in message.
Supported API: true- Parameters:
message- the message
-
WTException
Constructs a Windchill exception with additional messages only.
Supported API: true- Parameters:
additionalMessages- the array of additional messages
-
WTException
Constructs a Windchill exception with a standard message and additional messages.
Supported API: true- Parameters:
message- the standard messageadditionalMessages- the array of additional messages
-
WTException
Constructs a Windchill exception with a non-localizable detailed message.
Supported API: true- Parameters:
s- the detailed message
-
WTException
Constructs a Windchill exception with a non-localizable standard message and additional messages.
Supported API: true- Parameters:
s- the standard messageadditionalMessages- the array of additional messages
-
WTException
Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params.
Supported API: true- Parameters:
rb- the resoure bundle the key resides inkey- the key containing the message in the resource bundleparams- the parameters to substitute in the message
-
WTException
Constructs a Windchill exception with a localizable standard message constructed from the bundle, key, and params.
Supported API: true- Parameters:
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 messages
-
WTException
Constructs a Windchill exception with a nested throwable.
Supported API: true- Parameters:
t- the nested throwable
-
WTException
Constructs a Windchill exception with a nested throwable and message.
Supported API: true- Parameters:
t- the nested throwablemessage- the message
-
WTException
Constructs a Windchill exception with a nested throwable and additional messages.
Supported API: true- Parameters:
t- the nested throwableadditionalMessages- the array of additional messages
-
WTException
Constructs a Windchill exception with a nested throwable, message, and additional messages.
Supported API: true- Parameters:
t- the nested throwablemessage- the messageadditionalMessages- the array of additional messages
-
WTException
Constructs a Windchill exception with an embedded Throwable object and non-localizable detailed message.
Supported API: true- Parameters:
t- the embedded Throwable. It may be null.s- the detailed message. It may be null.
-
WTException
Constructs a Windchill exception with an embedded Throwable object, a non-localizable detailed message, and additional messages.
Supported API: true- Parameters:
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.
-
WTException
Constructs a Windchill exception with an embedded Throwable object and a localizable detailed message.
Supported API: true- Parameters:
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.- See Also:
-
WTException
public 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.
Supported API: true- Parameters:
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.- See Also:
-
-
Method Details
-
getNestedThrowable
Returns the embedded throwable object.
Supported API: true -
getWTMessage
Returns the rawWTMessageobject (which may be null).
Supported API: true -
getLocalizedMessage
Returns the localized message, including nested exception.
Supported API: true- Overrides:
getLocalizedMessagein classThrowable
-
getLocalizedMessage
Returns the localized message, for the specified locale, optionally including nested exception.
Supported API: true- Parameters:
nested- include nested exceptions in message
-
getLocalizedMessage
Returns the localized message, optionally including nested exception.
Supported API: true- Parameters:
nested- include nested exceptions in message
-
getNestedExceptionString
Returns the localized form of a "nested exception is" string. The format of the returned string is based on the last character of the message to which this string will be appended.
Supported API: true- Parameters:
msg- current messagelocale- Locale to use
-
getNestedExceptionString
Returns the localized form of a "nested exception is" string. The format of the returned string is based on the last character of the message to which this string will be appended.
Supported API: true- Parameters:
msg- current message
-
printStackTrace
public void printStackTrace()Prints thisWTExceptionand the backtrace of its most deeply nested embedded Throwable to the standard error stream.
Supported API: true- Overrides:
printStackTracein classThrowable
-
printStackTrace
Prints thisWTExceptionand the backtrace of its most deeply nested embedded Throwable to the specified print stream.
Supported API: true- Overrides:
printStackTracein classThrowable
-
printStackTrace
Prints thisWTExceptionand the backtrace of its most deeply nested embedded Throwable to the specified print writer.
Supported API: true- Overrides:
printStackTracein classThrowable
-
setLocalizedMessage
Sets the localized message for thisWTException.- Parameters:
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.
Supported API: true- See Also:
-
toString
Returns a description of thisWTException. The description includes the descriptions of the nested throwable objects that are embedded within thisWTException.
Supported API: true -
toString
Returns a description of thisWTException. The description optionally includes the descriptions of the nested throwable objects that are embedded within thisWTException.
Supported API: true- Parameters:
nested- include nested exceptions in message
-
getStandardMessage
Returns the localized "standard" message. The standard message is the string or localized message passed during the construction of this object.
Supported API: true -
getStandardMessage
Returns the localized "standard" message using the given locale. The standard message is the string or localized message passed during the construction of this object.
Supported API: true- Parameters:
locale- the locale to apply when localizing the standard message
-
getAdditionalMessageArray
Returns the raw "additional" messages object array. This is the array of objects passed during the construction of this object.
Supported API: true -
getAdditionalMessages
Returns the localized "additional" messages. The additional messages consist of the array of objects passed during the construction of this object. Each object in the array is localized and each localized result is separated from the other by a newline.
Supported API: true -
getAdditionalMessages
Returns the localized "additional" messages. The additional messages consist of the array of objects passed during the construction of this object. Each object in the array is localized and each localized result is separated from the other by a newline.
Supported API: true- Parameters:
locale- the locale to apply when localizing the standard message
-