Oracle Data-aware Controls Reference

oracle.dacf.util.errormanager
Class ErrorMessage

java.lang.Object
  extended byoracle.dacf.util.errormanager.ErrorMessage

public class ErrorMessage
extends java.lang.Object

The ErrorMessage class is an overloaded class and is used to define an error. An ErrorMessage can define information which is either:

The default ErrorMessage class is without context (except for the source object). This is the generic error message and defines these attributes:

The source object is used by listeners to throw exceptions and possibly by non-buffered loggers to interact between user and the error stack.

The ErrorType, ErrorSeverity, ErrorMessageText attributes implement ErrorAttribute and Enumeration. The ErrorTimeStamp attribute is constructed by the class constructor. These attributes are context-less and are be used for indication, status checking, and so on.

The context-specific version of the ErrorMessage class contains these context-less attributes but also includes a Context attribute. The Context attribute allows you to define your own error messages by extending the ErrorMessage class and adding error-specific information.

To extend ErrorMessage, you must write an ErrorMessageContext class. This class holds all the information used by ErrorListeners to make veto descisions, or in the case of DACF controls, the information used by the NavigationManager. The ErrorMessageContext class can offer some of its Context as context-less information in the form of ErrorAttributes.

For an example of a context-specific ErrorMessage class, see the oracle.dacf.dataset.dacfErrorMessageContext class. It adds DacfContext (dataItem, row, control, related error) to ErrorMessage and provides a Context-description of all fields it wants to log to non-buffered loggers.

See Also:
ErrorManager, ErrorAttribute, ErrorMessageContext, DacfErrorMessageContext

Constructor Summary
ErrorMessage(java.lang.Object source, ErrorType type, ErrorSeverity severity, ErrorMessageText messageText)
          Public constructor for the generic, context-less error message.
ErrorMessage(java.lang.Object source, ErrorType type, ErrorSeverity severity, ErrorMessageText messageText, ErrorMessageContext context)
          Public constructor which requires context-specific information to extend the error message.
 
Method Summary
 ErrorAttribute[] getAddedErrorAttributes()
          A convience method that wraps the context-less _messageContext.getAddedErrorAttributes (provided by ErrorMessageContext class) in an array.
 ErrorMessageContext getErrorMessageContext()
          Returns the message context which typically contains error-specific information.
 ErrorMessageText getMessageText()
          Returns the message text and ID wrapped in an ErrorMessageText class.
 ErrorSeverity getSeverity()
          Returns the error severity for this error message.
 java.lang.Object getSource()
          Returns the source object that caused the error.
 ErrorTimeStamp getTimeStamp()
          Returns the date and time that this error message was added to the ErrorManager.
 ErrorType getType()
          Returns the error type for this error message.
 void setErrorMessageContext(ErrorMessageContext messageContext)
          Extends the error message by specifying the error-specific context information.
 void setMessageText(ErrorMessageText messageText)
          Specifies the error message text for this error message.
 void setSeverity(ErrorSeverity severity)
          Specifies the error severity for this error message.
 void setSource(java.lang.Object src)
          Specifies the source object that caused the error.
 void setType(ErrorType type)
          Specifies the the error type for this error message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorMessage

public ErrorMessage(java.lang.Object source,
                    ErrorType type,
                    ErrorSeverity severity,
                    ErrorMessageText messageText)
Public constructor for the generic, context-less error message.

Parameters:
source - the source object.
type - the error type.
severity - the error severity.
messageText - the error message.

ErrorMessage

public ErrorMessage(java.lang.Object source,
                    ErrorType type,
                    ErrorSeverity severity,
                    ErrorMessageText messageText,
                    ErrorMessageContext context)
Public constructor which requires context-specific information to extend the error message.

Parameters:
source - the source object.
type - the error type.
severity - the error severity.
messageText - the error message.
context - the context extending this error message.
Method Detail

getSource

public java.lang.Object getSource()
Returns the source object that caused the error.

Returns:
object the source causing the error.

setSource

public void setSource(java.lang.Object src)
Specifies the source object that caused the error.

Parameters:
src - the source causing the error.

getTimeStamp

public ErrorTimeStamp getTimeStamp()
Returns the date and time that this error message was added to the ErrorManager.

Returns:
the date and time.

getType

public ErrorType getType()
Returns the error type for this error message.


setType

public void setType(ErrorType type)
Specifies the the error type for this error message.

Parameters:
type - the error type.

getSeverity

public ErrorSeverity getSeverity()
Returns the error severity for this error message.

Returns:
the error severity.

setSeverity

public void setSeverity(ErrorSeverity severity)
Specifies the error severity for this error message.

Parameters:
severity - severity of this error.

getMessageText

public ErrorMessageText getMessageText()
Returns the message text and ID wrapped in an ErrorMessageText class.

Returns:
the message text and ID.

setMessageText

public void setMessageText(ErrorMessageText messageText)
Specifies the error message text for this error message.

Parameters:
messageText - the error message text.

getErrorMessageContext

public ErrorMessageContext getErrorMessageContext()
Returns the message context which typically contains error-specific information.

Returns:
the message context.

setErrorMessageContext

public void setErrorMessageContext(ErrorMessageContext messageContext)
Extends the error message by specifying the error-specific context information.

Parameters:
messageContext - the context of this message.

getAddedErrorAttributes

public ErrorAttribute[] getAddedErrorAttributes()
A convience method that wraps the context-less _messageContext.getAddedErrorAttributes (provided by ErrorMessageContext class) in an array.

Returns:
an array containing the added context-less error attributes.
See Also:
ErrorMessageContext.getAddedErrorAttributes()

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.