Class ReflectionBeanIntrospector
java.lang.Object
io.micronaut.reflection.ReflectionBeanIntrospector
- All Implemented Interfaces:
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
-
Field Summary
Fields inherited from interface BeanIntrospector
SHARED -
Constructor Summary
ConstructorsConstructorDescriptionReflectionBeanIntrospector(BeanIntrospector delegate) Creates an introspector reflecting over every type the delegate does not know.ReflectionBeanIntrospector(BeanIntrospector delegate, Predicate<Class<?>> reflective) Creates an introspector reflecting over the types the delegate does not know among the ones a predicate accepts.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.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. -
Method Summary
Modifier and TypeMethodDescriptionCollection<Class<?>> findIntrospectedTypes(Predicate<? super BeanIntrospectionReference<?>> filter) Finds introspections with the given filter.<T> Optional<BeanIntrospection<T>> findIntrospection(Class<T> beanType) Find aBeanIntrospectionfor the given bean type.findIntrospections(Predicate<? super BeanIntrospectionReference<?>> filter) Finds introspections with the given filter.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BeanIntrospector
findIntrospections, findIntrospections, getIntrospection
-
Constructor Details
-
ReflectionBeanIntrospector
Creates an introspector reflecting over every type the delegate does not know.- Parameters:
delegate- The introspector consulted first
-
ReflectionBeanIntrospector
Creates an introspector reflecting over the types the delegate does not know among the ones a predicate accepts.- Parameters:
delegate- The introspector consulted firstreflective- 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 firstreflective- The types a reflective introspection may be created forsupplementing- Whether a generated introspection is completed with the executables the processor left out, as aSupplementedBeanIntrospection
-
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 noIntrospectedof its own to declare that, and the default ofIntrospected.AccessKind.METHODalone leaves a field without accessors out of the properties.- Parameters:
delegate- The introspector consulted firstreflective- The types a reflective introspection may be created forsupplementing- Whether a generated introspection is completed with the executables the processor left out, as aSupplementedBeanIntrospectionaccessKinds- The kinds of member that make a property, empty for what the type declares
-
-
Method Details
-
findIntrospections
public Collection<BeanIntrospection<Object>> findIntrospections(Predicate<? super BeanIntrospectionReference<?>> filter) Description copied from interface:BeanIntrospectorFinds introspections with the given filter.- Specified by:
findIntrospectionsin interfaceBeanIntrospector- Parameters:
filter- A filter that receives aBeanIntrospectionReference- Returns:
- A collection of introspections
-
findIntrospectedTypes
public Collection<Class<?>> findIntrospectedTypes(Predicate<? super BeanIntrospectionReference<?>> filter) Description copied from interface:BeanIntrospectorFinds introspections with the given filter.- Specified by:
findIntrospectedTypesin interfaceBeanIntrospector- Parameters:
filter- A filter that receives aBeanIntrospectionReference- Returns:
- A collection of introspections
-
findIntrospection
Description copied from interface:BeanIntrospectorFind aBeanIntrospectionfor the given bean type.- Specified by:
findIntrospectionin interfaceBeanIntrospector- Type Parameters:
T- The bean generic type- Parameters:
beanType- The bean type- Returns:
- An optional introspection
-