Spring boot externalize config properties/messages on Java annotations
<p>Is there a way to read text from external properties file in spring without using the <code>@Value</code> annotation. Ex: application.properties</p>

<pre><code>var.foo="hello"
</code></pre>

<p>I can inject it in a spring bean using </p>

<pre><code>@Value("${var.foo}") String value;
</code></pre>

<p>as a class variable. Is there a way to include this property without using the <code>@Value</code> annotation. Something like how JSR bean validation does. </p>

<pre><code>@NotNull(message={custom.notnull})
</code></pre>

<p>and you externalize this property value in <strong>ValidationMessages.properties</strong> file. </p>

<p>Example, if I have a resource(web component) class, and if I have to use Swagger annotations to document them,</p>

<pre><code>@controller
@path("/")
@Api(description = "User Resource API")
public class UserResource {

    @Path("/users")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @ApiOperation(value = "returns user details", notes = "some notes")
    public User getUser() {

        return new User(123, "Joe", "Montana");
    }
}
</code></pre>

<p>and the model,</p>

<pre><code>@ApiModel("user model")
public class User {

    @ApiModelProperty(value = "This represents user id")
    private String id;
    private String firstName;
    private String lastName;
    ...
}
</code></pre>

<p>How do you externalize this string/sentences/messages to an external properties file. I think this applies to general Java annotations and spring and not specific to Swagger. The reason I specified Swagger is, if just like hibernate validation Java library has the option of specifying these messages in an external ValidationMessages.properties file and spring knows by default to pick it up (or can be configured). </p>

<p>Does Swagger provide such an option? If it does not, how do I setup one?</p>

<p>Underlying problem is, I don't want to clutter my code/logic with documentation related data(meta data).</p>