org.enhydra.barracuda.core.forms
Class AbstractFormValidator
java.lang.Object
org.enhydra.barracuda.core.forms.AbstractFormValidator
- All Implemented Interfaces:
- FormValidator
- Direct Known Subclasses:
- And, DefaultFormValidator, ListValidator, Not, Or
- public abstract class AbstractFormValidator
- extends Object
- implements FormValidator
The root implementation of the FormValidator interface
Field Summary |
protected static org.apache.log4j.Logger |
localLogger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
localLogger
protected static final org.apache.log4j.Logger localLogger
AbstractFormValidator
public AbstractFormValidator()
setErrorMessage
public void setErrorMessage(String ierrmsg)
- Set the error message to be used in the event of an error.
- Specified by:
setErrorMessage
in interface FormValidator
- Parameters:
ierrmsg
- the error message to be used in the event
of an error
getErrorMessage
public String getErrorMessage()
- Get the error message to be used in the event of an error.
- Specified by:
getErrorMessage
in interface FormValidator
- Returns:
- the error message to be used in the event
of an error
generateException
public ValidationException generateException(Object source,
boolean deferExceptions,
String defaultMsg)
- This is a simple convenience method to return the appropriate type
of exception based on whether we're deferring or not.
- Parameters:
source
- the source of the exceptiondeferExceptions
- true if we want to generate a DeferredValidationExceptiondefaultMsg
- the error message to use if no error message specified in
the constructor of the validator
- Returns:
- a validation exception
isNull
public boolean isNull(Object val,
FormElement element)
- Check if val passed is null in a consistant manner.
Most validators should call isNull(val) first thing
and return if that is the case. Leave null validation
up to NotNullValidator.
- Specified by:
isNull
in interface FormValidator
- Parameters:
val
- the value to test for nullness
Copyright © 2003 BarracudaMVC.org All Rights Reserved.