|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EntityValidatorService
Validates all of the populated properties for entities
BasicPersistenceModule#createPopulatedInstance(Serializable, Entity, Map, Boolean)}| Method Summary | |
|---|---|
List<GlobalPropertyValidator> |
getGlobalEntityValidators()
|
void |
setGlobalEntityValidators(List<GlobalPropertyValidator> globalEntityValidators)
Set the global validators that will be run on every entity that is attempted to be saved in the admin. |
void |
validate(Entity entity,
Serializable instance,
Map<String,FieldMetadata> propertiesMetadata)
Validate the given entity. |
| Method Detail |
|---|
void validate(Entity entity,
Serializable instance,
Map<String,FieldMetadata> propertiesMetadata)
Entity.setValidationFailure(boolean) appropriately.
Validation is invoked after the entire instance has been populated according to
BasicPersistenceModule.createPopulatedInstance(Serializable, Entity, Map, Boolean).
entity - DTO representation of instanceinstance - actual domain representation of entitypropertiesMetadata - all of the merged properties metadata for the given Entity
InstantiationException
IllegalAccessException
ClassNotFoundExceptionList<GlobalPropertyValidator> getGlobalEntityValidators()
Entityvoid setGlobalEntityValidators(List<GlobalPropertyValidator> globalEntityValidators)
Set the global validators that will be run on every entity that is attempted to be saved in the admin. Global
validators are useful to operate on things like field types and other scenarios that could occur with a number of
entities. Rather than being required to define a ValidationConfiguration on all of those properties, this
can more conveniently validate that set of properties.
An example of a global validator in Broadleaf is the RequiredPropertyValidator which will ensure that every
property that is marked as required will fail validation if a value is unset.
globalEntityValidators - the globalEntityValidators to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||