Class ConstraintDescriptions
java.lang.Object
org.springframework.restdocs.constraints.ConstraintDescriptions
Provides access to descriptions of a class's constraints.
- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorsConstructorDescriptionConstraintDescriptions(Class<?> clazz) Create a newConstraintDescriptionsfor the givenclazz.ConstraintDescriptions(Class<?> clazz, ConstraintDescriptionResolver descriptionResolver) Create a newConstraintDescriptionsfor the givenclazz.ConstraintDescriptions(Class<?> clazz, ConstraintResolver constraintResolver) Create a newConstraintDescriptionsfor the givenclazz.ConstraintDescriptions(Class<?> clazz, ConstraintResolver constraintResolver, ConstraintDescriptionResolver descriptionResolver) Create a newConstraintDescriptionsfor the givenclazz. -
Method Summary
Modifier and TypeMethodDescriptiondescriptionsForProperty(String property) Returns a list of the descriptions for the constraints on the given property.
-
Constructor Details
-
ConstraintDescriptions
Create a newConstraintDescriptionsfor the givenclazz. Constraints will be resolved using aValidatorConstraintResolverand descriptions will be resolved using aResourceBundleConstraintDescriptionResolver.- Parameters:
clazz- the class
-
ConstraintDescriptions
Create a newConstraintDescriptionsfor the givenclazz. Constraints will be resolved using the givenconstraintResolverand descriptions will be resolved using aResourceBundleConstraintDescriptionResolver.- Parameters:
clazz- the classconstraintResolver- the constraint resolver
-
ConstraintDescriptions
Create a newConstraintDescriptionsfor the givenclazz. Constraints will be resolved using aValidatorConstraintResolverand descriptions will be resolved using the givendescriptionResolver.- Parameters:
clazz- the classdescriptionResolver- the description resolver
-
ConstraintDescriptions
public ConstraintDescriptions(Class<?> clazz, ConstraintResolver constraintResolver, ConstraintDescriptionResolver descriptionResolver) Create a newConstraintDescriptionsfor the givenclazz. Constraints will be resolved using the givenconstraintResolverand descriptions will be resolved using the givendescriptionResolver.- Parameters:
clazz- the classconstraintResolver- the constraint resolverdescriptionResolver- the description resolver
-
-
Method Details
-
descriptionsForProperty
Returns a list of the descriptions for the constraints on the given property.- Parameters:
property- the property- Returns:
- the list of constraint descriptions
-