Class AbstractGroovyElement

java.lang.Object
io.micronaut.inject.ast.annotation.AbstractAnnotationElement
io.micronaut.ast.groovy.visitor.AbstractGroovyElement
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.annotation.MutableAnnotationMetadataDelegate<io.micronaut.inject.ast.Element>, io.micronaut.inject.ast.Element
Direct Known Subclasses:
GroovyClassElement, GroovyEnumConstantElement, GroovyFieldElement, GroovyMethodElement, GroovyPackageElement, GroovyParameterElement

@Internal public abstract class AbstractGroovyElement extends io.micronaut.inject.ast.annotation.AbstractAnnotationElement
Abstract Groovy element.
Since:
1.1
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.codehaus.groovy.control.CompilationUnit
     
    protected final org.codehaus.groovy.control.SourceUnit
     
    protected final GroovyVisitorContext
     

    Fields inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement

    elementAnnotationMetadataFactory, presetAnnotationMetadata

    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.Element

    EMPTY_ELEMENT_ARRAY

    Fields inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate

    EMPTY
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractGroovyElement(GroovyVisitorContext visitorContext, GroovyNativeElement nativeElement, io.micronaut.inject.ast.annotation.ElementAnnotationMetadataFactory annotationMetadataFactory)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final @NonNull AbstractGroovyElement
    Makes a copy of this element.
    protected abstract @NonNull AbstractGroovyElement
    Constructs this element by invoking the constructor.
    protected void
    Copies additional values after the element was constructed by copyConstructor().
    boolean
     
     
     
    int
     
    boolean
     
    protected final @NonNull io.micronaut.inject.ast.ClassElement
    newClassElement(@NonNull org.codehaus.groovy.ast.ClassNode type, @Nullable Map<String,io.micronaut.inject.ast.ClassElement> genericsSpec)
     
    protected final @NonNull io.micronaut.inject.ast.ClassElement
    newClassElement(org.codehaus.groovy.ast.ClassNode type)
     
    protected final @NonNull io.micronaut.inject.ast.ClassElement
    newClassElement(org.codehaus.groovy.ast.GenericsType genericsType)
     
    protected final @NonNull Map<String,io.micronaut.inject.ast.ClassElement>
    resolveClassTypeArguments(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.ClassNode classNode, @Nullable Map<String,io.micronaut.inject.ast.ClassElement> parentTypeArguments, Set<Object> visitedTypes)
     
    protected final @NonNull Map<String,io.micronaut.inject.ast.ClassElement>
    resolveMethodTypeArguments(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.MethodNode methodNode, @Nullable Map<String,io.micronaut.inject.ast.ClassElement> parentTypeArguments)
     
    protected Set<io.micronaut.inject.ast.ElementModifier>
    resolveModifiers(org.codehaus.groovy.ast.ClassNode classNode)
    Resolve modifiers for a class node.
    protected Set<io.micronaut.inject.ast.ElementModifier>
    resolveModifiers(org.codehaus.groovy.ast.FieldNode fieldNode)
    Resolve modifiers for a field node.
    protected Set<io.micronaut.inject.ast.ElementModifier>
    resolveModifiers(org.codehaus.groovy.ast.MethodNode methodNode)
    Resolve modifiers for a method node.
    protected final @NonNull Map<String,io.micronaut.inject.ast.ClassElement>
    resolveTypeArgumentsToObject(org.codehaus.groovy.ast.ClassNode classNode)
     
    io.micronaut.inject.ast.Element
    withAnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
     

    Methods inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement

    annotate, annotate, annotate, annotate, annotate, getAnnotationMetadata, getAnnotationMetadataToWrite, getElementAnnotationMetadata, getElementAnnotationMetadataFactory, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, 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

    enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent

    Methods 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, synthesizeDeclaredAnnotationsByType

    Methods inherited from interface io.micronaut.inject.ast.Element

    getDescription, getDescription, getModifiers, getName, getSimpleName, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic, isSynthetic
  • Field Details

    • sourceUnit

      protected final org.codehaus.groovy.control.SourceUnit sourceUnit
    • compilationUnit

      protected final org.codehaus.groovy.control.CompilationUnit compilationUnit
    • visitorContext

      protected final GroovyVisitorContext visitorContext
  • Constructor Details

    • AbstractGroovyElement

      protected AbstractGroovyElement(GroovyVisitorContext visitorContext, GroovyNativeElement nativeElement, io.micronaut.inject.ast.annotation.ElementAnnotationMetadataFactory annotationMetadataFactory)
      Default constructor.
      Parameters:
      visitorContext - The groovy visitor context
      nativeElement - The native element
      annotationMetadataFactory - The annotation metadata factory
  • Method Details

    • copyConstructor

      @NonNull protected abstract @NonNull AbstractGroovyElement copyConstructor()
      Constructs this element by invoking the constructor.
      Returns:
      the copy
    • copyValues

      protected void copyValues(@NonNull @NonNull AbstractGroovyElement element)
      Copies additional values after the element was constructed by copyConstructor().
      Parameters:
      element - the values to be copied to
    • copy

      @NonNull protected final @NonNull AbstractGroovyElement copy()
      Makes a copy of this element.
      Returns:
      a copy
    • withAnnotationMetadata

      public io.micronaut.inject.ast.Element withAnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
    • getNativeType

      public GroovyNativeElement getNativeType()
    • isPackagePrivate

      public boolean isPackagePrivate()
    • newClassElement

      @NonNull protected final @NonNull io.micronaut.inject.ast.ClassElement newClassElement(@NonNull @NonNull org.codehaus.groovy.ast.ClassNode type, @Nullable @Nullable Map<String,io.micronaut.inject.ast.ClassElement> genericsSpec)
    • newClassElement

      @NonNull protected final @NonNull io.micronaut.inject.ast.ClassElement newClassElement(org.codehaus.groovy.ast.GenericsType genericsType)
    • newClassElement

      @NonNull protected final @NonNull io.micronaut.inject.ast.ClassElement newClassElement(org.codehaus.groovy.ast.ClassNode type)
    • resolveMethodTypeArguments

      @NonNull protected final @NonNull Map<String,io.micronaut.inject.ast.ClassElement> resolveMethodTypeArguments(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.MethodNode methodNode, @Nullable @Nullable Map<String,io.micronaut.inject.ast.ClassElement> parentTypeArguments)
    • resolveClassTypeArguments

      @NonNull protected final @NonNull Map<String,io.micronaut.inject.ast.ClassElement> resolveClassTypeArguments(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.ClassNode classNode, @Nullable @Nullable Map<String,io.micronaut.inject.ast.ClassElement> parentTypeArguments, Set<Object> visitedTypes)
    • resolveTypeArgumentsToObject

      @NonNull protected final @NonNull Map<String,io.micronaut.inject.ast.ClassElement> resolveTypeArgumentsToObject(org.codehaus.groovy.ast.ClassNode classNode)
    • getDocumentation

      public Optional<String> getDocumentation()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • resolveModifiers

      protected Set<io.micronaut.inject.ast.ElementModifier> resolveModifiers(org.codehaus.groovy.ast.MethodNode methodNode)
      Resolve modifiers for a method node.
      Parameters:
      methodNode - The method node
      Returns:
      The modifiers
    • resolveModifiers

      protected Set<io.micronaut.inject.ast.ElementModifier> resolveModifiers(org.codehaus.groovy.ast.FieldNode fieldNode)
      Resolve modifiers for a field node.
      Parameters:
      fieldNode - The field node
      Returns:
      The modifiers
    • resolveModifiers

      protected Set<io.micronaut.inject.ast.ElementModifier> resolveModifiers(org.codehaus.groovy.ast.ClassNode classNode)
      Resolve modifiers for a class node.
      Parameters:
      classNode - The class node
      Returns:
      The modifiers