org.owasp.esapi.errors
Class ValidationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.owasp.esapi.errors.EnterpriseSecurityException
              extended by org.owasp.esapi.errors.ValidationException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ValidationAvailabilityException, ValidationUploadException

public class ValidationException
extends EnterpriseSecurityException

A ValidationException should be thrown to indicate that the data provided by the user or from some other external source does not match the validation rules that have been specified for that data.

Author:
Jeff Williams ([email protected])
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
           
 
Fields inherited from class org.owasp.esapi.errors.EnterpriseSecurityException
logger, logMessage
 
Constructor Summary
protected ValidationException()
          Instantiates a new validation exception.
  ValidationException(java.lang.String userMessage, java.lang.String logMessage)
          Creates a new instance of ValidationException.
  ValidationException(java.lang.String userMessage, java.lang.String logMessage, java.lang.String context)
          Creates a new instance of ValidationException.
  ValidationException(java.lang.String userMessage, java.lang.String logMessage, java.lang.Throwable cause)
          Instantiates a new ValidationException.
  ValidationException(java.lang.String userMessage, java.lang.String logMessage, java.lang.Throwable cause, java.lang.String context)
          Instantiates a new ValidationException.
 
Method Summary
 java.lang.String getContext()
          Returns the UI reference that caused this ValidationException
 void setContext(java.lang.String context)
          Set's the UI reference that caused this ValidationException
 
Methods inherited from class org.owasp.esapi.errors.EnterpriseSecurityException
getLogMessage, getUserMessage
 
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

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ValidationException

protected ValidationException()
Instantiates a new validation exception.


ValidationException

public ValidationException(java.lang.String userMessage,
                           java.lang.String logMessage)
Creates a new instance of ValidationException.

Parameters:
userMessage - the message to display to users
logMessage - the message logged

ValidationException

public ValidationException(java.lang.String userMessage,
                           java.lang.String logMessage,
                           java.lang.Throwable cause)
Instantiates a new ValidationException.

Parameters:
userMessage - the message to display to users
logMessage - the message logged
cause - the cause

ValidationException

public ValidationException(java.lang.String userMessage,
                           java.lang.String logMessage,
                           java.lang.String context)
Creates a new instance of ValidationException.

Parameters:
userMessage - the message to display to users
logMessage - the message logged
context - the source that caused this exception

ValidationException

public ValidationException(java.lang.String userMessage,
                           java.lang.String logMessage,
                           java.lang.Throwable cause,
                           java.lang.String context)
Instantiates a new ValidationException.

Parameters:
userMessage - the message to display to users
logMessage - the message logged
cause - the cause
context - the source that caused this exception
Method Detail

getContext

public java.lang.String getContext()
Returns the UI reference that caused this ValidationException

Returns:
context, the source that caused the exception, stored as a string

setContext

public void setContext(java.lang.String context)
Set's the UI reference that caused this ValidationException

Parameters:
context - the context to set, passed as a String


Copyright © 2011 The Open Web Application Security Project (OWASP). All Rights Reserved.