In my project we have set up something like below
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD,ElementType.ANNOTATION_TYPE, ElementType.PARAMETER})
@Inherited
@Documented
@Qualifier(“MessageConverterQualifier”)
public @interface MessageConverterRef {}
Above Is used at many places in CoreConfig files (annotation based loading)
@Bean
@MessageConverterRef
public DocumentToABCResponseMessageConverter
documentToABCResponseMessageConverter() {
return new DocumentToABCResponseMessageConverter();
}
@Bean
@MessageConverterRef
public StringToABCResponseMessageConverter stringToABCResponseMessageConverter(
StringToDomBasedMessageConverter stringToDomBasedMessageConverter) {
return new StringToABCResponseMessageConverter(stringToDomBasedMessageConverter);
}
I am not able to understand what is the need of MessageConvertoerRef custom annotation here. This custom annotation is used at now of places while initializing the beans using @Bean.
Request you to let me know what does it mean and what difference is it making .
getAnnotation(MessageConverterRef.class)... otherwise, your custom annotation is useless ... - Pras