注释类型 Value
@Target({FIELD,METHOD,PARAMETER,ANNOTATION_TYPE}) @Retention(RUNTIME) @Documented public @interface Value
Annotation at the field or method/constructor parameter level that indicates a default value expression for the affected argument.Typically used for expression-driven dependency injection. Also supported for dynamic resolution of handler method parameters, e.g. in Spring MVC.
A common use case is to assign default field values using
#{systemProperties.myProp}style expressions.Note that actual processing of the
@Valueannotation is performed by aBeanPostProcessorwhich in turn means that you cannot use@ValuewithinBeanPostProcessororBeanFactoryPostProcessortypes. Please consult the javadoc for theAutowiredAnnotationBeanPostProcessorclass (which, by default, checks for the presence of this annotation).