Class ReflectionIntrospectionConfiguration

java.lang.Object
io.micronaut.reflection.ReflectionIntrospectionConfiguration

@Context @Internal @ConfigurationProperties("micronaut.introspection") public final class ReflectionIntrospectionConfiguration extends Object
Applies the "micronaut.introspection.allow-reflection" property of the application configuration to the ReflectionIntrospectionPolicy when the context starts, and takes it back when the context closes, leaving the patterns of the contexts that are still running.

The property allows types; ReflectionIntrospectionConfiguration.Description both allows them and says how they are to be described, carrying the Introspected members a type that cannot be annotated - one of a library, one compiled without the processor - would otherwise have no way to declare:

micronaut:
  introspection:
    reflective:
      - types: com.example.model.*
        access-kind: FIELD
        visibility: ANY
        excludes: password
      - types: com.example.api.*
        included-annotations: com.fasterxml.jackson.annotation.JsonProperty
        indexed:
          - annotation: com.fasterxml.jackson.annotation.JsonProperty
            member: value
Since:
5.2.0
Author:
Denis Stepanov
  • Field Details

  • Constructor Details

    • ReflectionIntrospectionConfiguration

      public ReflectionIntrospectionConfiguration(@Nullable List<ReflectionIntrospectionConfiguration.Description> reflective)
      Creates the configuration; it is instantiated by the context.
      Parameters:
      reflective - The types to describe reflectively, and how
  • Method Details

    • getAllowReflection

      public List<String> getAllowReflection()
      The patterns of the types the shared introspector may describe reflectively.
      Returns:
      The patterns
    • setAllowReflection

      public void setAllowReflection(@Nullable List<String> allowReflection)
      The patterns of the types the shared BeanIntrospector may describe reflectively when it has no generated introspection for them. A pattern is a class name where * stands for any sequence of characters: com.example.model.* allows a package and its sub packages. No type is allowed by default.
      Parameters:
      allowReflection - The patterns
    • getReflective

      The types to describe reflectively, and the annotations to describe them with.
      Returns:
      The descriptions