Annotation Type RegisterReflectionForBinding


@Documented @Retention(CLASS) @Target({TYPE,METHOD}) public @interface RegisterReflectionForBinding

Declares classes the build must write JSON codecs for, read and write, although no call site names them -- a class reached only through an Object-typed Json.write, a Map<String, Object> response or a message payload. Spring's annotation of the same name registers the same classes for its ahead-of-time image, which is what this is here: codecs are generated at build time, and Json.write refuses a class it has none for.

It may sit on any class or method of the application:

@RegisterReflectionForBinding({Invoice.class, Refund.class})
@Component
public class Webhooks { ... }
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    The same, as Spring also accepts it.
    Class<?>[]
    The classes to write codecs for.
  • Element Details

    • value

      Class<?>[] value
      The classes to write codecs for.
      Default:
      {}
    • classes

      Class<?>[] classes
      The same, as Spring also accepts it.
      Default:
      {}