Class AbstractBeanIntrospection<T>

    • Field Detail

      • beanType

        protected final java.lang.Class<T> beanType
      • beanProperties

        protected final java.util.Map<java.lang.String,​BeanProperty<T,​java.lang.Object>> beanProperties
      • beanMethods

        protected final java.util.List<BeanMethod<T,​java.lang.Object>> beanMethods
    • Constructor Detail

      • AbstractBeanIntrospection

        protected AbstractBeanIntrospection​(@NonNull
                                            java.lang.Class<T> beanType,
                                            @Nullable
                                            AnnotationMetadata annotationMetadata,
                                            int propertyCount)
        Base class for bean instrospections.
        Parameters:
        beanType - The bean type
        annotationMetadata - The annotation metadata
        propertyCount - The property count
      • AbstractBeanIntrospection

        protected AbstractBeanIntrospection​(@NonNull
                                            java.lang.Class<T> beanType,
                                            @Nullable
                                            AnnotationMetadata annotationMetadata,
                                            int propertyCount,
                                            int methodCount)
        Base class for bean instrospections.
        Parameters:
        beanType - The bean type
        annotationMetadata - The annotation metadata
        propertyCount - The property count
        methodCount - The method count
    • Method Detail

      • getConstructorAnnotationMetadata

        protected AnnotationMetadata getConstructorAnnotationMetadata()
        Returns:
        Annotation metadata for the constructor.
        Since:
        3.0.0
      • getIndexedProperty

        @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)
        Description copied from interface: BeanIntrospection
        Get all the bean properties annotated for the given type.
        Specified by:
        getIndexedProperty in interface BeanIntrospection<T>
        Parameters:
        annotationType - The annotation type
        annotationValue - The annotation value
        Returns:
        A immutable collection of properties.
        See Also:
        Introspected.indexed()
      • propertyIndexOf

        public int propertyIndexOf​(java.lang.String name)
        Description copied from interface: BeanIntrospection
        Obtain the property index position.
        Specified by:
        propertyIndexOf in interface BeanIntrospection<T>
        Parameters:
        name - The name of the property
        Returns:
        A property index or -1 of not found.
      • getIndexedProperties

        @NonNull
        public java.util.Collection<BeanProperty<T,​java.lang.Object>> getIndexedProperties​(@NonNull
                                                                                                 java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
        Description copied from interface: BeanIntrospection
        Get all the bean properties annotated for the given annotation type. If the annotation is Introspected.indexed() by the given annotation, then it will be included in the resulting list.
        Specified by:
        getIndexedProperties in interface BeanIntrospection<T>
        Parameters:
        annotationType - The annotation type
        Returns:
        A immutable collection of properties.
        See Also:
        Introspected.indexed()
      • instantiateInternal

        @Internal
        protected abstract T instantiateInternal​(java.lang.Object[] arguments)
        Reflection free bean instantiation implementation for the given arguments.
        Parameters:
        arguments - The arguments
        Returns:
        The bean
      • addProperty

        @Internal
        protected final void addProperty​(@NonNull
                                         BeanProperty<T,​java.lang.Object> property)
        Adds a property at a particular index of the internal array passed to the constructor. Used by generated byte code for subclasses and not for public consumption.
        Parameters:
        property - The property.
      • addMethod

        @Internal
        protected final void addMethod​(@NonNull
                                       BeanMethod<T,​java.lang.Object> method)
        Adds a method to the introspection. Used by generated byte code for subclasses and not for public consumption.
        Parameters:
        method - The property.
      • getBeanMethods

        @NonNull
        public java.util.Collection<BeanMethod<T,​java.lang.Object>> getBeanMethods()
        Description copied from interface: BeanIntrospection
        Returns the 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.

        Specified by:
        getBeanMethods in interface BeanIntrospection<T>
        Returns:
        A immutable collection of methods.
      • indexProperty

        @Internal
        protected final void indexProperty​(@NonNull
                                           java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
                                           @NonNull
                                           java.lang.String propertyName)
        Used to produce an index for particular annotation type. Method referenced by generated byte code and not for public consumption. Should be called after addProperty(BeanProperty) if required.
        Parameters:
        annotationType - The annotation type
        propertyName - The property name
      • indexProperty

        @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)
        Used to produce an index for particular annotation type. Method referenced by generated byte code and not for public consumption. Should be called after addProperty(BeanProperty) if required.
        Parameters:
        annotationType - The annotation type
        propertyName - The property name
        annotationValue - The annotation value
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object