org.apache.commons.latka
Class ValidationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.commons.latka.ValidationException
All Implemented Interfaces:
Serializable

public class ValidationException
extends Exception

This exception is thrown by validators when a validation has failed

Version:
$Revision: 155424 $
Author:
Doug Sale, dIon Gillard (mainly javadoc)
See Also:
Serialized Form

Constructor Summary
ValidationException()
          Create a validation exception with a null label and reason
ValidationException(String label, String reason)
          Create a validation exception with the given label and reason
 
Method Summary
 String getLabel()
          User's description of the test/assertion
 String getMessage()
          the message of the exception
 String getReason()
          Why the test/assertion failed
 
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
 

Constructor Detail

ValidationException

public ValidationException()
Create a validation exception with a null label and reason


ValidationException

public ValidationException(String label,
                           String reason)
Create a validation exception with the given label and reason

Parameters:
label - the user's description of the assertion/test
reason - the reason it failed
Method Detail

getMessage

public String getMessage()
the message of the exception

Overrides:
getMessage in class Throwable
Returns:
the message of the exception, built from the label and reason

getLabel

public String getLabel()
User's description of the test/assertion

Returns:
User's description of the test/assertion

getReason

public String getReason()
Why the test/assertion failed

Returns:
Why the test/assertion failed


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.