|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface JavalidValidationCallbackHandler<T>
Any class can implement this interface if it wishes to function as a callback handler. When using the annotationValidator, you can pass an implementing class as parameter. The framework will then call the methods of the interface as defined in their descriptions. Which will allow you to change certain aspects or validationPath mappings and so on (or even implement custom logic yourself).
For an example check out the unit test TestJavalidValidationHandler.
| Method Summary | |
|---|---|
void |
afterValidation(T object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
java.util.List<ValidationMessage> messages)
After the validation is completed (everything), this method is called by the validator. |
void |
afterValidationRound(java.lang.Object object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
int currentLevelDeep,
int maxLevelDeep,
java.util.List<ValidationMessage> messages)
Same as beforeValidationRound, except it is called *after* validation of this object by the framework. |
void |
beforeValidation(T object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
java.util.List<ValidationMessage> messages)
Before validation is even started at all, this method is called by the validator. |
void |
beforeValidationRound(java.lang.Object object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
int currentLevelDeep,
int maxLevelDeep,
java.util.List<ValidationMessage> messages)
Before each new validation round the framework will call this method and specify what it is about to *consider* for validation. |
| Method Detail |
|---|
void beforeValidation(T object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
java.util.List<ValidationMessage> messages)
object - The object that will be validated (will be the object you gave it in the first place)currentGroup - The group you specifiedcurrentValidationPath - The starting validationpath (might be with prefix if you gave that along)messages - The messages list that will be used
void afterValidation(T object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
java.util.List<ValidationMessage> messages)
object - The object that was validated (will be the object you gave it in the first place)currentGroup - The group you specifiedcurrentValidationPath - The starting validationpath (might be with prefix if you gave that along)messages - The messages list that was used, may contain messages.
void beforeValidationRound(java.lang.Object object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
int currentLevelDeep,
int maxLevelDeep,
java.util.List<ValidationMessage> messages)
A {
private B bObject;
}
Assuming that both A and B have @ValidateDefinition annotation, and you pass for
validation an instance of A, the validator will call this method with instance A,
and later on with bObject.
Were bObject null, it would not be called of course. In other words you can change
things in any round here if required.
object - The current object under validationcurrentGroup - The current groupcurrentValidationPath - The current validation path that is usedcurrentLevelDeep - The current level depth of the validation (1 means
the object you originally passed, 2 its associations and so on).maxLevelDeep - The maximum level depth allowed (if currentLevelDeep matches this one
the validator is at maximum depth for this object).messages - The current messages list, you may alter it if needed.
void afterValidationRound(java.lang.Object object,
java.lang.String currentGroup,
java.lang.String currentValidationPath,
int currentLevelDeep,
int maxLevelDeep,
java.util.List<ValidationMessage> messages)
object - The current object under validationcurrentGroup - The current groupcurrentValidationPath - The current validation path that is usedcurrentLevelDeep - The current level depth of the validation (1 means
the object you originally passed, 2 its associations and so on).maxLevelDeep - The maximum level depth allowed (if currentLevelDeep matches this one
the validator is at maximum depth for this object).messages - The current messages list, you may alter it if needed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||