If we have an abstract class as follows:
public abstract class AbstractSomeClass{
private String type;
private int someValue;
}
And each extending class had a value for type, such as:
public class SomeClassImpl extends AbstractSomeClass{
{
type = "someType";
}
}
Is it possible to use this value as a parameter for the Value annotation in a manner similar to this, although not exactly since the following produces the error "Attribute value must be constant":
@Value("${someClass." + type + ".someValue")
public void setSomeValue(int someValue){//...}
Such that we do not need to have the value annotation and an override of the setSomeValue method in each subclass?