title: Make spring @Value take default value from static field
body: <p>I have a java configuration where I create bean using some properties, defined in <code>application.properties</code>. For one of them I have a default value which is pretty long, so I extracted this value to a <code>public static final String</code> field of this configuration, now I want to make <code>@Value</code> use it as a default value.</p>
  
  <p>So eventually I want something like this:</p>
  
  <pre><code>@Configuration
  public class MyConfiguration {
  
      public static final String DEFAULT_PROPERTY_VALUE = "long string...";
  
      @Bean("midPriceDDSEndpoint")
      public DistributedDataSpace&lt;Long, MidPriceStrategy&gt; midPriceDDSEndpoint(
          @Value("${foo.bar.my-property:DEFAULT_PROPERTY_VALUE}") String myPropertyValue) {
      ... create and return bean...
      }
  }
  </code></pre>
  
  <p>However by spring doesn't my field, so I am curious if I can somehow make it lookup it. </p>
  
  <p>One way to fix this, is to access this static field through the configuration bean: <code>@Value(${foo.bar.my-property:#{myConfigurationBeanName.DEFAULT_PROPERTY_VALUE}})</code>, but using this approach makes constructor unreadable, because <code>Value</code> annotation then takes a lot of space(as property name and configuration bean name is longer then in this example). Is there any other way to make spring use static field as a default value for property?</p>