public class AnnotationMetaDataProvider extends Object implements MetaDataProvider
MetaDataProvider
which reads the metadata from annotations which is the default configuration source.Constructor and Description |
---|
AnnotationMetaDataProvider(ConstraintCreationContext constraintCreationContext,
JavaBeanHelper javaBeanHelper,
AnnotationProcessingOptions annotationProcessingOptions) |
Modifier and Type | Method and Description |
---|---|
protected <A extends Annotation> |
findConstraintAnnotations(Constrainable constrainable,
A annotation,
ConstraintLocation.ConstraintLocationKind type)
Examines the given annotation to see whether it is a single- or multi-valued constraint annotation.
|
protected Set<MetaConstraint<?>> |
findTypeAnnotationConstraints(JavaBeanExecutable<?> javaBeanExecutable)
Finds type arguments constraints for method return values.
|
protected Set<MetaConstraint<?>> |
findTypeAnnotationConstraints(JavaBeanField javaBeanField)
Finds type arguments constraints for fields.
|
protected Set<MetaConstraint<?>> |
findTypeAnnotationConstraintsForExecutableParameter(JavaBeanExecutable<?> javaBeanExecutable,
JavaBeanParameter javaBeanParameter)
Finds type arguments constraints for parameters.
|
AnnotationProcessingOptions |
getAnnotationProcessingOptions()
Returns the annotation processing options as configured by this provider.
|
<T> BeanConfiguration<T> |
getBeanConfiguration(Class<T> beanClass)
Returns a bean configuration for the given type or
null if this provider has no meta-data on the given
type. |
public AnnotationMetaDataProvider(ConstraintCreationContext constraintCreationContext, JavaBeanHelper javaBeanHelper, AnnotationProcessingOptions annotationProcessingOptions)
public AnnotationProcessingOptions getAnnotationProcessingOptions()
MetaDataProvider
getAnnotationProcessingOptions
in interface MetaDataProvider
public <T> BeanConfiguration<T> getBeanConfiguration(Class<T> beanClass)
MetaDataProvider
null
if this provider has no meta-data on the given
type.getBeanConfiguration
in interface MetaDataProvider
protected <A extends Annotation> List<ConstraintDescriptorImpl<?>> findConstraintAnnotations(Constrainable constrainable, A annotation, ConstraintLocation.ConstraintLocationKind type)
A
- the annotation typeconstrainable
- The constrainable to check for constraints annotationsannotation
- The annotation to examinetype
- the element type on which the annotation/constraint is placed onannotation
is neither a
single nor multi-valued annotation.protected Set<MetaConstraint<?>> findTypeAnnotationConstraints(JavaBeanField javaBeanField)
protected Set<MetaConstraint<?>> findTypeAnnotationConstraints(JavaBeanExecutable<?> javaBeanExecutable)
protected Set<MetaConstraint<?>> findTypeAnnotationConstraintsForExecutableParameter(JavaBeanExecutable<?> javaBeanExecutable, JavaBeanParameter javaBeanParameter)
javaBeanParameter
- the parameterCopyright © 2007-2021 Red Hat, Inc. All Rights Reserved