public AnnotationDescr addAnnotation ( String name , String value ) { if ( this . annotations == null ) { this . annotations = new HashMap < String , AnnotationDescr > ( ) ; } else { AnnotationDescr existingAnnotation = annotations . get ( name ) ; if ( existingAnnotation != null ) { existingAnnotation . setDuplicated ( ) ; return existingAnnotation ; } } AnnotationDescr annotation = new AnnotationDescr ( name , value ) ; annotation . setResource ( getResource ( ) ) ; return this . annotations . put ( annotation . getName ( ) , annotation ) ; }
Assigns a new annotation to this type with the respective name and value