private void addAnnotationValues ( ClassReference annotatedReference , AnnotationClassReference typeRef , Annotation node ) { Map < String , AnnotationValue > annotationValueMap = new HashMap <> ( ) ; if ( node instanceof SingleMemberAnnotation ) { SingleMemberAnnotation singleMemberAnnotation = ( SingleMemberAnnotation ) node ; AnnotationValue value = getAnnotationValueForExpression ( annotatedReference , singleMemberAnnotation . getValue ( ) ) ; annotationValueMap . put ( "value" , value ) ; } else if ( node instanceof NormalAnnotation ) { @ SuppressWarnings ( "unchecked" ) List < MemberValuePair > annotationValues = ( ( NormalAnnotation ) node ) . values ( ) ; for ( MemberValuePair annotationValue : annotationValues ) { String key = annotationValue . getName ( ) . toString ( ) ; Expression expression = annotationValue . getValue ( ) ; AnnotationValue value = getAnnotationValueForExpression ( annotatedReference , expression ) ; annotationValueMap . put ( key , value ) ; } } typeRef . setAnnotationValues ( annotationValueMap ) ; }
Adds parameters contained in the annotation into the annotation type reference