Annotation Type RegisterForReflection


  • @Retention(RUNTIME)
    @Target(TYPE)
    public @interface RegisterForReflection
    Annotation that can be used to force a class to be registered for reflection in native image mode
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] classNames
      This allows for classes to be registered for reflection via class names.
      boolean fields
      If the fields should be registered
      boolean ignoreNested
      If nested classes/interfaces should be ignored/registered This is useful when it's necessary to register inner (especially private) classes for Reflection.
      boolean methods
      If the methods should be registered
      Class<?>[] targets
      Alternative classes that should actually be registered for reflection instead of the current class.
    • Element Detail

      • methods

        boolean methods
        If the methods should be registered
        Default:
        true
      • fields

        boolean fields
        If the fields should be registered
        Default:
        true
      • ignoreNested

        boolean ignoreNested
        If nested classes/interfaces should be ignored/registered This is useful when it's necessary to register inner (especially private) classes for Reflection.
        Default:
        true
      • targets

        Class<?>[] targets
        Alternative classes that should actually be registered for reflection instead of the current class. This allows for classes in 3rd party libraries to be registered without modification or writing an extension. If this is set then the class it is placed on is not registered for reflection, so this should generally just be placed on an empty class that is not otherwise used.
        Default:
        {}
      • classNames

        String[] classNames
        This allows for classes to be registered for reflection via class names. This is useful when it's necessary to register private classes for Reflection.
        Default:
        {}