com.taursys.model
Class ModelPropertyAccessorException

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

public class ModelPropertyAccessorException
extends ModelException

ModelExceptions encountered while accessing properties. This exception stores information about the reason and various other meaningful data whenever an Exception occurs in a PropertyAccessor.

See Also:
Serialized Form

Field Summary
protected static java.lang.String[] friendlyMessages
           
protected  java.lang.String givenValueDataType
           
protected  java.lang.String givenValueObjectClassName
           
protected static java.lang.String[] messages
           
protected  java.lang.String methodName
           
protected  java.lang.String propertyDataType
           
protected  java.lang.String propertyName
           
static int REASON_ILLEGAL_ACCESS_EXCEPTION
           
static int REASON_ILLEGAL_ARGUMENT_EXCEPTION
           
static int REASON_INTROSPECTION_EXCEPTION
           
static int REASON_NO_READ_METHOD_FOR_PROPERTY
           
static int REASON_NO_WRITE_METHOD_FOR_PROPERTY
           
static int REASON_NULL_VALUE_FOR_PRIMATIVE
           
static int REASON_OFFSET
           
static int REASON_PROPERTY_NAME_MISSING
           
static int REASON_PROPERTY_NOT_FOUND
           
static int REASON_TARGET_AND_CLASS_ARE_NULL
           
static int REASON_TARGET_CLASS_IS_NULL
           
static int REASON_TARGET_IS_NULL
           
protected  java.lang.String valueObjectClassName
           
 
Fields inherited from class com.taursys.model.ModelException
REASON_INTERNAL_ERROR, REASON_MODEL_IS_WRONG_CLASS, REASON_MULTI_PROPERTY_MISMATCH, REASON_OBJECTS_ARE_IMMUTABLE, REASON_PARSE_CONVERSION_ERROR
 
Fields inherited from class com.taursys.util.ChainedException
cause, diagnosticInfo, reason, REASON_INVALID_REASON_CODE, REASON_UNSPECIFIED, userFriendlyMessage
 
Constructor Summary
  ModelPropertyAccessorException(int reason, java.lang.Class voClass, java.lang.String propertyName)
          Constructs exception for given reason, VO class and propertyName.
  ModelPropertyAccessorException(int reason, java.lang.Class voClass, java.lang.String propertyName, int javaDataType, java.lang.Object target, java.lang.reflect.Method method)
          Constructs exception for given reason, VO class, propertyName, data type, target object, and invoked method.
  ModelPropertyAccessorException(int reason, java.lang.Class voClass, java.lang.String propertyName, int javaDataType, java.lang.Object target, java.lang.reflect.Method method, java.lang.Throwable cause)
          Constructs exception for given reason, VO class, propertyName, data type, target object, invoked method and cause.
  ModelPropertyAccessorException(int reason, java.lang.Class voClass, java.lang.String propertyName, int javaDataType, java.lang.Object target, java.lang.Object value, java.lang.reflect.Method method, java.lang.Throwable cause)
          Constructs exception for given reason, VO class, propertyName, data type, invoked method and cause.
protected ModelPropertyAccessorException(java.lang.String message, int reason)
          Creates a ChainedException with a message.
 
Method Summary
 java.lang.String getGivenValueDataType()
          Returns the class name of the given value
 java.lang.String getGivenValueObjectClassName()
          Returns the class name of the given value object for the operation
 java.lang.String getMethodName()
          Returns method name involved in exception
 java.lang.String getPropertyDataType()
          Returns the data type of the property
 java.lang.String getPropertyName()
          Returns property name involved in exception
static java.lang.String getReasonMessage(int reason)
          Returns String for given reason code else String for REASON_INVALID_REASON_CODE.
 java.lang.String getValueObjectClassName()
          Returns class name involved in exception
protected  void setDiagnosticsInfo()
          Builds the diagnosticsInfo String from the current property values.
protected  void setGivenValueDataType(java.lang.Object value)
          Sets the class name of the given value else "null" if null.
protected  void setGivenValueObjectClassName(java.lang.Object given)
          Sets the class name for the given object else "null" if null.
protected  void setMethodName(java.lang.reflect.Method method)
          Sets the method name for the given method.
protected  void setPropertyDataType(int javaDataType)
          Sets the property data type for the given type code
protected  void setValueObjectClassName(java.lang.Class voClass)
          Sets the valueObject class name for the given class else "null" if null.
 
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_TARGET_CLASS_IS_NULL

public static final int REASON_TARGET_CLASS_IS_NULL
See Also:
Constant Field Values

REASON_PROPERTY_NAME_MISSING

public static final int REASON_PROPERTY_NAME_MISSING
See Also:
Constant Field Values

REASON_PROPERTY_NOT_FOUND

