com.retek.commons.gui.util
Class UiBusinessException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.retek.commons.gui.util.UiBusinessException
All Implemented Interfaces:
java.io.Serializable

public class UiBusinessException
extends java.lang.Exception

This class is a GUI representation of a BusinessException. It contains a complete list of the business problems within the exception along with a widget name associated to each problem. The default error severity of a UiBusinessException is ERROR.

Retek Inc. Copyright (c) 2002

See Also:
Serialized Form

Field Summary
static int BUSINESS_EXCEPTION_TYPE
           
static int UI_EXCEPTION_TYPE
           
 
Constructor Summary
UiBusinessException(BusinessException exception)
          Constructs a new UiBusinessException based around a Business Exception.
UiBusinessException(java.lang.Exception exception)
          Constructs a new UiBusinessException based around a Regular Exception.
UiBusinessException(java.lang.String message)
          Constructs a new UiBusinessException based around a message.
UiBusinessException(java.lang.String message, ErrorSeverity errorSeverity)
          Constructs a new UiBusinessException based around a message.
UiBusinessException(java.lang.String widgetName, java.lang.String message)
          Constructs a new UiBusinessException based around a message.
UiBusinessException(java.lang.String widgetName, java.lang.String message, ErrorSeverity errorSeverity)
          Constructs a new UiBusinessException based around a message.
 
Method Summary
 void addMessage(java.lang.String widgetName, java.lang.String message)
          Adds a new error message to the exception and associates it with a particular widget.
 java.lang.String getLocalizedMessage()
          Retrieves the localized primary message of the UiBusiness Exception.
 java.lang.String getMessage()
          Retrieves the primary message of the UiBusiness Exception.
 java.util.Map getMessages()
          Retrieves a map of all widget names and messages to display for them.
 ErrorSeverity getSeverity()
          Retrieves the error severity of the exception (INFO, WARNING, ERROR, FATAL).
 java.lang.Exception getStoredException()
          Retrieves the underlying exception.
 java.lang.String getWidgetName()
          Retrieves the very first widget name of the widgets that have errors associated with them.
 boolean isBusinessException()
          Retrieves whether or not the exception represents a business exception.
 void removeMessage(java.lang.String widgetName)
          Removes an error message from the exception based on widget name.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UI_EXCEPTION_TYPE

public static final int UI_EXCEPTION_TYPE
See Also:
Constant Field Values

BUSINESS_EXCEPTION_TYPE

public static final int BUSINESS_EXCEPTION_TYPE
See Also:
Constant Field Values
Constructor Detail

UiBusinessException

public UiBusinessException(java.lang.Exception exception)
Constructs a new UiBusinessException based around a Regular Exception.


UiBusinessException

public UiBusinessException(BusinessException exception)
Constructs a new UiBusinessException based around a Business Exception.


UiBusinessException

public UiBusinessException(java.lang.String message)
Constructs a new UiBusinessException based around a message.

Parameters:
message - The message of the business exception.

UiBusinessException

public UiBusinessException(java.lang.String message,
                           ErrorSeverity errorSeverity)
Constructs a new UiBusinessException based around a message.

Parameters:
message - The message of the business exception.
errorSeverity - The error severity to assign to the exception.

UiBusinessException

public UiBusinessException(java.lang.String widgetName,
                           java.lang.String message)
Constructs a new UiBusinessException based around a message.

Parameters:
widgetName - The widget name of a widget to associate with the message.
message - The message of the business exception.

UiBusinessException

public UiBusinessException(java.lang.String widgetName,
                           java.lang.String message,
                           ErrorSeverity errorSeverity)
Constructs a new UiBusinessException based around a message.

Parameters:
widgetName - The widget name of a widget to associate with the message.
message - The message of the business exception.
errorSeverity - The error severity to assign to the exception.
Method Detail

addMessage

public void addMessage(java.lang.String widgetName,
                       java.lang.String message)
Adds a new error message to the exception and associates it with a particular widget.

Parameters:
widgetName - The widget name of a widget to associate with the message.
message - A message to display for the particular widget (when it has focus).

removeMessage

public void removeMessage(java.lang.String widgetName)
Removes an error message from the exception based on widget name.

Parameters:
widgetName - The name of the widget/error to remove from the exception.

getMessages

public java.util.Map getMessages()
Retrieves a map of all widget names and messages to display for them.


getMessage

public java.lang.String getMessage()
Retrieves the primary message of the UiBusiness Exception. It returns a default message key is no message is found.

Returns:
The primary message of the UiBusinessException or a default message.

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Retrieves the localized primary message of the UiBusiness Exception. It returns a default message key is no message is found.

Returns:
The localized primary message of the UiBusinessException or a default message.

getWidgetName

public java.lang.String getWidgetName()
Retrieves the very first widget name of the widgets that have errors associated with them.


getSeverity

public ErrorSeverity getSeverity()
Retrieves the error severity of the exception (INFO, WARNING, ERROR, FATAL).

Returns:
The error severity.

isBusinessException

public boolean isBusinessException()
Retrieves whether or not the exception represents a business exception.

Returns:
True if it is a business exception, false if it is a UI Exception.

getStoredException

public java.lang.Exception getStoredException()
Retrieves the underlying exception.

Returns:
The underlying exception.


Copyright © 2005 Retek Inc. All Rights Reserved. - Generated at Fri, 01/21/2005 14:25