JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.datasource
Class DataModelException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.klg.jclass.datasource.DataModelException
All Implemented Interfaces:
Serializable

public class DataModelException
extends Exception

Any exceptions from this data model will be wrapped in this DataModelException. It adds information about the context of the exception (for example, bookmark, columnId). The original exception is wrapped by this class and can be gotten by calling the getWrappedException method. You can then call original-exception-specific methods on the wrapped exception. For example, if it were an SQLException you could call DataModelException.getWrappedException().getSQLState();

See Also:
Serialized Form

Field Summary
protected  int action
           
protected  long bookmark
           
protected  String columnID
           
protected  com.klg.jclass.datasource.DataTableModel dataTableModel
           
protected  Exception wrappedException
           
 
Constructor Summary
DataModelException(int action, Exception wrappedException)
          Create a DataModelException.
DataModelException(long bookmark, String columnID, com.klg.jclass.datasource.DataTableModel dataTableModel, int action, Exception wrappedException)
          Create a DataModelException.
 
Method Summary
 int getAction()
          Return the action which caused the Exception.
 long getBookmark()
          Return the bookmark for the offending row.
 String getColumnID()
          Return the columnId for the offending column.
 com.klg.jclass.datasource.DataTableModel getDataTableModel()
          Return the DataTableModel related to the Exception.
 Exception getWrappedException()
          Return the Exception that wrapped by this DataModelException.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, 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

bookmark

protected long bookmark

columnID

protected String columnID

dataTableModel

protected com.klg.jclass.datasource.DataTableModel dataTableModel

action

protected int action

wrappedException

protected Exception wrappedException
Constructor Detail

DataModelException

public DataModelException(long bookmark,
                          String columnID,
                          com.klg.jclass.datasource.DataTableModel dataTableModel,
                          int action,
                          Exception wrappedException)
Create a DataModelException.

Parameters:
bookmark - a long uniquely identifying a row
dataTableModel - the DataTableModel related to the Exception
action - an int, one of DataModelEvent actions.
wrappedException - an Exception
See Also:
DataModelEvent

DataModelException

public DataModelException(int action,
                          Exception wrappedException)
Create a DataModelException.

Parameters:
action - an int, one of DataModelEvent actions.
wrappedException - an Exception
See Also:
DataModelEvent
Method Detail

getBookmark

public long getBookmark()
Return the bookmark for the offending row.

Returns:
the bookmark for the offending row, or -1 if not applicable.

getColumnID

public String getColumnID()
Return the columnId for the offending column.

Returns:
the columnId for the offending column, or "" if not applicable.

getDataTableModel

public com.klg.jclass.datasource.DataTableModel getDataTableModel()
Return the DataTableModel related to the Exception.

Returns:
the DataTableModel in which the Exception occurred, or null if not applicable.

getAction

public int getAction()
Return the action which caused the Exception. The action will be one of the DataModelEvents.

Returns:
an int which is one of DataModelEvents.
See Also:
DataModelEvent

getWrappedException

public Exception getWrappedException()
Return the Exception that wrapped by this DataModelException.

Returns:
the wrapped Exception.

Copyright © 2004 Quest Software Inc..
All rights reserved.