Oracle Data-aware Controls Reference

oracle.dacf.dataset
Class DacfErrorMessageContext

java.lang.Object
  extended byoracle.dacf.dataset.DacfErrorMessageContext
All Implemented Interfaces:
java.lang.Cloneable, ErrorMessageContext, java.io.Serializable

public class DacfErrorMessageContext
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, ErrorMessageContext

The DacfErrorMessageContext class implements the ErrorMessageContext interface to hold the situation- or error-specific context information attached to a DacfErrorMessage. Listeners which must rely on context should check instanceof MyDacfErrorMessageContextImpl, be specific-context aware, and make decisions based on context, error, and history.

Although DacfErrorMessageContext includes context-specific information, it can also include context-less information. This interface defines a method, getAddedErrorAttributes, that returns attributes containing context-less information. This method should be called only by non-buffered error loggers to check if there is context-less information added to the error message. All context-specific methods are different for every context and can be used by a context-aware listener or logger.

Version:
SDK
See Also:
ErrorMessageContext, Serialized Form

Constructor Summary
DacfErrorMessageContext()
          Default Constructor for DacfErrorMessageContext.
DacfErrorMessageContext(javax.infobus.DataItem dataItem, java.lang.String dataItemName, Control control, int row, java.lang.Exception except, ErrorMessage related)
          Constructor for DacfErrorMessageContext.
 
Method Summary
 java.lang.Object clone()
          Produces a shallow clone of the DacfErrorMessageContext.
 ErrorAttribute[] getAddedErrorAttributes()
          Returns an array of context-specific attributes in a format that can be recorded by logging facilities.
 Control getControl()
          Returns the control associated with the error message.
 javax.infobus.DataItem getDataItem()
          Returns the dataItem associated with the error message.
 java.lang.String getDataItemName()
          Returns the name of the dataItem.
 int getDataItemRow()
          Gets the number of the row within the dataItem where the error occured.
 java.lang.Exception getException()
          Returns the Exception object for the error message.
 ErrorMessage getRelatedError()
          Gets the related error message of the current error message.
 void setControl(Control nuValue)
          Sets the control associated with the error message.
 void setDataItem(javax.infobus.DataItem dataItem)
          Sets the dataItem associated with the error message.
 void setDataItemName(java.lang.String nuValue)
          Sets the name of the dataItem.
 void setDataItemRow(int row)
          Specifies the row within the dataItem where the error occured.
 void setException(java.lang.Exception except)
          Sets the Exception object for the error message.
 void setRelatedError(ErrorMessage related)
          Specifies a related error message if the current error message has a cascading effect.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DacfErrorMessageContext

public DacfErrorMessageContext()
Default Constructor for DacfErrorMessageContext.


DacfErrorMessageContext

public DacfErrorMessageContext(javax.infobus.DataItem dataItem,
                               java.lang.String dataItemName,
                               Control control,
                               int row,
                               java.lang.Exception except,
                               ErrorMessage related)
Constructor for DacfErrorMessageContext. This implementation of the constructor requires:

Parameters:
dataItem - the dataItem that is reporting the error.
dataItemName - the name of this dataItem or a sub-dataItem.
control - the control that supplied the information causing the error.
row - the row number only applies when the error message is associated with column object (otherwise, a NO_ROW or -1 value).
except - the exception thrown as a result of the error.
related - a reference to a related error.
Method Detail

setDataItem

public void setDataItem(javax.infobus.DataItem dataItem)
Sets the dataItem associated with the error message. The dataItem is the context within which the error occured.

Parameters:
dataItem - the dataItem associated with the error message.

getDataItem

public javax.infobus.DataItem getDataItem()
Returns the dataItem associated with the error message. The dataItem is the context within which the error occured.

Returns:
dataItem the dataItem associated with the error message.

setDataItemName

public void setDataItemName(java.lang.String nuValue)
Sets the name of the dataItem. In the case of a compound control like the Grid, it may name a sub-dataItem that is mapped to a cell of the Grid.

Parameters:
nuValue - the name identifying the dataItem.

getDataItemName

public java.lang.String getDataItemName()
Returns the name of the dataItem. In the case of a compound control like the Grid, it can name a sub-dataItem that is mapped to a cell of the Grid.

Returns:
the name identifying the dataItem.

setControl

public void setControl(Control nuValue)
Sets the control associated with the error message.

This control will have focus (usually) when the error occurs. It will be the control that has focus if the error inspector is "told" to navigate to correct the error. If the error message is created in response to a non-UI activity or event, then the parameter value can be null.

Parameters:
nuValue - the control to be used to correct the error.

getControl

public Control getControl()
Returns the control associated with the error message.

This control will have focus (usually) when the error occurs. It will be the control that has focus if the error inspector is "told" to navigate to correct the error. If the error message is created in response to a non-UI activity or event, then the return value will be null.

Returns:
the control to be used to correct the error. The return value can be null.

setDataItemRow

public void setDataItemRow(int row)
Specifies the row within the dataItem where the error occured.

The row number only applies when the error message is associated with a column object. If the error message is not associated with a column object, then row can be set to -1 to indicate "no row".

Parameters:
row - the number of the row within the dataItem.

getDataItemRow

public int getDataItemRow()
Gets the number of the row within the dataItem where the error occured.

The row number only applies when the error message is associated with column object. The row number value can change as the result of row insertions and deletions. Can return -1 to indicate "no row" if the error is not associated with an column object.

Returns:
the number of the row within the dataItem.

setException

public void setException(java.lang.Exception except)
Sets the Exception object for the error message.

The Exception object attribute should be set when an error message is created in response to catching an exception.

Parameters:
except - the Exception object that results from the creation of an error message.

getException

public java.lang.Exception getException()
Returns the Exception object for the error message.

This Exception object attribute is generated when an error message is created in response to catching an exception.

Returns:
the Exception object associated with the error message.

setRelatedError

public void setRelatedError(ErrorMessage related)
Specifies a related error message if the current error message has a cascading effect.

The related attribute is used to chain related error messages together when one error message causes others to be constructed.

Parameters:
related - an error message that is related to the current message.

getRelatedError

public ErrorMessage getRelatedError()
Gets the related error message of the current error message.

The related attribute is used to chain related error messages together when one error message causes others to be constructed.

Returns:
an error message related to the current message.

clone

public java.lang.Object clone()
Produces a shallow clone of the DacfErrorMessageContext.


getAddedErrorAttributes

public ErrorAttribute[] getAddedErrorAttributes()
Returns an array of context-specific attributes in a format that can be recorded by logging facilities. The array contains the dataItem name, row number (if the error is associated with a column object) and exception associated with this error message. The array is returned as a instance of the ErrorAttribute interface.

Specified by:
getAddedErrorAttributes in interface ErrorMessageContext
Returns:
attributes containing context-less information.

Oracle Data-aware Controls Reference

 

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