| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springmodules.validation.validator.ConditionalValidator
public class ConditionalValidator
A validator that is associated with a condition that determines whether it should be applied on a given object or not.
| Constructor Summary | |
|---|---|
ConditionalValidator()
 | 
|
ConditionalValidator(Validator validator,
                     Condition condition)
Constructs a new ConditionalValidator with a given underlying validator and the condition.  | 
|
| Method Summary | |
|---|---|
 Condition | 
getCondition()
Returns the condition associated with this conditional validator.  | 
 Validator | 
getValidator()
Returns the underlying validator.  | 
 void | 
setCondition(Condition condition)
Sets the condition of this conditional validator.  | 
 void | 
setValidator(Validator validator)
Sets the underlying validator.  | 
 boolean | 
supports(Class clazz)
Returns whether this validation supports the given class.  | 
 void | 
validate(Object obj,
         Errors errors)
Validates the given objects only if the given object adheres to the associated condition.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ConditionalValidator()
public ConditionalValidator(Validator validator,
                            Condition condition)
validator - The underlying validator.condition - The condition.| Method Detail | 
|---|
public boolean supports(Class clazz)
supports in interface Validatorclazz - The class to be validated.
public void validate(Object obj,
                     Errors errors)
validate in interface Validatorobj - The validated object.errors - The registery where validation error codes will be registered.public void setCondition(Condition condition)
condition - The condition of this conditional validator.public Condition getCondition()
public void setValidator(Validator validator)
validator - The underlying validator.public Validator getValidator()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||