|
|
|
@ -25,25 +25,24 @@ import java.lang.annotation.Target; |
|
|
|
import org.springframework.core.annotation.AliasFor; |
|
|
|
import org.springframework.core.annotation.AliasFor; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Indicate that the classes specified in the annotation attributes require some |
|
|
|
* Indicates that the classes specified in the annotation attributes require some |
|
|
|
* reflection hints for binding or reflection-based serialization purposes. For each |
|
|
|
* reflection hints for binding or reflection-based serialization purposes. For each |
|
|
|
* class specified, hints on constructors, fields, properties, record components, |
|
|
|
* class specified, hints on constructors, fields, properties, record components, |
|
|
|
* including types transitively used on properties and record components are registered. |
|
|
|
* including types transitively used on properties and record components are registered. |
|
|
|
* At least one class must be specified in the {@code value} or {@code classes} annotation |
|
|
|
* At least one class must be specified in the {@code value} or {@code classes} annotation |
|
|
|
* attributes. |
|
|
|
* attributes. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>The annotated element can be a configuration class, for example: |
|
|
|
* <p>The annotated element can be a configuration class — for example: |
|
|
|
* |
|
|
|
* |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
* @Configuration |
|
|
|
* @Configuration |
|
|
|
* @RegisterReflectionForBinding({ Foo.class, Bar.class }) |
|
|
|
* @RegisterReflectionForBinding({ Foo.class, Bar.class }) |
|
|
|
* public class MyConfig { |
|
|
|
* public class MyConfig { |
|
|
|
* |
|
|
|
|
|
|
|
* // ...
|
|
|
|
* // ...
|
|
|
|
* }</pre> |
|
|
|
* }</pre> |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>The annotated element can also be any Spring bean class, constructor, field, or method. |
|
|
|
* <p>The annotated element can be any Spring bean class, constructor, field, |
|
|
|
* For example: |
|
|
|
* or method — for example: |
|
|
|
* |
|
|
|
* |
|
|
|
* <pre class="code"> |
|
|
|
* <pre class="code"> |
|
|
|
* @Service |
|
|
|
* @Service |
|
|
|
@ -56,9 +55,13 @@ import org.springframework.core.annotation.AliasFor; |
|
|
|
* |
|
|
|
* |
|
|
|
* }</pre> |
|
|
|
* }</pre> |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* <p>The annotated element can also be any test class that uses the <em>Spring |
|
|
|
|
|
|
|
* TestContext Framework</em> to load an {@code ApplicationContext}. |
|
|
|
|
|
|
|
* |
|
|
|
* @author Sebastien Deleuze |
|
|
|
* @author Sebastien Deleuze |
|
|
|
* @since 6.0 |
|
|
|
* @since 6.0 |
|
|
|
* @see org.springframework.aot.hint.BindingReflectionHintsRegistrar |
|
|
|
* @see org.springframework.aot.hint.BindingReflectionHintsRegistrar |
|
|
|
|
|
|
|
* @see Reflective @Reflective |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Target({ ElementType.TYPE, ElementType.METHOD }) |
|
|
|
@Target({ ElementType.TYPE, ElementType.METHOD }) |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ -67,10 +70,7 @@ import org.springframework.core.annotation.AliasFor; |
|
|
|
public @interface RegisterReflectionForBinding { |
|
|
|
public @interface RegisterReflectionForBinding { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Classes for which reflection hints should be registered. |
|
|
|
* Alias for {@link #classes()}. |
|
|
|
* <p>At least one class must be specified either via {@link #value} or |
|
|
|
|
|
|
|
* {@link #classes}. |
|
|
|
|
|
|
|
* @see #classes() |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@AliasFor("classes") |
|
|
|
@AliasFor("classes") |
|
|
|
Class<?>[] value() default {}; |
|
|
|
Class<?>[] value() default {}; |
|
|
|
|