Project: stp

com.ibm.rational.wvcm.stp
Class StpException

Object
  extended by Throwable
      extended by Exception
          extended by javax.wvcm.WvcmException
              extended by com.ibm.rational.wvcm.stp.StpException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
StpPropertyException

public abstract class StpException
extends WvcmException

An extension of javax.wvcm.WvcmException used throughout this API. Although API methods are declared to throw WvcmException, the exception actually thrown is StpException or one of its subclasses.

This class extends the WvcmException class, adding a sub-reason code field that encodes conditions specific to this API more finely than the WvcmException.ReasonCode

This class (unlike the WvcmException class) leverages the Java 1.4 chained exception mechanism. By default, if an StpException is constructed from one or more nested Throwables, the first nested Throwable in the list is also set as the StpException's cause. In certain special cases, the cause may be set to something other than the first nested Throwable. Exception classes that extend StpException because they convey additional information, are as follows:

See Also:
Serialized Form

Nested Class Summary
static interface StpException.Data
          The specification for the data implementation object associated with this exception.
static class StpException.StpReasonCode
          An encoding of exception conditions specific to this API.
 
Nested classes/interfaces inherited from class javax.wvcm.WvcmException
WvcmException.ReasonCode
 
Method Summary
abstract  StpException.Data data()
           
 String getMessage()
          Localizes the message contained within this exception and returns it.
 StpException.StpReasonCode getStpReasonCode()
           
 String toString()
           
static
<U> U
unchecked_cast(Object obj)
          Casts an Object to a Type, avoiding a type safety warning.
 
Methods inherited from class javax.wvcm.WvcmException
getNestedExceptions, getReasonCode, getResource
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

data

public abstract StpException.Data data()
Returns:
Returns an implementation object that stores the fields of this exception not defined by WvcmException and implements the other methods of this exception. Will never be null.

getMessage

public String getMessage()
Localizes the message contained within this exception and returns it.

Overrides:
getMessage in class Throwable

getStpReasonCode

public StpException.StpReasonCode getStpReasonCode()
Returns:
The StpReasonCode assigned to this exception.

toString

public String toString()
Overrides:
toString in class Throwable
Returns:
A String image of this StpException and any nested Exceptions

unchecked_cast

public static <U> U unchecked_cast(Object obj)
Casts an Object to a Type, avoiding a type safety warning. Use sparingly. May throw ClassCastException at runtime. Some Java compilers can deduce U from context, such as in an assignment or a return statement; however, others may not. It is suggested, therefore, that all uses of this method should include the target type explicitly.
  StpException.<desired-type>unchecked_cast(x)
 
The ugliness of this construct matches the sledge hammer that is being used to make the code compile without warnings.

Type Parameters:
U - The Type to which the object should be cast
Parameters:
obj - The Object to be cast
Returns:
The argument Object cast to Type U.

Generated Tue 25-Jul-2017 08:41 PM

Copyright © IBM 2017. All rights reserved.