Jose Antonio Iñigo opened SPR-13603 and commented
It would be nice to be able to use @Value as meta annotation:
Having a properties file and the necessary context:properties-placeholder configuration...
In a Spring bean we could have:
@Value("${someproperty}")
private String someProperty;
Where someProperty's value would be "somevalue".
I want to create a new annotation @Refreshable with @Value as meta-annotation so that it behaves the same as using @Value directly. Since @Value requires a value I hardcode "default" hoping that @Refreshable's value() will override it:
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Value("default")
public @interface Refreshable {
String value();
}
Then when I use the new annotation in a bean, I was expecting it to work properly, injecting the declared value "somevalue", but it doesn't, I get "default".
@Refreshable("${someproperty}")
private String someProperty;
Reference URL: http://stackoverflow.com/questions/32964391/annotation-with-spring-value-meta-annotation-not-injecting-the-value
Issue Links:
Referenced from: commits 4f95593
Jose Antonio Iñigo opened SPR-13603 and commented
It would be nice to be able to use
@Valueas meta annotation:Having a properties file and the necessary context:properties-placeholder configuration...
In a Spring bean we could have:
Where someProperty's value would be "somevalue".
I want to create a new annotation
@Refreshablewith@Valueas meta-annotation so that it behaves the same as using@Valuedirectly. Since@Valuerequires a value I hardcode "default" hoping that@Refreshable's value() will override it:Then when I use the new annotation in a bean, I was expecting it to work properly, injecting the declared value "somevalue", but it doesn't, I get "default".
Reference URL: http://stackoverflow.com/questions/32964391/annotation-with-spring-value-meta-annotation-not-injecting-the-value
Issue Links:
@AliasForattribute name should default to declaring attribute@AliasForfor@JmsListenerattributesReferenced from: commits 4f95593