public < A2 extends Annotation > AnnotationMetadata annotate ( AnnotationMetadata annotationMetadata , AnnotationValue < A2 > annotationValue ) { if ( annotationMetadata instanceof DefaultAnnotationMetadata ) { final Optional < T > annotationMirror = getAnnotationMirror ( annotationValue . getAnnotationName ( ) ) ; final DefaultAnnotationMetadata defaultMetadata = ( DefaultAnnotationMetadata ) annotationMetadata ; defaultMetadata . addDeclaredAnnotation ( annotationValue . getAnnotationName ( ) , annotationValue . getValues ( ) ) ; annotationMirror . ifPresent ( annotationType -> processAnnotationStereotypes ( defaultMetadata , true , annotationType , annotationValue . getAnnotationName ( ) ) ) ; } return annotationMetadata ; }
Annotate an existing annotation metadata object .