Annotation Interface AllowsReflection


A hint that a framework reads the runtime annotations of a declaration reflectively, from the Java class rather than through the Micronaut annotation metadata, so that a compiler generating the Java class for a declaration written in another language copies its reflection data onto the generated class. The Python compiler (micronaut-inject-python) copies the runtime annotations of a Python class, of its members and of the parameters of its methods onto the generated Java type when the class carries this hint, whatever the patterns of the micronaut.introspection.allow-reflection option allow.

The hint is a stereotype: it applies to a declaration that carries it, to every declaration annotated with an annotation type that is itself annotated with it, and to a declaration whose annotation an annotation mapper maps to it. A framework integration that reads its own annotations reflectively therefore declares it once, on its annotation type or in its annotation mapper (an AI service annotation read by java.lang.reflect.Proxy, a JPA @Entity read by Hibernate), and its users need no configuration.

Since:
5.2.3