jef.dna.exceptions
Class ValidationExceptionAncestor

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by jef.dna.exceptions.ValidationExceptionAncestor
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AttributeOutOfRangeException, AttributeValidationException, ConstantInfoAttributeOutOfRangeException, ConstantInfoValidationException, FieldInfoValidationException, InfoStructureAttributeOutOfRangeException

public class ValidationExceptionAncestor
extends java.lang.Exception

Ancestor class gathering all the methods common to every more specialized validation exception class.

Author:
Francesco Russo
See Also:
Serialized Form

Field Summary
protected  java.lang.Object actualValue
           
protected  java.lang.String attribute
           
protected  java.lang.Object expectedValue
           
protected  IndexOutOfRangeException innerIore
           
protected  java.lang.String msg
           
protected  java.lang.Object srcEntity
           
 
Constructor Summary
ValidationExceptionAncestor(java.lang.Object srcEntity, java.lang.String attribute, java.lang.Object actualValue, java.lang.Object expectedValue, java.lang.String msg)
          Creates a new instance of ValidationExceptionAncestor without detail message.
 
Method Summary
 java.lang.Object getActualValue()
          Return the actual value associated with the attribute over which the validation process failed.
 java.lang.String getAttribute()
          Return the name of the attribute whose value does not agree with the specification.
 ValidationExceptionHelper getHelper()
          Returns a ValidationExceptionHelper instance for abstracting from all the reflection related issues necessary for retreiving the actual value of those attributes over which the validation process failed.
 IndexOutOfRangeException getInnerIndexOutOfRangeException()
          This method should be useful to XxxOutOfRangeException subclasses.
 java.lang.String getMessage()
          Returns a user friendly message describing the exception.
 java.lang.Object getSrcEntity()
          Return the object that originated the exception
 void setInnerIndexOutOfRangeException(IndexOutOfRangeException e)
          This method should be useful to XxxOutOfRangeException subclasses.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

srcEntity

protected java.lang.Object srcEntity

attribute

protected java.lang.String attribute

actualValue

protected java.lang.Object actualValue

expectedValue

protected java.lang.Object expectedValue

msg

protected java.lang.String msg

innerIore

protected IndexOutOfRangeException innerIore
Constructor Detail

ValidationExceptionAncestor

public ValidationExceptionAncestor(java.lang.Object srcEntity,
                                   java.lang.String attribute,
                                   java.lang.Object actualValue,
                                   java.lang.Object expectedValue,
                                   java.lang.String msg)
Creates a new instance of ValidationExceptionAncestor without detail message.

Method Detail

getSrcEntity

public java.lang.Object getSrcEntity()
Return the object that originated the exception

Returns:
Object

getAttribute

public java.lang.String getAttribute()
Return the name of the attribute whose value does not agree with the specification. This name might be used along with relection for further inspections by the exception catcher. It is sufficient prefixing the returned string with get or set for obtaining or changing the actual value of the inspected attribute.

Returns:
String The name of the attribute over which the validation failed

getActualValue

public java.lang.Object getActualValue()
Return the actual value associated with the attribute over which the validation process failed.

Returns:
Object The actual value

getMessage

public java.lang.String getMessage()
Returns a user friendly message describing the exception.

Overrides:
getMessage in class java.lang.Throwable
Returns:
String A description message

setInnerIndexOutOfRangeException

public void setInnerIndexOutOfRangeException(IndexOutOfRangeException e)
This method should be useful to XxxOutOfRangeException subclasses. Sets the IndexOutOfRangeException which caused the current XxxOutOfRangeException to be raised.

Parameters:
e - The source of the exception

getInnerIndexOutOfRangeException

public IndexOutOfRangeException getInnerIndexOutOfRangeException()
This method should be useful to XxxOutOfRangeException subclasses. Gets the IndexOutOfRangeException which caused the current XxxOutOfRangeException to be raised.

Returns:
IndexOutOfRangeException The source of the exception

getHelper

public ValidationExceptionHelper getHelper()
Returns a ValidationExceptionHelper instance for abstracting from all the reflection related issues necessary for retreiving the actual value of those attributes over which the validation process failed.

Returns:
ValidationExceptionHelper The helper instance