@ SuppressWarnings ( "WeakerAccess" ) protected final void addAnnotation ( String annotation , Map < CharSequence , Object > values ) { if ( annotation != null ) { String repeatedName = getRepeatedName ( annotation ) ; Object v = values . get ( AnnotationMetadata . VALUE_MEMBER ) ; if ( v instanceof io . micronaut . core . annotation . AnnotationValue [ ] ) { io . micronaut . core . annotation . AnnotationValue [ ] avs = ( io . micronaut . core . annotation . AnnotationValue [ ] ) v ; for ( io . micronaut . core . annotation . AnnotationValue av : avs ) { addRepeatable ( annotation , av ) ; } } else if ( v instanceof Iterable && repeatedName != null ) { Iterable i = ( Iterable ) v ; for ( Object o : i ) { if ( o instanceof io . micronaut . core . annotation . AnnotationValue ) { addRepeatable ( annotation , ( ( io . micronaut . core . annotation . AnnotationValue ) o ) ) ; } } } else { Map < String , Map < CharSequence , Object > > allAnnotations = getAllAnnotations ( ) ; addAnnotation ( annotation , values , null , allAnnotations , false ) ; } } }
Adds an annotation and its member values if the annotation already exists the data will be merged with existing values replaced .