public class DefaultConstraintsEvaluator extends Object implements ConstraintsEvaluator
Modifier and Type | Field and Description |
---|---|
protected Configuration |
configuration |
protected MessageSource |
messageSource |
PROPERTY_NAME
Constructor and Description |
---|
DefaultConstraintsEvaluator() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyDefaultConstraints(String propertyName,
Property p,
ConstrainedProperty cp,
Map<String,List<ConstraintDef>> defaultConstraints) |
protected void |
applyDefaultNullableConstraint(ConstrainedProperty cp) |
protected void |
applyDefaultNullableConstraint(Property p,
ConstrainedProperty cp) |
protected void |
applyMapOfConstraints(Map<String,Object> constraints,
String propertyName,
Property p,
ConstrainedProperty cp) |
protected void |
applySharedConstraints(ConstrainedPropertyAssembler constrainedPropertyBuilder,
Map<String,ConstrainedProperty> constrainedProperties,
Map<String,List<ConstraintDef>> defaultConstraints) |
protected boolean |
canApplyNullableConstraint(String propertyName,
Property property,
ConstrainedProperty constrainedProperty) |
Map<String,ConstrainedProperty> |
evaluate(Class<?> cls)
Evaluate constraints for the given class
|
Map<String,ConstrainedProperty> |
evaluate(Class<?> cls,
Property[] properties)
Evaluate constraints for the given Class and properties
|
Map<String,ConstrainedProperty> |
evaluate(Object object,
Property[] properties)
Evaluate constraints for the given object and properties
|
protected Map<String,ConstrainedProperty> |
evaluateConstraints(Class<?> theClass,
Property[] properties) |
protected static LinkedList<?> |
getSuperClassChain(Class<?> theClass) |
protected boolean |
isConstrainableProperty(Property p,
String propertyName) |
protected boolean |
isConstrainableProperty(String propertyName) |
@Inject @Named(value="applicationMessageSource") protected MessageSource messageSource
@Inject protected Configuration configuration
@Nonnull public Map<String,ConstrainedProperty> evaluate(@Nonnull Class<?> cls)
ConstraintsEvaluator
evaluate
in interface ConstraintsEvaluator
cls
- The class to evaluate constraints for@Nonnull public Map<String,ConstrainedProperty> evaluate(@Nonnull Object object, @Nonnull Property[] properties)
ConstraintsEvaluator
evaluate
in interface ConstraintsEvaluator
object
- The objectproperties
- The validatable class properties@Nonnull public Map<String,ConstrainedProperty> evaluate(@Nonnull Class<?> cls, @Nonnull Property[] properties)
ConstraintsEvaluator
evaluate
in interface ConstraintsEvaluator
cls
- The objectproperties
- The validatable class properties@Nonnull protected Map<String,ConstrainedProperty> evaluateConstraints(Class<?> theClass, Property[] properties)
protected void applySharedConstraints(ConstrainedPropertyAssembler constrainedPropertyBuilder, Map<String,ConstrainedProperty> constrainedProperties, Map<String,List<ConstraintDef>> defaultConstraints)
@Nonnull protected static LinkedList<?> getSuperClassChain(@Nonnull Class<?> theClass)
protected void applyDefaultConstraints(String propertyName, Property p, ConstrainedProperty cp, Map<String,List<ConstraintDef>> defaultConstraints)
protected void applyDefaultNullableConstraint(Property p, ConstrainedProperty cp)
protected void applyDefaultNullableConstraint(ConstrainedProperty cp)
protected boolean canApplyNullableConstraint(String propertyName, Property property, ConstrainedProperty constrainedProperty)
protected void applyMapOfConstraints(Map<String,Object> constraints, String propertyName, Property p, ConstrainedProperty cp)
protected boolean isConstrainableProperty(String propertyName)