diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Value.java b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Value.java index 36b1139e4cbc..bfa27305a6a1 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Value.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/annotation/Value.java @@ -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. @@ -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. * - *

Typically used for expression-driven dependency injection. Also supported - * for dynamic resolution of handler method parameters, e.g. in Spring MVC. + *

Typically used for expression-driven or property-driven dependency injection. + * Also supported for dynamic resolution of handler method arguments — for + * example, in Spring MVC. * - *

A common use case is to assign default field values using - * #{systemProperties.myProp} style expressions. + *

A common use case is to inject values using + * #{systemProperties.myProp} style SpEL (Spring Expression Language) + * expressions. Alternatively, values may be injected using + * ${my.app.myProp} style property placeholders. * *

Note that actual processing of the {@code @Value} annotation is performed * by a {@link org.springframework.beans.factory.config.BeanPostProcessor @@ -55,7 +58,8 @@ public @interface Value { /** - * The actual value expression — for example, #{systemProperties.myProp}. + * The actual value expression such as #{systemProperties.myProp} + * or property placeholder such as ${my.app.myProp}. */ String value();