public class ConstraintDescriptorImpl<T extends Annotation> extends Object implements ConstraintDescriptor<T>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ConstraintDescriptorImpl.ConstraintType
The type of a constraint.
|
Constructor and Description |
---|
ConstraintDescriptorImpl(ConstraintHelper constraintHelper,
Member member,
ConstraintAnnotationDescriptor<T> annotationDescriptor,
ElementType type) |
ConstraintDescriptorImpl(ConstraintHelper constraintHelper,
Member member,
ConstraintAnnotationDescriptor<T> annotationDescriptor,
ElementType type,
Class<?> implicitGroup,
ConstraintOrigin definedOn,
ConstraintDescriptorImpl.ConstraintType externalConstraintType) |
ConstraintDescriptorImpl(ConstraintHelper constraintHelper,
Member member,
ConstraintAnnotationDescriptor<T> annotationDescriptor,
ElementType type,
ConstraintDescriptorImpl.ConstraintType constraintType) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
T |
getAnnotation()
Returns the annotation describing the constraint declaration.
|
ConstraintAnnotationDescriptor<T> |
getAnnotationDescriptor() |
Class<T> |
getAnnotationType() |
Map<String,Object> |
getAttributes()
Returns a map containing the annotation attribute names as keys and the
annotation attribute values as value.
|
Set<ConstraintDescriptorImpl<?>> |
getComposingConstraintImpls() |
Set<ConstraintDescriptor<?>> |
getComposingConstraints()
Return a set of composing
ConstraintDescriptor s where each
descriptor describes a composing constraint. |
CompositionType |
getCompositionType() |
ConstraintDescriptorImpl.ConstraintType |
getConstraintType() |
List<Class<? extends ConstraintValidator<T,?>>> |
getConstraintValidatorClasses()
List of the constraint validation implementation classes.
|
ConstraintOrigin |
getDefinedOn() |
ElementType |
getElementType() |
Set<Class<?>> |
getGroups()
The set of groups the constraint is applied on.
|
List<ConstraintValidatorDescriptor<T>> |
getMatchingConstraintValidatorDescriptors()
Return all constraint validator descriptors (either generic or cross-parameter) which are registered for the
constraint of this descriptor.
|
String |
getMessageTemplate()
The non-interpolated error message
|
Set<Class<? extends Payload>> |
getPayload()
The set of payload the constraint hosts.
|
ConstraintTarget |
getValidationAppliesTo()
|
ValidateUnwrappedValue |
getValueUnwrapping() |
int |
hashCode() |
boolean |
isReportAsSingleViolation() |
String |
toString() |
<U> U |
unwrap(Class<U> type)
Returns an instance of the specified type allowing access to provider-specific APIs.
|
public ConstraintDescriptorImpl(ConstraintHelper constraintHelper, Member member, ConstraintAnnotationDescriptor<T> annotationDescriptor, ElementType type, Class<?> implicitGroup, ConstraintOrigin definedOn, ConstraintDescriptorImpl.ConstraintType externalConstraintType)
public ConstraintDescriptorImpl(ConstraintHelper constraintHelper, Member member, ConstraintAnnotationDescriptor<T> annotationDescriptor, ElementType type)
public ConstraintDescriptorImpl(ConstraintHelper constraintHelper, Member member, ConstraintAnnotationDescriptor<T> annotationDescriptor, ElementType type, ConstraintDescriptorImpl.ConstraintType constraintType)
public ConstraintAnnotationDescriptor<T> getAnnotationDescriptor()
public T getAnnotation()
ConstraintDescriptor
getAnnotation
in interface ConstraintDescriptor<T extends Annotation>
public String getMessageTemplate()
ConstraintDescriptor
getMessageTemplate
in interface ConstraintDescriptor<T extends Annotation>
public Set<Class<?>> getGroups()
ConstraintDescriptor
Default
group is returned.getGroups
in interface ConstraintDescriptor<T extends Annotation>
public Set<Class<? extends Payload>> getPayload()
ConstraintDescriptor
getPayload
in interface ConstraintDescriptor<T extends Annotation>
public ConstraintTarget getValidationAppliesTo()
ConstraintDescriptor
getValidationAppliesTo
in interface ConstraintDescriptor<T extends Annotation>
ConstraintTarget
value or null
public ValidateUnwrappedValue getValueUnwrapping()
getValueUnwrapping
in interface ConstraintDescriptor<T extends Annotation>
ValidateUnwrappedValue
describing the unwrapping behavior as given
via the Unwrapping
constraint payloads.public List<Class<? extends ConstraintValidator<T,?>>> getConstraintValidatorClasses()
ConstraintDescriptor
getConstraintValidatorClasses
in interface ConstraintDescriptor<T extends Annotation>
public List<ConstraintValidatorDescriptor<T>> getMatchingConstraintValidatorDescriptors()
public Map<String,Object> getAttributes()
ConstraintDescriptor
If this constraint is used as part of a composed constraint, attribute values are reflecting the overridden attribute of the composing constraint.
getAttributes
in interface ConstraintDescriptor<T extends Annotation>
public Set<ConstraintDescriptor<?>> getComposingConstraints()
ConstraintDescriptor
ConstraintDescriptor
s where each
descriptor describes a composing constraint. ConstraintDescriptor
instances of composing constraints reflect overridden attribute values in
ConstraintDescriptor.getAttributes()
and ConstraintDescriptor.getAnnotation()
.getComposingConstraints
in interface ConstraintDescriptor<T extends Annotation>
ConstraintDescriptor
objects or an empty set
in case there are no composing constraintspublic Set<ConstraintDescriptorImpl<?>> getComposingConstraintImpls()
public boolean isReportAsSingleViolation()
isReportAsSingleViolation
in interface ConstraintDescriptor<T extends Annotation>
true
if the constraint is annotated with ReportAsSingleViolation
public ElementType getElementType()
public ConstraintOrigin getDefinedOn()
public ConstraintDescriptorImpl.ConstraintType getConstraintType()
public <U> U unwrap(Class<U> type)
ConstraintDescriptor
If the Jakarta Bean Validation provider implementation does not support the specified class,
a ValidationException
is thrown.
unwrap
in interface ConstraintDescriptor<T extends Annotation>
U
- the type of the object to be returnedtype
- the class of the object to be returnedpublic CompositionType getCompositionType()
Copyright © 2021 JBoss by Red Hat. All rights reserved.