Skip to content

Commit

Permalink
Improve Javadoc for @value regarding supported expressions
Browse files Browse the repository at this point in the history
Closes gh-25284
  • Loading branch information
sbrannen committed Jun 19, 2020
1 parent 46c7861 commit d07be59
Showing 1 changed file with 12 additions and 8 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,14 +23,17 @@
import java.lang.annotation.Target;

/**
* Annotation at the field or method/constructor parameter level
* that indicates a default value expression for the affected argument.
* Annotation used at the field or method/constructor parameter level
* that indicates a default value expression for the annotated element.
*
* <p>Typically used for expression-driven dependency injection. Also supported
* for dynamic resolution of handler method parameters, e.g. in Spring MVC.
* <p>Typically used for expression-driven or property-driven dependency injection.
* Also supported for dynamic resolution of handler method arguments &mdash; for
* example, in Spring MVC.
*
* <p>A common use case is to assign default field values using
* <code>#{systemProperties.myProp}</code> style expressions.
* <p>A common use case is to inject values using
* <code>#{systemProperties.myProp}</code> style SpEL (Spring Expression Language)
* expressions. Alternatively, values may be injected using
* <code>${my.app.myProp}</code> style property placeholders.
*
* <p>Note that actual processing of the {@code @Value} annotation is performed
* by a {@link org.springframework.beans.factory.config.BeanPostProcessor
Expand All @@ -55,7 +58,8 @@
public @interface Value {

/**
* The actual value expression &mdash; for example, <code>#{systemProperties.myProp}</code>.
* The actual value expression such as <code>#{systemProperties.myProp}</code>
* or property placeholder such as <code>${my.app.myProp}</code>.
*/
String value();

Expand Down

0 comments on commit d07be59

Please sign in to comment.