Package org.owasp.esapi.errors
Class ValidationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.owasp.esapi.errors.EnterpriseSecurityException
-
- 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 (jeff.williams@aspectsecurity.com)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static long
serialVersionUID
-
Fields inherited from class org.owasp.esapi.errors.EnterpriseSecurityException
logger, logMessage
-
-
Constructor Summary
Constructors Modifier Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getContext()
Returns the UI reference that caused this ValidationExceptionvoid
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
-
-
-
-
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 userslogMessage
- 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 userslogMessage
- the message loggedcause
- 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 userslogMessage
- the message loggedcontext
- 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 userslogMessage
- the message loggedcause
- the causecontext
- 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
-
-