Package com.onec.validation
Class AttributeValidator
java.lang.Object
com.onec.validation.AttributeValidator
Enforces the declarative
@Attribute constraints (required, string length, numeric
min/max, regex pattern, email) on an entity before write, collecting every failure into a
ValidationErrors keyed by field name. Works either against a typed aggregate (values
read reflectively) or against a submitted body map (the generic UI write path), so the same
rules apply however the write arrives.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidate(Object entity, List<AttributeDescriptor> attributes, ValidationErrors errors) Validate a typed aggregate, reading each attribute's value reflectively.voidvalidate(Map<String, Object> values, List<AttributeDescriptor> attributes, ValidationErrors errors) Validate a submitted body map keyed by attribute field name (the generic UI write path).
-
Constructor Details
-
AttributeValidator
public AttributeValidator()
-
-
Method Details
-
validate
Validate a typed aggregate, reading each attribute's value reflectively. -
validate
public void validate(Map<String, Object> values, List<AttributeDescriptor> attributes, ValidationErrors errors) Validate a submitted body map keyed by attribute field name (the generic UI write path).
-