com.taursys.model
Class ModelException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.taursys.util.ChainedException
              extended bycom.taursys.model.ModelException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ModelParseException, ModelPropertyAccessorException, SelectModelException, UnknownStateValueException

public class ModelException
extends ChainedException

General Exception for problems encountered in Model objects.

See Also:
Serialized Form

Field Summary
static int REASON_INTERNAL_ERROR
           
static int REASON_MODEL_IS_WRONG_CLASS
           
static int REASON_MULTI_PROPERTY_MISMATCH
           
static int REASON_OBJECTS_ARE_IMMUTABLE
           
static int REASON_OFFSET
           
static int REASON_PARSE_CONVERSION_ERROR
           
 
Fields inherited from class com.taursys.util.ChainedException
cause, diagnosticInfo, reason, REASON_INVALID_REASON_CODE, REASON_UNSPECIFIED, userFriendlyMessage
 
Constructor Summary
  ModelException(int reason)
          Creates a ModelException with a reason code (which will display its message).
  ModelException(int reason, java.lang.String diagnosticInfo)
          Creates a ModelException with a reason code (which will display its message).
  ModelException(int reason, java.lang.Throwable cause)
          Creates a ModelException with a reason code (which will display its message).
protected ModelException(java.lang.String message, int reason)
          Creates a ChainedException with a message.
protected ModelException(java.lang.String message, int reason, java.lang.Throwable cause)
          Creates a ChainedException with a message.
 
Method Summary
static java.lang.String getReasonMessage(int reason)
          Returns String for given reason code else String for REASON_INVALID_REASON_CODE.
 
Methods inherited from class com.taursys.util.ChainedException
getCause, getDiagnosticInfo, getInvalidMessage, getLocalizedMessage, getReason, getUserFriendlyMessage, main, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REASON_OFFSET

public static final int REASON_OFFSET
See Also:
Constant Field Values

REASON_MODEL_IS_WRONG_CLASS

public static final int REASON_MODEL_IS_WRONG_CLASS
See Also:
Constant Field Values

REASON_OBJECTS_ARE_IMMUTABLE

public static final int REASON_OBJECTS_ARE_IMMUTABLE
See Also:
Constant Field Values

REASON_INTERNAL_ERROR

public static final int REASON_INTERNAL_ERROR
See Also:
Constant Field Values

REASON_PARSE_CONVERSION_ERROR

public static final int REASON_PARSE_CONVERSION_ERROR
See Also:
Constant Field Values

REASON_MULTI_PROPERTY_MISMATCH

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

ModelException

public ModelException(int reason)
Creates a ModelException with a reason code (which will display its message).


ModelException

public ModelException(int reason,
                      java.lang.Throwable cause)
Creates a ModelException with a reason code (which will display its message).


ModelException

public ModelException(int reason,
                      java.lang.String diagnosticInfo)
Creates a ModelException with a reason code (which will display its message).


ModelException

protected ModelException(java.lang.String message,
                         int reason)
Creates a ChainedException with a message. This constructor is only available to subclasses


ModelException

protected ModelException(java.lang.String message,
                         int reason,
                         java.lang.Throwable cause)
Creates a ChainedException with a message. This constructor is only available to subclasses. This constructor appends the cause message to given message separated by a ": ". It then stores the message, reason code and cause.

Method Detail

getReasonMessage

public static java.lang.String getReasonMessage(int reason)
Returns String for given reason code else String for REASON_INVALID_REASON_CODE.



Copyright © 2007 Martin T Phelan. All Rights Reserved.