Interface FieldValidator
- All Known Implementing Classes:
AbstractFieldValidator
,NotNullFieldValidatorImpl
,TodoDateFieldPathValidator
,UniqueFieldValidatorImpl
,XssProtectionFieldValidator
public interface FieldValidator
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addMyself
(EntityModel entityModel, FieldModel fieldModel) Implement this method to return true if the Validator should add itself to the FieldModel at hand.getName()
void
validate
(List<Entity> entities, FieldModel fieldModel, Map<Entity, FieldValidationResult> fieldValidationResults, ValidationContext validationContext) Validate the field at hand.
-
Method Details
-
validate
void validate(List<Entity> entities, FieldModel fieldModel, Map<Entity, FieldValidationResult> fieldValidationResults, ValidationContext validationContext) Validate the field at hand.- Parameters:
entities
- the entities to be validatedfieldModel
- the fieldModel to be validatedfieldValidationResults
- the FieldValdationResult to write the result of the validation to.FieldValidationResult
for more details on how to construct the FieldValidationResult.
-
addMyself
Implement this method to return true if the Validator should add itself to the FieldModel at hand. This method can be useful, if a validator is being used for all field types meeting a certain requirement (e.g. a specific type). The method is called for each field model at application startup when building the entity model.- Parameters:
entityModel
- the EntityModelfieldModel
- the FieldModel- Returns:
- true to add the Validator to the EntityModel at hand
-
getName
String getName()
-