Class ConstraintDescriptions
java.lang.Object
org.springframework.restdocs.constraints.ConstraintDescriptions
Provides access to descriptions of a class's constraints.
- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorDescriptionConstraintDescriptions
(Class<?> clazz) Create a newConstraintDescriptions
for the givenclazz
.ConstraintDescriptions
(Class<?> clazz, ConstraintDescriptionResolver descriptionResolver) Create a newConstraintDescriptions
for the givenclazz
.ConstraintDescriptions
(Class<?> clazz, ConstraintResolver constraintResolver) Create a newConstraintDescriptions
for the givenclazz
.ConstraintDescriptions
(Class<?> clazz, ConstraintResolver constraintResolver, ConstraintDescriptionResolver descriptionResolver) Create a newConstraintDescriptions
for 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 newConstraintDescriptions
for the givenclazz
. Constraints will be resolved using aValidatorConstraintResolver
and descriptions will be resolved using aResourceBundleConstraintDescriptionResolver
.- Parameters:
clazz
- the class
-
ConstraintDescriptions
Create a newConstraintDescriptions
for the givenclazz
. Constraints will be resolved using the givenconstraintResolver
and descriptions will be resolved using aResourceBundleConstraintDescriptionResolver
.- Parameters:
clazz
- the classconstraintResolver
- the constraint resolver
-
ConstraintDescriptions
Create a newConstraintDescriptions
for the givenclazz
. Constraints will be resolved using aValidatorConstraintResolver
and 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 newConstraintDescriptions
for the givenclazz
. Constraints will be resolved using the givenconstraintResolver
and 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
-