Class JavaClassElement

  • All Implemented Interfaces:
    io.micronaut.core.annotation.AnnotatedElement, io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.naming.Described, io.micronaut.core.naming.Named, io.micronaut.inject.ast.ArrayableClassElement, io.micronaut.inject.ast.ClassElement, io.micronaut.inject.ast.Element, io.micronaut.inject.ast.TypedElement

    @Internal
    public class JavaClassElement
    extends AbstractJavaElement
    implements io.micronaut.inject.ast.ArrayableClassElement
    A class element returning data from a TypeElement.
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.lang.model.element.TypeElement classElement  
      protected JavaVisitorContext visitorContext  
      • Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata

        CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
      • Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

        EMPTY
      • Fields inherited from interface io.micronaut.inject.ast.ClassElement

        ZERO_CLASS_ELEMENTS
      • Fields inherited from interface io.micronaut.inject.ast.Element

        EMPTY_ELEMENT_ARRAY
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaClassElement​(javax.lang.model.element.TypeElement classElement, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, JavaVisitorContext visitorContext)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement>> getAllTypeArguments()  
      int getArrayDimensions()  
      java.util.List<io.micronaut.inject.ast.PropertyElement> getBeanProperties()  
      java.util.List<io.micronaut.inject.ast.ClassElement> getBoundGenericTypes()  
      java.util.List<? extends io.micronaut.inject.ast.GenericPlaceholderElement> getDeclaredGenericPlaceholders()  
      java.util.Optional<io.micronaut.inject.ast.MethodElement> getDefaultConstructor()  
      <T extends io.micronaut.inject.ast.Element>
      java.util.List<T>
      getEnclosedElements​(io.micronaut.inject.ast.ElementQuery<T> query)  
      java.util.Optional<io.micronaut.inject.ast.ClassElement> getEnclosingType()  
      java.util.Collection<io.micronaut.inject.ast.ClassElement> getInterfaces()  
      java.lang.String getName()  
      io.micronaut.inject.ast.PackageElement getPackage()  
      java.lang.String getPackageName()  
      java.util.Optional<io.micronaut.inject.ast.MethodElement> getPrimaryConstructor()  
      io.micronaut.inject.ast.ClassElement getRawClassElement()  
      java.lang.String getSimpleName()  
      java.util.Optional<io.micronaut.inject.ast.ClassElement> getSuperType()  
      java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement> getTypeArguments()  
      java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement> getTypeArguments​(java.lang.String type)  
      boolean isAbstract()  
      boolean isArray()  
      boolean isAssignable​(io.micronaut.inject.ast.ClassElement type)  
      boolean isAssignable​(java.lang.String type)  
      boolean isInner()  
      boolean isInterface()  
      boolean isPrimitive()  
      boolean isRecord()  
      boolean isTypeVariable()  
      java.lang.String toString()  
      io.micronaut.inject.ast.ClassElement withArrayDimensions​(int arrayDimensions)  
      io.micronaut.inject.ast.ClassElement withBoundGenericTypes​(java.util.List<? extends io.micronaut.inject.ast.ClassElement> typeArguments)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement

        isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
      • Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata

        getAnnotationValuesByName, getAnnotationValuesByStereotype, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
      • Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate

        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, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, 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
      • Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider

        getAnnotationMetadata
      • Methods inherited from interface io.micronaut.inject.ast.ArrayableClassElement

        fromArray, toArray
      • Methods inherited from interface io.micronaut.inject.ast.ClassElement

        addAssociatedBean, foldBoundGenericTypes, getCanonicalName, getEnclosedElement, getFields, getFields, getFirstTypeArgument, getType, getTypeArguments, isAssignable, isEnum, isGenericPlaceholder, isIterable, isOptional, isProxy, isWildcard
      • Methods inherited from interface io.micronaut.inject.ast.Element

        annotate, annotate, annotate, annotate, annotate, getDescription, getDescription, getDocumentation, getModifiers, getNativeType, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype
      • Methods inherited from interface io.micronaut.inject.ast.TypedElement

        getGenericType
    • Field Detail

      • classElement

        protected final javax.lang.model.element.TypeElement classElement
    • Constructor Detail

      • JavaClassElement

        @Internal
        public JavaClassElement​(javax.lang.model.element.TypeElement classElement,
                                io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
                                JavaVisitorContext visitorContext)
        Parameters:
        classElement - The TypeElement
        annotationMetadata - The annotation metadata
        visitorContext - The visitor context
    • Method Detail

      • isTypeVariable

        public boolean isTypeVariable()
        Specified by:
        isTypeVariable in interface io.micronaut.inject.ast.ClassElement
      • isInner

        public boolean isInner()
        Specified by:
        isInner in interface io.micronaut.inject.ast.ClassElement
      • isRecord

        public boolean isRecord()
        Specified by:
        isRecord in interface io.micronaut.inject.ast.ClassElement
      • getTypeArguments

        @NonNull
        public java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement> getTypeArguments​(@NonNull
                                                                                                           java.lang.String type)
        Specified by:
        getTypeArguments in interface io.micronaut.inject.ast.ClassElement
      • isPrimitive

        public boolean isPrimitive()
        Specified by:
        isPrimitive in interface io.micronaut.inject.ast.TypedElement
      • getInterfaces

        public java.util.Collection<io.micronaut.inject.ast.ClassElement> getInterfaces()
        Specified by:
        getInterfaces in interface io.micronaut.inject.ast.ClassElement
      • getSuperType

        public java.util.Optional<io.micronaut.inject.ast.ClassElement> getSuperType()
        Specified by:
        getSuperType in interface io.micronaut.inject.ast.ClassElement
      • isAbstract

        public boolean isAbstract()
        Specified by:
        isAbstract in interface io.micronaut.inject.ast.Element
        Overrides:
        isAbstract in class AbstractJavaElement
      • isInterface

        public boolean isInterface()
        Specified by:
        isInterface in interface io.micronaut.inject.ast.ClassElement
      • getBeanProperties

        public java.util.List<io.micronaut.inject.ast.PropertyElement> getBeanProperties()
        Specified by:
        getBeanProperties in interface io.micronaut.inject.ast.ClassElement
      • getEnclosedElements

        public <T extends io.micronaut.inject.ast.Element> java.util.List<T> getEnclosedElements​(@NonNull
                                                                                                 io.micronaut.inject.ast.ElementQuery<T> query)
        Specified by:
        getEnclosedElements in interface io.micronaut.inject.ast.ClassElement
      • isArray

        public boolean isArray()
        Specified by:
        isArray in interface io.micronaut.inject.ast.TypedElement
      • getArrayDimensions

        public int getArrayDimensions()
        Specified by:
        getArrayDimensions in interface io.micronaut.inject.ast.TypedElement
      • withArrayDimensions

        public io.micronaut.inject.ast.ClassElement withArrayDimensions​(int arrayDimensions)
        Specified by:
        withArrayDimensions in interface io.micronaut.inject.ast.ArrayableClassElement
      • getSimpleName

        public java.lang.String getSimpleName()
        Specified by:
        getSimpleName in interface io.micronaut.inject.ast.ClassElement
        Specified by:
        getSimpleName in interface io.micronaut.inject.ast.Element
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface io.micronaut.inject.ast.Element
        Specified by:
        getName in interface io.micronaut.core.naming.Named
        Overrides:
        getName in class AbstractJavaElement
      • getPackageName

        public java.lang.String getPackageName()
        Specified by:
        getPackageName in interface io.micronaut.inject.ast.ClassElement
      • getPackage

        public io.micronaut.inject.ast.PackageElement getPackage()
        Specified by:
        getPackage in interface io.micronaut.inject.ast.ClassElement
      • isAssignable

        public boolean isAssignable​(java.lang.String type)
        Specified by:
        isAssignable in interface io.micronaut.inject.ast.ClassElement
      • isAssignable

        public boolean isAssignable​(io.micronaut.inject.ast.ClassElement type)
        Specified by:
        isAssignable in interface io.micronaut.inject.ast.ClassElement
      • getPrimaryConstructor

        @NonNull
        public java.util.Optional<io.micronaut.inject.ast.MethodElement> getPrimaryConstructor()
        Specified by:
        getPrimaryConstructor in interface io.micronaut.inject.ast.ClassElement
      • getDefaultConstructor

        public java.util.Optional<io.micronaut.inject.ast.MethodElement> getDefaultConstructor()
        Specified by:
        getDefaultConstructor in interface io.micronaut.inject.ast.ClassElement
      • getEnclosingType

        public java.util.Optional<io.micronaut.inject.ast.ClassElement> getEnclosingType()
        Specified by:
        getEnclosingType in interface io.micronaut.inject.ast.ClassElement
      • getBoundGenericTypes

        @NonNull
        public java.util.List<io.micronaut.inject.ast.ClassElement> getBoundGenericTypes()
        Specified by:
        getBoundGenericTypes in interface io.micronaut.inject.ast.ClassElement
      • getDeclaredGenericPlaceholders

        @NonNull
        public java.util.List<? extends io.micronaut.inject.ast.GenericPlaceholderElement> getDeclaredGenericPlaceholders()
        Specified by:
        getDeclaredGenericPlaceholders in interface io.micronaut.inject.ast.ClassElement
      • getRawClassElement

        @NonNull
        public io.micronaut.inject.ast.ClassElement getRawClassElement()
        Specified by:
        getRawClassElement in interface io.micronaut.inject.ast.ClassElement
      • withBoundGenericTypes

        @NonNull
        public io.micronaut.inject.ast.ClassElement withBoundGenericTypes​(@NonNull
                                                                          java.util.List<? extends io.micronaut.inject.ast.ClassElement> typeArguments)
        Specified by:
        withBoundGenericTypes in interface io.micronaut.inject.ast.ClassElement
      • getTypeArguments

        @NonNull
        public java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement> getTypeArguments()
        Specified by:
        getTypeArguments in interface io.micronaut.inject.ast.ClassElement
      • getAllTypeArguments

        @NonNull
        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement>> getAllTypeArguments()
        Specified by:
        getAllTypeArguments in interface io.micronaut.inject.ast.ClassElement