title: how to read messages.properties in Annotations
body: <p>I want to use localization to localize the Swagger Documentation. But I can only provide compile time constants to Annotations. So I'm confused how to provide read messages from messages_**.properties and provide it to annotations.</p>
  
  <p><strong>Message Source</strong>:</p>
  
  <pre><code>@Configuration
  public class CustomMessageSourceConfig {
  
      @Bean
      public MessageSource messageSource() {
          ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
          messageSource.setBasename("classpath:messages");
          messageSource.setDefaultEncoding("UTF-8");
          return messageSource;
      }
  
      @Bean
      public LocalValidatorFactoryBean getValidator() {
          LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
          bean.setValidationMessageSource(messageSource());
          return bean;
      }
  
      @Bean
      public LocaleResolver localeResolver() {
          SessionLocaleResolver slr = new SessionLocaleResolver();
          slr.setDefaultLocale(Locale.ENGLISH);
          return slr;
      }
  
  }
  </code></pre>
  
  <p>Reading messages from messages_**.properties:</p>
  
  <pre><code>@Component
  public class MessagesByLocaleServiceImpl implements MessagesByLocaleService {
  
      @Autowired
      private MessageSource messageSource;
  
      @Override
      public String getMessage(String id) {
          Locale locale = LocaleContextHolder.getLocale();
          return StringEscapeUtils.unescapeJava(messageSource.getMessage(id, null, locale));
      }
  }
  </code></pre>
  
  <p>Here is how I'm reading messsages in Java Code:</p>
  
  <pre><code>@Bean
      public Docket api() {
          return new Docket(DocumentationType.SWAGGER_2).select()
                  .apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.boot"))).build()
                  .apiInfo(apiInfo())
                  .tags(new Tag("Netmap Mode Service", messageSource.getMessage(MessageCodes.SWAGGER_WINDOWS_ONLY)));
      }
  
      private ApiInfo apiInfo() {
          return new ApiInfoBuilder().title(messageSource.getMessage(MessageCodes.SWAGGER_TITLE))
                  .description(messageSource.getMessage(MessageCodes.SWAGGER_DESCRIPTION))
                  .contact(messageSource.getMessage(MessageCodes.SWAGGER_CONTACT)).build();
      }
  </code></pre>
  
  <p>But how can I provide these messages to Swagger Annotations. </p>
  
  <pre><code>@ApiOperation(value = "Add Netmap mode ", notes = "**I want to read properties here**")
      @ApiImplicitParams({
              @ApiImplicitParam(value = SwaggerSinglePoint.DESC_MODE_NAME, dataType = CDSwaggerPrimitives.STRING, name = SwaggerSinglePoint.MODE_NAME, paramType = CDSwaggerPrimitives.PARAMA_TYPE_QUERY),
              @ApiImplicitParam(value = SwaggerSinglePoint.DESC_MODE_BUFFER_SIZE, dataType = CDSwaggerPrimitives.INETEGER, name = SwaggerSinglePoint.BUFFER, paramType = CDSwaggerPrimitives.PARAMA_TYPE_QUERY)})
      @RequestMapping(method = RequestMethod.POST, produces = CDConstants.JSON_RESPONSE_DATA_FORMAT, consumes = CDConstants.JSON_REQUEST_DATA_FORMAT)
      @SuppressWarnings({ "squid:S3776", "squid:S1319", "unused" })
      public String testController(@RequestBody(required = false) HashMap requestParamMap, HttpServletResponse response,
              HttpServletRequest request) {
  </code></pre>
  
  <p>I want to read messages in these annotations. Any guidance or suggestions would be highly appreciated.</p>