Top Description Methods
org.springframework.aot.hint.annotation

public @Interface RegisterReflectionForBinding

extends Annotation
Annotations
@Target:TYPE, METHOD
@Retention:RUNTIME
@Documented
@Reflective:RegisterReflectionForBindingProcessor
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target, org.springframework.core.annotation.AliasFor

Indicates that the classes specified in the annotation attributes require some reflection hints for binding or reflection-based serialization purposes. For each class specified, hints on constructors, fields, properties, record components, including types transitively used on properties and record components are registered. At least one class must be specified in the value or classes annotation attributes.

The annotated element can be a configuration class — for example:

@Configuration
@RegisterReflectionForBinding({ Foo.class, Bar.class })
public class MyConfig {
    // ...
}

The annotated element can be any Spring bean class, constructor, field, or method — for example:

@Service
public class MyService {

    @RegisterReflectionForBinding(Baz.class)
    public void process() {
        // ...
    }

}

The annotated element can also be any test class that uses the Spring TestContext Framework to load an ApplicationContext.

Author
Sebastien Deleuze
Since
6.0
See Also
org.springframework.aot.hint.BindingReflectionHintsRegistrar, @Reflective

Method Summary

Modifier and TypeMethod and Description
public Class<?>[]
classes()

Classes for which reflection hints should be registered.

public Class<?>[]
value()

Alias for classes().

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

classesback to summary
public Class<?>[] classes()

Classes for which reflection hints should be registered.

At least one class must be specified either via value or classes.

Annotations
@AliasFor:value
See Also
value()
valueback to summary
public Class<?>[] value()

Alias for classes().

Annotations
@AliasFor:classes