public static final int REASON_PROPERTY_NOT_FOUND
See Also:
Constant Field Values

REASON_NO_READ_METHOD_FOR_PROPERTY

public static final int REASON_NO_READ_METHOD_FOR_PROPERTY
See Also:
Constant Field Values

REASON_NO_WRITE_METHOD_FOR_PROPERTY

public static final int REASON_NO_WRITE_METHOD_FOR_PROPERTY
See Also:
Constant Field Values

REASON_INTROSPECTION_EXCEPTION

public static final int REASON_INTROSPECTION_EXCEPTION
See Also:
Constant Field Values

REASON_ILLEGAL_ACCESS_EXCEPTION

public static final int REASON_ILLEGAL_ACCESS_EXCEPTION
See Also:
Constant Field Values

REASON_TARGET_IS_NULL

public static final int REASON_TARGET_IS_NULL
See Also:
Constant Field Values

REASON_ILLEGAL_ARGUMENT_EXCEPTION

public static final int REASON_ILLEGAL_ARGUMENT_EXCEPTION
See Also:
Constant Field Values

REASON_TARGET_AND_CLASS_ARE_NULL

public static final int REASON_TARGET_AND_CLASS_ARE_NULL
See Also:
Constant Field Values

REASON_NULL_VALUE_FOR_PRIMATIVE

public static final int REASON_NULL_VALUE_FOR_PRIMATIVE
See Also:
Constant Field Values

messages

protected static final java.lang.String[] messages

friendlyMessages

protected static final java.lang.String[] friendlyMessages

propertyName

protected java.lang.String propertyName

valueObjectClassName

protected java.lang.String valueObjectClassName

methodName

protected java.lang.String methodName

givenValueObjectClassName

protected java.lang.String givenValueObjectClassName

propertyDataType

protected java.lang.String propertyDataType

givenValueDataType

protected java.lang.String givenValueDataType
Constructor Detail

ModelPropertyAccessorException

public ModelPropertyAccessorException(int reason,
                                      java.lang.Class voClass,
                                      java.lang.String propertyName)
Constructs exception for given reason, VO class and propertyName.


ModelPropertyAccessorException

public ModelPropertyAccessorException(int reason,
                                      java.lang.Class voClass,
                                      java.lang.String propertyName,
                                      int javaDataType,
                                      java.lang.Object target,
                                      java.lang.Object value,
                                      java.lang.reflect.Method method,
                                      java.lang.Throwable cause)
Constructs exception for given reason, VO class, propertyName, data type, invoked method and cause.


ModelPropertyAccessorException

public ModelPropertyAccessorException(int reason,
                                      java.lang.Class voClass,
                                      java.lang.String propertyName,
                                      int javaDataType,
                                      java.lang.Object target,
                                      java.lang.reflect.Method method)
Constructs exception for given reason, VO class, propertyName, data type, target object, and invoked method.


ModelPropertyAccessorException

public ModelPropertyAccessorException(int reason,
                                      java.lang.Class voClass,
                                      java.lang.String propertyName,
                                      int javaDataType,
                                      java.lang.Object target,
                                      java.lang.reflect.Method method,
                                      java.lang.Throwable cause)
Constructs exception for given reason, VO class, propertyName, data type, target object, invoked method and cause.


ModelPropertyAccessorException

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

Method Detail

getReasonMessage

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


setDiagnosticsInfo

protected void setDiagnosticsInfo()
Builds the diagnosticsInfo String from the current property values.


setPropertyDataType

protected void setPropertyDataType(int javaDataType)
Sets the property data type for the given type code


getPropertyDataType

public java.lang.String getPropertyDataType()
Returns the data type of the property


getPropertyName

public java.lang.String getPropertyName()
Returns property name involved in exception


setValueObjectClassName

protected void setValueObjectClassName(java.lang.Class voClass)
Sets the valueObject class name for the given class else "null" if null.


getValueObjectClassName

public java.lang.String getValueObjectClassName()
Returns class name involved in exception


setMethodName

protected void setMethodName(java.lang.reflect.Method method)
Sets the method name for the given method.


getMethodName

public java.lang.String getMethodName()
Returns method name involved in exception


setGivenValueObjectClassName

protected void setGivenValueObjectClassName(java.lang.Object given)
Sets the class name for the given object else "null" if null.


getGivenValueObjectClassName

public java.lang.String getGivenValueObjectClassName()
Returns the class name of the given value object for the operation


setGivenValueDataType

protected void setGivenValueDataType(java.lang.Object value)
Sets the class name of the given value else "null" if null.


getGivenValueDataType

public java.lang.String getGivenValueDataType()
Returns the class name of the given value



Copyright © 2007 Martin T Phelan. All Rights Reserved.