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
Constructors Constructor Description TypeElementConstraintDescriptorImpl(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.TgetAnnotation()Returns the annotation describing the constraint declaration.Map<String,Map.Entry<? extends ExecutableElement,? extends AnnotationValue>>getAttributes()Returns a map containing the annotation attribute names as keys and the annotation attribute values as value.List<TypeElementConstraintDescriptor<?>>getComposingConstraints()Return a set of composingConstraintDescriptors where each descriptor describes a composing constraint.org.hibernate.validator.internal.metadata.location.ConstraintLocation.ConstraintLocationKindgetConstraintLocationKind()get constraint location kind.List<TypeMirror>getConstraintValidatorClasses()List of the constraint validation implementation classes.org.hibernate.validator.internal.metadata.core.ConstraintOrigingetDefinedOn()get defined on.Set<TypeMirror>getGroups()The set of groups the constraint is applied on.Set<TypeElement>getPayload()The set of payload the constraint hosts.booleanisReportAsSingleViolation()check if this is reported as single violation.
-
-
-
Constructor Detail
-
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 Detail
-
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
public T 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
public Map<String,Map.Entry<? extends ExecutableElement,? extends AnnotationValue>> 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
public List<TypeElementConstraintDescriptor<?>> 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
public List<TypeMirror> 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
public Set<TypeMirror> 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
public Set<TypeElement> 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
-
-