Interface ReflectiveIntrospection<T>
- Type Parameters:
T- The bean type
- All Superinterfaces:
AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, ArgumentCoercible<T>, BeanInfo<T>, BeanIntrospection<T>, Ordered
- All Known Implementing Classes:
ReflectionBeanIntrospection, SupplementedBeanIntrospection
BeanIntrospection contract: every constructor of
the type, and the members a property is made of, each with the class declaring it and its own metadata.
A specification that describes a type — the constraint metadata of Jakarta Validation, for instance —
names constructors by their parameter types and distinguishes the constraints declared on a field from the
ones declared on a getter, or in the type from the ones inherited from a super type. A generated
introspection merges the members of a property into one metadata unless it is compiled with
@Introspected(members = true); this contract always keeps them apart, and
BeanIntrospection.separatesDeclarations() says so for either.
- Since:
- 5.2.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA member of a property, with the field or method reflection read it from.Nested classes/interfaces inherited from interface BeanIntrospection
BeanIntrospection.Builder<T> -
Field Summary
Fields inherited from interface AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface AnnotationSource
EMPTYFields inherited from interface Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionfindDeclaredMethod(String name, Class<?>... parameterTypes) Finds the method the introspected type itself declares, with the annotations of that declaration only: the generated metadata of a method merges the annotations of the methods it overrides.Returns the constructors this introspection describes.default booleanA reflective introspection always does: the members of a property are read from the field and the accessors of every type declaring one, and the annotations of a method from the method itself, which Java reflection does not inherit.Methods inherited from interface AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods inherited from interface AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasEvaluatedExpressions, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface AnnotationMetadataProvider
getAnnotationMetadataMethods inherited from interface BeanInfo
asArgument, getGenericBeanType, getOrderMethods inherited from interface BeanIntrospection
builder, getBeanMethods, getBeanProperties, getBeanReadProperties, getBeanType, getBeanWriteProperties, getConstructor, getConstructorArguments, getIndexedProperties, getIndexedProperty, getIndexedProperty, getProperty, getProperty, getPropertyNames, getReadProperty, getReadProperty, getReadPropertyNames, getRequiredProperty, getRequiredReadProperty, getRequiredWriteProperty, getTypeArguments, getTypeArguments, getTypeArguments, getWriteProperty, getWriteProperty, hasBuilder, instantiate, instantiate, instantiate, isBuildable, propertyIndexOf
-
Method Details
-
getConstructors
List<BeanConstructor<T>> getConstructors()Description copied from interface:BeanIntrospectionReturns the constructors this introspection describes.By default an introspection only describes the constructor used to instantiate beans, in which case this method returns a singleton list containing
BeanIntrospection.getConstructor(). When the introspected type opts in viaIntrospected.constructors(), or by annotating individual constructors withio.micronaut.context.annotation.Executable, every described constructor is returned, including its own annotation metadata and the annotation metadata of its parameters.A described constructor reports the parameters of its JVM signature, which for a non-static inner class means that
BeanConstructor.getArguments()starts with the implicit enclosing instance, namedthis$0, exactly asConstructor.getParameterTypes()reports it. The enclosing instance must therefore be passed first toBeanConstructor.instantiate(Object...).BeanIntrospection.getConstructor()andBeanIntrospection.getConstructorArguments()keep the source level view and never describe it, so for a non-static inner class the first element of this list does not report the same arguments asBeanIntrospection.getConstructor().- Specified by:
getConstructorsin interfaceBeanIntrospection<T>- Returns:
- Every constructor of the type,
BeanIntrospection.getConstructor()first
-
separatesDeclarations
default boolean separatesDeclarations()A reflective introspection always does: the members of a property are read from the field and the accessors of every type declaring one, and the annotations of a method from the method itself, which Java reflection does not inherit.- Specified by:
separatesDeclarationsin interfaceBeanIntrospection<T>- Returns:
true
-
findDeclaredMethod
Finds the method the introspected type itself declares, with the annotations of that declaration only: the generated metadata of a method merges the annotations of the methods it overrides.- Parameters:
name- The method nameparameterTypes- The parameter types- Returns:
- The method declared by the type, empty when the type inherits it
-