Class GroovyClassElement

  • 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 GroovyClassElement
    extends AbstractGroovyElement
    implements io.micronaut.inject.ast.ArrayableClassElement
    A class element returning data from a ClassNode.
    Since:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.codehaus.groovy.ast.ClassNode classNode  
      • 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
      GroovyClassElement​(GroovyVisitorContext visitorContext, org.codehaus.groovy.ast.ClassNode classNode, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
    • 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<? extends 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.Map<java.lang.String,​java.util.Map<java.lang.String,​org.codehaus.groovy.ast.ClassNode>> getGenericTypeInfo()
      Builds and returns the generic type information.
      java.util.Collection<io.micronaut.inject.ast.ClassElement> getInterfaces()  
      java.util.Set<io.micronaut.inject.ast.ElementModifier> getModifiers()  
      java.lang.String getName()  
      java.lang.Object getNativeType()  
      io.micronaut.inject.ast.PackageElement getPackage()  
      java.lang.String getPackageName()  
      java.util.Optional<io.micronaut.inject.ast.MethodElement> getPrimaryConstructor()  
      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 isFinal()  
      boolean isInner()  
      boolean isInterface()  
      boolean isPrimitive()  
      boolean isPrivate()  
      boolean isProtected()  
      boolean isPublic()  
      boolean isStatic()  
      boolean isTypeVariable()  
      protected io.micronaut.inject.ast.ClassElement toClassElement​(org.codehaus.groovy.ast.ClassNode classNode)  
      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, getRawClassElement, getType, getTypeArguments, isAssignable, isEnum, isGenericPlaceholder, isIterable, isOptional, isProxy, isRecord, isWildcard
      • Methods inherited from interface io.micronaut.inject.ast.Element

        annotate, annotate, annotate, annotate, annotate, getDescription, getDescription, getDocumentation, isPackagePrivate, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype
      • Methods inherited from interface io.micronaut.inject.ast.TypedElement

        getGenericType
    • Field Detail

      • classNode

        protected final org.codehaus.groovy.ast.ClassNode classNode
    • Constructor Detail

      • GroovyClassElement

        public GroovyClassElement​(GroovyVisitorContext visitorContext,
                                  org.codehaus.groovy.ast.ClassNode classNode,
                                  io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Parameters:
        visitorContext - The visitor context
        classNode - The ClassNode
        annotationMetadata - The annotation metadata
    • Method Detail

      • isTypeVariable

        public boolean isTypeVariable()
        Specified by:
        isTypeVariable 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
      • getModifiers

        public java.util.Set<io.micronaut.inject.ast.ElementModifier> getModifiers()
        Specified by:
        getModifiers in interface io.micronaut.inject.ast.Element
      • isInner

        public boolean isInner()
        Specified by:
        isInner 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
      • isInterface

        public boolean isInterface()
        Specified by:
        isInterface 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
      • getPrimaryConstructor

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

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

        public java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​org.codehaus.groovy.ast.ClassNode>> getGenericTypeInfo()
        Builds and returns the generic type information.
        Returns:
        The generic type info
      • 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
      • 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
      • 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
      • getBeanProperties

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

        public boolean isArray()
        Specified by:
        isArray 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
      • getArrayDimensions

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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
      • 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
      • 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
      • isAbstract

        public boolean isAbstract()
        Specified by:
        isAbstract in interface io.micronaut.inject.ast.Element
      • isStatic

        public boolean isStatic()
        Specified by:
        isStatic in interface io.micronaut.inject.ast.Element
      • isPublic

        public boolean isPublic()
        Specified by:
        isPublic in interface io.micronaut.inject.ast.Element
      • isPrivate

        public boolean isPrivate()
        Specified by:
        isPrivate in interface io.micronaut.inject.ast.Element
      • isFinal

        public boolean isFinal()
        Specified by:
        isFinal in interface io.micronaut.inject.ast.Element
      • isProtected

        public boolean isProtected()
        Specified by:
        isProtected in interface io.micronaut.inject.ast.Element
      • getNativeType

        public java.lang.Object getNativeType()
        Specified by:
        getNativeType in interface io.micronaut.inject.ast.Element
      • 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
      • getBoundGenericTypes

        @NonNull
        public java.util.List<? extends 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
      • toClassElement

        protected final io.micronaut.inject.ast.ClassElement toClassElement​(org.codehaus.groovy.ast.ClassNode classNode)
      • 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