-
public interface ConstraintDescriptor<T extends Annotation>
Describes a single constraint and its composing constraints.T
is the constraint's annotation type.- Author:
- Emmanuel Bernard, Hardy Ferentschik
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description T
getAnnotation()
Returns the annotation describing the constraint declaration.Map<String,Object>
getAttributes()
Returns a map containing the annotation attribute names as keys and the annotation attribute values as value.Set<ConstraintDescriptor<?>>
getComposingConstraints()
Return a set of composingConstraintDescriptor
s where each descriptor describes a composing constraint.List<Class<? extends ConstraintValidator<T,?>>>
getConstraintValidatorClasses()
List of the constraint validation implementation classes.Set<Class<?>>
getGroups()
The set of groups the constraint is applied on.String
getMessageTemplate()
The non-interpolated error messageSet<Class<? extends Payload>>
getPayload()
The set of payload the constraint hosts.ConstraintTarget
getValidationAppliesTo()
boolean
isReportAsSingleViolation()
-
-
-
Method Detail
-
getAnnotation
T getAnnotation()
Returns the annotation describing the constraint declaration. If a composing constraint, attribute values are reflecting the overridden attributes of the composing constraint- Returns:
- the annotation for this constraint
-
getMessageTemplate
String getMessageTemplate()
The non-interpolated error message- Returns:
- the non-interpolated error message
- Since:
- 1.1
-
getGroups
Set<Class<?>> getGroups()
The set of groups the constraint is applied on. If the constraint declares no group, a set with only theDefault
group is returned.- Returns:
- the groups the constraint is applied on
-
getPayload
Set<Class<? extends Payload>> getPayload()
The set of payload the constraint hosts.- Returns:
- payload classes hosted on the constraint or an empty set if none
-
getValidationAppliesTo
ConstraintTarget getValidationAppliesTo()
- Returns:
- the
ConstraintTarget
value ornull
- Since:
- 1.1
-
getConstraintValidatorClasses
List<Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorClasses()
List of the constraint validation implementation classes.- Returns:
- list of the constraint validation implementation classes
-
getAttributes
Map<String,Object> getAttributes()
Returns a map containing the annotation attribute names as keys and the annotation attribute values as value. If this constraint is used as part of a composed constraint, attribute values are reflecting the overridden attribute of the composing constraint.- Returns:
- a map containing the annotation attribute names as keys and the annotation attribute values as value
-
getComposingConstraints
Set<ConstraintDescriptor<?>> getComposingConstraints()
Return a set of composingConstraintDescriptor
s where each descriptor describes a composing constraint.ConstraintDescriptor
instances of composing constraints reflect overridden attribute values ingetAttributes()
andgetAnnotation()
.- Returns:
- a set of
ConstraintDescriptor
objects or an empty set in case there are no composing constraints
-
isReportAsSingleViolation
boolean isReportAsSingleViolation()
- Returns:
true
if the constraint is annotated withReportAsSingleViolation
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/validation/metadata/ConstraintDescriptor.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.