Class AbstractInitializableBeanIntrospection<B>
java.lang.Object
io.micronaut.inject.beans.AbstractInitializableBeanIntrospection<B>
- Type Parameters:
B- The bean type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.beans.BeanInfo<B>, io.micronaut.core.beans.BeanIntrospection<B>, io.micronaut.core.beans.UnsafeBeanInstantiationIntrospection<B>, io.micronaut.core.order.Ordered, io.micronaut.core.type.ArgumentCoercible<B>
- Direct Known Subclasses:
AbstractInitializableBeanIntrospectionAndReference
public abstract class AbstractInitializableBeanIntrospection<B>
extends Object
implements io.micronaut.core.beans.UnsafeBeanInstantiationIntrospection<B>
Abstract implementation of the
BeanIntrospection interface. This class is subclasses at compilation time by generated byte code and should not be used directly.
Implementation is using method dispatch to access the bean instance.
- Since:
- 3.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBean method compile-time data container.static final classBean property compile-time data container.Nested classes/interfaces inherited from interface io.micronaut.core.beans.BeanIntrospection
io.micronaut.core.beans.BeanIntrospection.Builder<T> -
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTYFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractInitializableBeanIntrospection(Class<B> beanType, @Nullable io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @Nullable io.micronaut.core.annotation.AnnotationMetadata constructorAnnotationMetadata, @Nullable io.micronaut.core.type.Argument<?>[] constructorArguments, @Nullable AbstractInitializableBeanIntrospection.BeanPropertyRef<Object>[] propertiesRefs, @Nullable AbstractInitializableBeanIntrospection.BeanMethodRef<Object>[] methodsRefs) -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.beans.BeanIntrospection.Builder<B> builder()protected <V> @Nullable VTriggers the invocation of the method at index.protected <V> @Nullable VdispatchOne(int index, Object target, @Nullable Object arg) Triggers the invocation of the method at index for a single argument call.booleanfindIndexedProperty(Class<? extends Annotation> annotationType, String annotationValue) Get all the bean properties annotated for the given type.protected final MethodgetAccessibleTargetMethodByIndex(int index) FindMethodrepresentation at the method by index.io.micronaut.core.annotation.AnnotationMetadataCollection<io.micronaut.core.beans.BeanMethod<B, Object>> Collection<io.micronaut.core.beans.BeanProperty<B, Object>> protected Collection<io.micronaut.core.beans.BeanProperty<B, Object>> getBeanPropertiesIndexedSubset(int[] indexes) Returns subset of bean properties defined by an array of indexes.io.micronaut.core.beans.BeanConstructor<B> io.micronaut.core.type.Argument<?>[]Collection<io.micronaut.core.beans.BeanProperty<B, Object>> getIndexedProperties(Class<? extends Annotation> annotationType) getIndexedProperty(Class<? extends Annotation> annotationType, String annotationValue) getProperty(String name) getPropertyByIndex(int index) Obtain a property by its index.protected abstract MethodgetTargetMethodByIndex(int index) FindMethodrepresentation at the method by index.protected booleanWhether an accessible constructor exists.inthashCode()instantiate(boolean strictNullable, @Nullable Object... arguments) protected BinstantiateInternal(@Nullable Object @Nullable [] arguments) Reflection free bean instantiation implementation for the given arguments.instantiateUnsafe(@Nullable Object @Nullable ... arguments) intpropertyIndexOf(String name) toString()protected final RuntimeExceptionunknownDispatchAtIndexException(int index) Creates a new exception when the dispatch at index is not found.Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods inherited from interface io.micronaut.core.annotation.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, 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 io.micronaut.core.beans.BeanInfo
asArgument, getGenericBeanType, getOrderMethods inherited from interface io.micronaut.core.beans.BeanIntrospection
getIndexedProperty, getProperty, getPropertyNames, getReadProperty, getReadProperty, getReadPropertyNames, getRequiredProperty, getRequiredReadProperty, getRequiredWriteProperty, getWriteProperty, getWriteProperty, hasBuilder, instantiate, isBuildable
-
Constructor Details
-
AbstractInitializableBeanIntrospection
protected AbstractInitializableBeanIntrospection(Class<B> beanType, @Nullable io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @Nullable io.micronaut.core.annotation.AnnotationMetadata constructorAnnotationMetadata, @Nullable io.micronaut.core.type.Argument<?>[] constructorArguments, @Nullable AbstractInitializableBeanIntrospection.BeanPropertyRef<Object>[] propertiesRefs, @Nullable AbstractInitializableBeanIntrospection.BeanMethodRef<Object>[] methodsRefs)
-
-
Method Details
-
builder
-
hasConstructor
protected boolean hasConstructor()Whether an accessible constructor exists.- Returns:
- True if a default constructor exists
- Since:
- 4.7.11
-
instantiateInternal
-
getPropertyByIndex
-
propertyIndexOf
-
getTargetMethodByIndex
FindMethodrepresentation at the method by index. Used byMethodReference.getTargetMethod().- Parameters:
index- The index- Returns:
- The method
-
getAccessibleTargetMethodByIndex
FindMethodrepresentation at the method by index. Used byMethodReference.getTargetMethod().- Parameters:
index- The index- Returns:
- The method
- Since:
- 3.8.5
-
dispatch
-
dispatchOne
Triggers the invocation of the method at index for a single argument call. Allowing to not wrap a single argument in an object array.- Type Parameters:
V- The result type- Parameters:
index- The method indextarget- The targetarg- The argument- Returns:
- The result
-
unknownDispatchAtIndexException
Creates a new exception when the dispatch at index is not found.- Parameters:
index- The method index- Returns:
- The exception
-
findIndexedProperty
public @Nullable io.micronaut.core.beans.BeanProperty<B,Object> findIndexedProperty(Class<? extends Annotation> annotationType, String annotationValue) Get all the bean properties annotated for the given type. Nullable result method version ofgetIndexedProperty(Class, String).- Parameters:
annotationType- The annotation typeannotationValue- The annotation value- Returns:
- An immutable collection of properties.
- See Also:
-
getIndexedProperties
public Collection<io.micronaut.core.beans.BeanProperty<B,Object>> getIndexedProperties(Class<? extends Annotation> annotationType) - Specified by:
getIndexedPropertiesin interfaceio.micronaut.core.beans.BeanIntrospection<B>
-
getBeanPropertiesIndexedSubset
protected Collection<io.micronaut.core.beans.BeanProperty<B,Object>> getBeanPropertiesIndexedSubset(int[] indexes) Returns subset of bean properties defined by an array of indexes.- Parameters:
indexes- The indexes- Returns:
- a collection of bean properties
-
instantiate
-
instantiate
-
instantiateUnsafe
-
getConstructor
-
getConstructorArguments
public io.micronaut.core.type.Argument<?>[] getConstructorArguments()- Specified by:
getConstructorArgumentsin interfaceio.micronaut.core.beans.BeanIntrospection<B>
-
getIndexedProperty
-
getProperty
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getBeanProperties
- Specified by:
getBeanPropertiesin interfaceio.micronaut.core.beans.BeanIntrospection<B>
-
getBeanReadProperties
-
getBeanWriteProperties
-
getBeanType
-
getBeanMethods
- Specified by:
getBeanMethodsin interfaceio.micronaut.core.beans.BeanIntrospection<B>
-
equals
-
hashCode
-
toString
-