Class AnnotationMetaDataProvider

java.lang.Object
org.hibernate.validator.internal.metadata.provider.AnnotationMetaDataProvider
All Implemented Interfaces:
MetaDataProvider

public class AnnotationMetaDataProvider extends Object implements MetaDataProvider
MetaDataProvider which reads the metadata from annotations which is the default configuration source.
Author:
Gunnar Morling, Hardy Ferentschik, Guillaume Smet
  • Constructor Details

  • Method Details

    • getAnnotationProcessingOptions

      public AnnotationProcessingOptions getAnnotationProcessingOptions()
      Description copied from interface: MetaDataProvider
      Returns the annotation processing options as configured by this provider.
      Specified by:
      getAnnotationProcessingOptions in interface MetaDataProvider
      Returns:
      The annotation processing options as configured by this provider.
    • getBeanConfiguration

      public <T> BeanConfiguration<T> getBeanConfiguration(Class<T> beanClass)
      Description copied from interface: MetaDataProvider
      Returns a bean configuration for the given type or null if this provider has no meta-data on the given type.
      Specified by:
      getBeanConfiguration in interface MetaDataProvider
    • findConstraintAnnotations

      protected <A extends Annotation> List<ConstraintDescriptorImpl<?>> findConstraintAnnotations(Constrainable constrainable, A annotation, ConstraintLocation.ConstraintLocationKind type)
      Examines the given annotation to see whether it is a single- or multi-valued constraint annotation.
      Type Parameters:
      A - the annotation type
      Parameters:
      constrainable - The constrainable to check for constraints annotations
      annotation - The annotation to examine
      type - the element type on which the annotation/constraint is placed on
      Returns:
      A list of constraint descriptors or the empty list in case annotation is neither a single nor multi-valued annotation.
    • findTypeAnnotationConstraints

      protected Set<MetaConstraint<?>> findTypeAnnotationConstraints(JavaBeanField javaBeanField)
      Finds type arguments constraints for fields.
    • findTypeAnnotationConstraints

      protected Set<MetaConstraint<?>> findTypeAnnotationConstraints(JavaBeanExecutable<?> javaBeanExecutable)
      Finds type arguments constraints for method return values.
    • findTypeAnnotationConstraintsForExecutableParameter

      protected Set<MetaConstraint<?>> findTypeAnnotationConstraintsForExecutableParameter(JavaBeanExecutable<?> javaBeanExecutable, JavaBeanParameter javaBeanParameter)
      Finds type arguments constraints for parameters.
      Parameters:
      javaBeanParameter - the parameter
      Returns:
      a set of type arguments constraints, or an empty set if no constrained type arguments are found