com.crystaldecisions.reports.common
Class CrystalException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.crystaldecisions.reports.common.CrystalException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
FormulaFunctionCallException

public abstract class CrystalException
extends java.lang.Exception

The base class for almost all exceptions thrown by the Java Reporting Component, including FormulaFunctionCallException and other FormulaExceptions.

See Also:
Serialized Form

Constructor Summary
CrystalException(java.lang.String RCI, java.lang.String debugInfo, CrystalException otherException)
           Internal use only.
CrystalException(java.lang.String RCI, java.lang.String debugInfo, CrystalResourcesFactory resourcesFactory, java.lang.String resourceKey)
           Internal use only.
CrystalException(java.lang.String RCI, java.lang.String debugInfo, CrystalResourcesFactory resourcesFactory, java.lang.String resourceKey, java.lang.Object substitutionStrings)
           Internal use only.
CrystalException(java.lang.String RCI, java.lang.String debugInfo, CrystalResourcesFactory resourcesFactory, java.lang.String resourceKey, java.lang.Object substitutionStrings, java.lang.Throwable cause)
           Internal use only.
CrystalException(java.lang.String RCI, java.lang.String debugInfo, CrystalResourcesFactory resourcesFactory, java.lang.String resourceKey, java.lang.Throwable cause)
           Internal use only.
 
Method Summary
<T extends java.lang.Throwable>
T
findCause(java.lang.Class<T> throwable)
          Digs into the cause chain to find a cause of the specified type.
 java.lang.String getLocalizedMessage(java.util.Locale locale)
           Gets the localized message from the resource bundle using the given locale.
 java.lang.String getMessage()
           Gets the localized message from the resource bundle using the default locale.
 java.lang.String getResourceKey()
           Gets the key used to retrieve a resource value from the resource bundle.
 java.lang.String getRootCauseIdentifier()
           Gets the root cause identifier of the exception.
<T extends java.lang.Throwable>
boolean
isCausedByA(java.lang.Class<T> throwable)
          Digs into the cause chain to see if this exception was caused by the specified type of throwable.
 void printStackTrace()
           Prints the stack trace.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CrystalException

public CrystalException(java.lang.String RCI,
                        java.lang.String debugInfo,
                        CrystalResourcesFactory resourcesFactory,
                        java.lang.String resourceKey)

Internal use only.


CrystalException

public CrystalException(java.lang.String RCI,
                        java.lang.String debugInfo,
                        CrystalResourcesFactory resourcesFactory,
                        java.lang.String resourceKey,
                        java.lang.Throwable cause)

Internal use only.


CrystalException

public CrystalException(java.lang.String RCI,
                        java.lang.String debugInfo,
                        CrystalResourcesFactory resourcesFactory,
                        java.lang.String resourceKey,
                        java.lang.Object substitutionStrings)

Internal use only.


CrystalException

public CrystalException(java.lang.String RCI,
                        java.lang.String debugInfo,
                        CrystalResourcesFactory resourcesFactory,
                        java.lang.String resourceKey,
                        java.lang.Object substitutionStrings,
                        java.lang.Throwable cause)

Internal use only.


CrystalException

public CrystalException(java.lang.String RCI,
                        java.lang.String debugInfo,
                        CrystalException otherException)

Internal use only.

Method Detail

printStackTrace

public void printStackTrace()

Prints the stack trace.

Overrides:
printStackTrace in class java.lang.Throwable

getResourceKey

public java.lang.String getResourceKey()

Gets the key used to retrieve a resource value from the resource bundle.

Returns:
a String that specifies the key

getRootCauseIdentifier

public java.lang.String getRootCauseIdentifier()

Gets the root cause identifier of the exception.

Returns:
a String that specifies the rootCauseID

getMessage

public java.lang.String getMessage()

Gets the localized message from the resource bundle using the default locale.

Overrides:
getMessage in class java.lang.Throwable
Returns:
a String that specifies the localized message

getLocalizedMessage

public java.lang.String getLocalizedMessage(java.util.Locale locale)

Gets the localized message from the resource bundle using the given locale.

Returns:
a String that specifies the localized message

isCausedByA

public <T extends java.lang.Throwable> boolean isCausedByA(java.lang.Class<T> throwable)
Digs into the cause chain to see if this exception was caused by the specified type of throwable.

Type Parameters:
T - Type of the throwable we are looking for
Parameters:
throwable - The Class instance for the throwable we are looking for.
Returns:
whether a throwable of the specified type was found in the cause chain

findCause

public <T extends java.lang.Throwable> T findCause(java.lang.Class<T> throwable)
Digs into the cause chain to find a cause of the specified type. The most outer cause that is an instance of the provided type is returned.

Type Parameters:
T - Type of the throwable that we are looking for
Parameters:
throwable - The Class instance for the exception we are looking for.
Returns:
The outermost cause of the specified type. null if not found.