Annotation Interface CompileWithTargetClassAccess


@Retention(RUNTIME) @Target({TYPE,METHOD}) @Documented @ExtendWith(org.springframework.aot.test.generator.compile.CompileWithTargetClassAccessExtension.class) public @interface CompileWithTargetClassAccess
Annotation that can be used on tests that need a TestCompiler with non-public access to a target class. Allows the compiler to use MethodHandles.privateLookupIn(java.lang.Class<?>, java.lang.invoke.MethodHandles.Lookup) to define the class without polluting the test ClassLoader.
Since:
6.0
Author:
Phillip Webb
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    The target classes.
    The target class names.
  • Element Details

    • classNames

      String[] classNames
      The target class names.
      Returns:
      the class name
      Default:
      {}
    • classes

      Class<?>[] classes
      The target classes.
      Returns:
      the classes
      Default:
      {}