|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.iscreen.BaseValidator
public abstract class BaseValidator
This abstract class acts as a base class for custom validators. Sub-classes can extend this class to take advantage of the default implementation this class provides.
Field Summary | |
---|---|
protected FailureMessage |
defaultFailure
|
Constructor Summary | |
---|---|
BaseValidator()
|
Method Summary | |
---|---|
java.lang.Object |
constructBeanToValidate()
This is called prior to calling the validate() method. |
FailureMessage |
getDefaultFailure()
Retrieves the default failure message. |
protected java.lang.String |
getStringValue(java.lang.Object obj)
Gets the object to validate as a String. |
protected java.lang.Object |
getValue(java.lang.Object simpleBean)
This method assumes the passed-in object is a SimpleBean. |
void |
setDefaultFailure(FailureMessage failure)
Sets the failure message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.iscreen.Validator |
---|
validate |
Field Detail |
---|
protected FailureMessage defaultFailure
Constructor Detail |
---|
public BaseValidator()
Method Detail |
---|
public java.lang.Object constructBeanToValidate()
Validator
constructBeanToValidate
in interface Validator
public FailureMessage getDefaultFailure()
public void setDefaultFailure(FailureMessage failure)
failure
- The default failure message to use.protected java.lang.String getStringValue(java.lang.Object obj)
public void validate( ValidatorContext context, Object beanToValidate )
{
String str;
str = getStringValue( beanToValidate );
...
}
obj
- The object being validated.
protected java.lang.Object getValue(java.lang.Object simpleBean)
simpleBean
- The SimpleBean the validator is going to validate.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |