Class TypeElementConstraintDescriptorImpl<T extends AnnotationMirror>
java.lang.Object
de.knightsoftnet.validators.annotation.processor.TypeElementConstraintDescriptorImpl<T>
- All Implemented Interfaces:
TypeElementConstraintDescriptor<T>
public class TypeElementConstraintDescriptorImpl<T extends AnnotationMirror>
extends Object
implements TypeElementConstraintDescriptor<T>
-
Constructor Summary
ConstructorsConstructorDescriptionTypeElementConstraintDescriptorImpl(AnnotationMirror annotation, Elements elementUtils, org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKind constraintLocationKind) default constructor initializing stuff.TypeElementConstraintDescriptorImpl(AnnotationMirror annotation, Elements elementUtils, org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKind constraintLocationKind, Map<String, Map.Entry<? extends ExecutableElement, ? extends AnnotationValue>> overrideFromParent) default constructor initializing stuff. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<TypeElementConstraintDescriptor<?>>createComposingConstraintsForElement(Element element, Elements elementUtils, org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKind constraintLocationKind, Map<String, Map<String, Map.Entry<? extends ExecutableElement, ? extends AnnotationValue>>> overridesMap) create composing constraints for element.Returns the annotation describing the constraint declaration.Map<String,Map.Entry<? extends ExecutableElement, ? extends AnnotationValue>> Returns a map containing the annotation attribute names as keys and the annotation attribute values as value.Return a set of composingConstraintDescriptors where each descriptor describes a composing constraint.org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKindget constraint location kind.List of the constraint validation implementation classes.org.hibernate.validator.internal.metadata.core.ConstraintOriginget defined on.The set of groups the constraint is applied on.The set of payload the constraint hosts.booleancheck if this is reported as single violation.
-
Constructor Details
-
TypeElementConstraintDescriptorImpl
public TypeElementConstraintDescriptorImpl(AnnotationMirror annotation, Elements elementUtils, org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKind constraintLocationKind) default constructor initializing stuff.- Parameters:
annotation- annotation mirror to fill data fromelementUtils- utility for elements
-
TypeElementConstraintDescriptorImpl
public TypeElementConstraintDescriptorImpl(AnnotationMirror annotation, Elements elementUtils, org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKind constraintLocationKind, Map<String, Map.Entry<? extends ExecutableElement, ? extends AnnotationValue>> overrideFromParent) default constructor initializing stuff.- Parameters:
annotation- annotation mirror to fill data fromelementUtils- utility for elements
-
-
Method Details
-
createComposingConstraintsForElement
public static List<TypeElementConstraintDescriptor<?>> createComposingConstraintsForElement(Element element, Elements elementUtils, org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKind constraintLocationKind, Map<String, Map<String, Map.Entry<? extends ExecutableElement, ? extends AnnotationValue>>> overridesMap) create composing constraints for element.- Parameters:
element- the element to create forelementUtils- element utils to work withoverridesMap- override maps- Returns:
- list of TypeElementConstraintDescriptors
-
getAnnotation
Description copied from interface:TypeElementConstraintDescriptorReturns the annotation describing the constraint declaration. If a composing constraint, attribute values are reflecting the overridden attributes of the composing constraint- Specified by:
getAnnotationin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- the annotation for this constraint
-
getAttributes
Description copied from interface:TypeElementConstraintDescriptorReturns 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.
- Specified by:
getAttributesin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- a map containing the annotation attribute names as keys and the annotation attribute values as value
-
getComposingConstraints
Description copied from interface:TypeElementConstraintDescriptorReturn a set of composingConstraintDescriptors where each descriptor describes a composing constraint.ConstraintDescriptorinstances of composing constraints reflect overridden attribute values inTypeElementConstraintDescriptor.getAttributes()andTypeElementConstraintDescriptor.getAnnotation().- Specified by:
getComposingConstraintsin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- a set of
TypeElementConstraintDescriptorobjects or an empty set in case there are no composing constraints
-
getConstraintValidatorClasses
Description copied from interface:TypeElementConstraintDescriptorList of the constraint validation implementation classes.- Specified by:
getConstraintValidatorClassesin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- list of the constraint validation implementation classes
-
getGroups
Description copied from interface:TypeElementConstraintDescriptorThe set of groups the constraint is applied on. If the constraint declares no group, a set with only theDefaultgroup is returned.- Specified by:
getGroupsin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- the groups the constraint is applied on
-
getPayload
Description copied from interface:TypeElementConstraintDescriptorThe set of payload the constraint hosts.- Specified by:
getPayloadin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- payload classes hosted on the constraint or an empty set if none
-
isReportAsSingleViolation
public boolean isReportAsSingleViolation()Description copied from interface:TypeElementConstraintDescriptorcheck if this is reported as single violation.- Specified by:
isReportAsSingleViolationin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
trueif the constraint is annotated withReportAsSingleViolation
-
getDefinedOn
public org.hibernate.validator.internal.metadata.core.ConstraintOrigin getDefinedOn()Description copied from interface:TypeElementConstraintDescriptorget defined on.- Specified by:
getDefinedOnin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- constraint origin
-
getConstraintLocationKind
public org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKind getConstraintLocationKind()Description copied from interface:TypeElementConstraintDescriptorget constraint location kind.- Specified by:
getConstraintLocationKindin interfaceTypeElementConstraintDescriptor<T extends AnnotationMirror>- Returns:
- constraint location kind
-