Class ReflectionBeanIntrospector

java.lang.Object
io.micronaut.reflection.ReflectionBeanIntrospector
All Implemented Interfaces:
BeanIntrospector

public final class ReflectionBeanIntrospector extends Object implements BeanIntrospector
A BeanIntrospector that serves the generated introspections of another introspector first, and a ReflectionBeanIntrospection for a type that has none.

The reflective introspections cannot be enumerated, so findIntrospections(Predicate) and findIntrospectedTypes(Predicate) return what the delegate returns.

This introspector is for the code paths a specification requires to handle any class; it is not a replacement of BeanIntrospector.SHARED, whose callers expect a missing introspection to mean that a type was not meant to be introspected.

Since:
5.2.0
Author:
Denis Stepanov
  • Constructor Details

    • ReflectionBeanIntrospector

      public ReflectionBeanIntrospector(BeanIntrospector delegate)
      Creates an introspector reflecting over every type the delegate does not know.
      Parameters:
      delegate - The introspector consulted first
    • ReflectionBeanIntrospector

      public ReflectionBeanIntrospector(BeanIntrospector delegate, Predicate<Class<?>> reflective)
      Creates an introspector reflecting over the types the delegate does not know among the ones a predicate accepts.
      Parameters:
      delegate - The introspector consulted first
      reflective - The types a reflective introspection may be created for
    • ReflectionBeanIntrospector

      public ReflectionBeanIntrospector(BeanIntrospector delegate, Predicate<Class<?>> reflective, boolean supplementing)
      Creates an introspector reflecting over the types the delegate does not know among the ones a predicate accepts, completing the generated introspections when asked to.
      Parameters:
      delegate - The introspector consulted first
      reflective - The types a reflective introspection may be created for
      supplementing - Whether a generated introspection is completed with the executables the processor left out, as a SupplementedBeanIntrospection
    • ReflectionBeanIntrospector

      public ReflectionBeanIntrospector(BeanIntrospector delegate, Predicate<Class<?>> reflective, boolean supplementing, Set<Introspected.AccessKind> accessKinds)
      Creates an introspector describing the types the delegate does not know with the members a caller asks for.

      A specification that reads a field directly, as Jakarta Validation does, asks for Introspected.AccessKind.FIELD: a type it describes carries no Introspected of its own to declare that, and the default of Introspected.AccessKind.METHOD alone leaves a field without accessors out of the properties.

      Parameters:
      delegate - The introspector consulted first
      reflective - The types a reflective introspection may be created for
      supplementing - Whether a generated introspection is completed with the executables the processor left out, as a SupplementedBeanIntrospection
      accessKinds - The kinds of member that make a property, empty for what the type declares
  • Method Details