T
- The generic type@Internal public abstract class AbstractBeanIntrospection<T> extends java.lang.Object implements BeanIntrospection<T>
BeanIntrospection
interface. This class is subclasses at compilation time by generated byte code and should not be used directly.Modifier and Type | Field and Description |
---|---|
protected AnnotationMetadata |
annotationMetadata |
protected java.util.List<BeanMethod<T,java.lang.Object>> |
beanMethods |
protected java.util.Map<java.lang.String,BeanProperty<T,java.lang.Object>> |
beanProperties |
protected java.lang.Class<T> |
beanType |
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Modifier | Constructor and Description |
---|---|
protected |
AbstractBeanIntrospection(java.lang.Class<T> beanType,
AnnotationMetadata annotationMetadata,
int propertyCount)
Base class for bean instrospections.
|
protected |
AbstractBeanIntrospection(java.lang.Class<T> beanType,
AnnotationMetadata annotationMetadata,
int propertyCount,
int methodCount)
Base class for bean instrospections.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addMethod(BeanMethod<T,java.lang.Object> method)
Adds a method to the introspection.
|
protected void |
addProperty(BeanProperty<T,java.lang.Object> property)
Adds a property at a particular index of the internal array passed to the constructor.
|
boolean |
equals(java.lang.Object o) |
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
java.util.Collection<BeanMethod<T,java.lang.Object>> |
getBeanMethods()
Returns the
BeanMethod instances for this introspection. |
java.util.Collection<BeanProperty<T,java.lang.Object>> |
getBeanProperties() |
java.lang.Class<T> |
getBeanType()
The bean type.
|
BeanConstructor<T> |
getConstructor() |
protected AnnotationMetadata |
getConstructorAnnotationMetadata() |
java.util.Collection<BeanProperty<T,java.lang.Object>> |
getIndexedProperties(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Get all the bean properties annotated for the given annotation type.
|
java.util.Optional<BeanProperty<T,java.lang.Object>> |
getIndexedProperty(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
java.lang.String annotationValue)
Get all the bean properties annotated for the given type.
|
java.util.Optional<BeanProperty<T,java.lang.Object>> |
getProperty(java.lang.String name)
Obtain a property by name.
|
int |
hashCode() |
protected void |
indexProperty(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
java.lang.String propertyName)
Used to produce an index for particular annotation type.
|
protected void |
indexProperty(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
java.lang.String propertyName,
java.lang.String annotationValue)
Used to produce an index for particular annotation type.
|
T |
instantiate(boolean strictNullable,
java.lang.Object... arguments)
Instantiates an instance of the bean, throwing an exception is instantiation is not possible.
|
protected abstract T |
instantiateInternal(java.lang.Object[] arguments)
Reflection free bean instantiation implementation for the given arguments.
|
int |
propertyIndexOf(java.lang.String name)
Obtain the property index position.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getConstructorArguments, getIndexedProperty, getIntrospection, getProperty, getPropertyNames, getRequiredProperty, instantiate, instantiate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, 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, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, 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, synthesizeDeclaredAnnotationsByType
getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
protected final AnnotationMetadata annotationMetadata
protected final java.lang.Class<T> beanType
protected final java.util.Map<java.lang.String,BeanProperty<T,java.lang.Object>> beanProperties
protected final java.util.List<BeanMethod<T,java.lang.Object>> beanMethods
protected AbstractBeanIntrospection(@NonNull java.lang.Class<T> beanType, @Nullable AnnotationMetadata annotationMetadata, int propertyCount)
beanType
- The bean typeannotationMetadata
- The annotation metadatapropertyCount
- The property countprotected AbstractBeanIntrospection(@NonNull java.lang.Class<T> beanType, @Nullable AnnotationMetadata annotationMetadata, int propertyCount, int methodCount)
beanType
- The bean typeannotationMetadata
- The annotation metadatapropertyCount
- The property countmethodCount
- The method countpublic BeanConstructor<T> getConstructor()
getConstructor
in interface BeanIntrospection<T>
protected AnnotationMetadata getConstructorAnnotationMetadata()
@NonNull public java.util.Optional<BeanProperty<T,java.lang.Object>> getIndexedProperty(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, @NonNull java.lang.String annotationValue)
BeanIntrospection
getIndexedProperty
in interface BeanIntrospection<T>
annotationType
- The annotation typeannotationValue
- The annotation valueIntrospected.indexed()
@NonNull public T instantiate(boolean strictNullable, java.lang.Object... arguments) throws InstantiationException
BeanIntrospection
instantiate
in interface BeanIntrospection<T>
strictNullable
- If true, require null parameters to be annotated with a nullable annotationarguments
- The arguments required to instantiate bean. Should match the types returned by BeanIntrospection.getConstructorArguments()
InstantiationException
- If the bean cannot be instantiated.@NonNull public java.util.Optional<BeanProperty<T,java.lang.Object>> getProperty(@NonNull java.lang.String name)
BeanIntrospection
getProperty
in interface BeanIntrospection<T>
name
- The name of the propertypublic int propertyIndexOf(java.lang.String name)
BeanIntrospection
propertyIndexOf
in interface BeanIntrospection<T>
name
- The name of the property@NonNull public java.util.Collection<BeanProperty<T,java.lang.Object>> getIndexedProperties(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
BeanIntrospection
Introspected.indexed()
by the given annotation,
then it will be included in the resulting list.getIndexedProperties
in interface BeanIntrospection<T>
annotationType
- The annotation typeIntrospected.indexed()
public AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
@NonNull public java.util.Collection<BeanProperty<T,java.lang.Object>> getBeanProperties()
getBeanProperties
in interface BeanIntrospection<T>
@NonNull public java.lang.Class<T> getBeanType()
BeanIntrospection
getBeanType
in interface BeanIntrospection<T>
@Internal protected abstract T instantiateInternal(java.lang.Object[] arguments)
arguments
- The arguments@Internal protected final void addProperty(@NonNull BeanProperty<T,java.lang.Object> property)
property
- The property.@Internal protected final void addMethod(@NonNull BeanMethod<T,java.lang.Object> method)
method
- The property.@NonNull public java.util.Collection<BeanMethod<T,java.lang.Object>> getBeanMethods()
BeanIntrospection
BeanMethod
instances for this introspection.
The BeanMethod
instances are only those methods annotated with io.micronaut.context.annotation.Executable
and hence represent a subset
of the actual methods of the class and do not include any methods that are exposed as BeanProperty
instances.
getBeanMethods
in interface BeanIntrospection<T>
@Internal protected final void indexProperty(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, @NonNull java.lang.String propertyName)
addProperty(BeanProperty)
if required.annotationType
- The annotation typepropertyName
- The property name@Internal protected final void indexProperty(@NonNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, @NonNull java.lang.String propertyName, @Nullable java.lang.String annotationValue)
addProperty(BeanProperty)
if required.annotationType
- The annotation typepropertyName
- The property nameannotationValue
- The annotation valuepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object