public class AnnotationMetaDataProvider extends java.lang.Object implements MetaDataProvider
MetaDataProvider
which reads the metadata from annotations which is the default configuration source.Constructor and Description |
---|
AnnotationMetaDataProvider(ConstraintHelper constraintHelper,
TypeResolutionHelper typeResolutionHelper,
ValueExtractorManager valueExtractorManager,
AnnotationProcessingOptions annotationProcessingOptions) |
Modifier and Type | Method and Description |
---|---|
protected <A extends java.lang.annotation.Annotation> |
findConstraintAnnotations(java.lang.reflect.Member member,
A annotation,
java.lang.annotation.ElementType type)
Examines the given annotation to see whether it is a single- or multi-valued constraint annotation.
|
protected java.util.Set<MetaConstraint<?>> |
findTypeAnnotationConstraints(java.lang.reflect.Executable executable,
java.lang.reflect.AnnotatedType annotatedReturnType)
Finds type arguments constraints for method return values.
|
protected java.util.Set<MetaConstraint<?>> |
findTypeAnnotationConstraints(java.lang.reflect.Field field)
Finds type arguments constraints for fields.
|
protected java.util.Set<MetaConstraint<?>> |
findTypeAnnotationConstraintsForExecutableParameter(java.lang.reflect.Executable executable,
int i,
java.lang.reflect.AnnotatedType parameterAnnotatedType)
Finds type arguments constraints for parameters.
|
AnnotationProcessingOptions |
getAnnotationProcessingOptions()
Returns the annotation processing options as configured by this provider.
|
<T> BeanConfiguration<T> |
getBeanConfiguration(java.lang.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(ConstraintHelper constraintHelper, TypeResolutionHelper typeResolutionHelper, ValueExtractorManager valueExtractorManager, AnnotationProcessingOptions annotationProcessingOptions)
public AnnotationProcessingOptions getAnnotationProcessingOptions()
MetaDataProvider
getAnnotationProcessingOptions
in interface MetaDataProvider
public <T> BeanConfiguration<T> getBeanConfiguration(java.lang.Class<T> beanClass)
MetaDataProvider
null
if this provider has no meta-data on the given
type.getBeanConfiguration
in interface MetaDataProvider
protected <A extends java.lang.annotation.Annotation> java.util.List<ConstraintDescriptorImpl<?>> findConstraintAnnotations(java.lang.reflect.Member member, A annotation, java.lang.annotation.ElementType type)
A
- the annotation typemember
- The member 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 java.util.Set<MetaConstraint<?>> findTypeAnnotationConstraints(java.lang.reflect.Field field)
protected java.util.Set<MetaConstraint<?>> findTypeAnnotationConstraints(java.lang.reflect.Executable executable, java.lang.reflect.AnnotatedType annotatedReturnType)
protected java.util.Set<MetaConstraint<?>> findTypeAnnotationConstraintsForExecutableParameter(java.lang.reflect.Executable executable, int i, java.lang.reflect.AnnotatedType parameterAnnotatedType)
executable
- the executablei
- the parameter indexCopyright © 2007-2022 Red Hat, Inc. All Rights Reserved