Package io.micronaut.ast.groovy.visitor
Class AbstractGroovyElement
java.lang.Object
io.micronaut.inject.ast.annotation.AbstractAnnotationElement
io.micronaut.ast.groovy.visitor.AbstractGroovyElement
- All Implemented Interfaces:
AnnotatedElement
,AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
,Described
,Named
,MutableAnnotationMetadataDelegate<Element>
,Element
- Direct Known Subclasses:
GroovyClassElement
,GroovyEnumConstantElement
,GroovyFieldElement
,GroovyMethodElement
,GroovyPackageElement
,GroovyParameterElement
Abstract Groovy element.
- Since:
- 1.1
- Author:
- Graeme Rocher, Denis Stepanov
-
Field Summary
Modifier and TypeFieldDescriptionprotected 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
ModifierConstructorDescriptionprotected
AbstractGroovyElement
(GroovyVisitorContext visitorContext, GroovyNativeElement nativeElement, ElementAnnotationMetadataFactory annotationMetadataFactory) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final @NonNull AbstractGroovyElement
copy()
Makes a copy of this element.protected abstract @NonNull AbstractGroovyElement
Constructs this element by invoking the constructor.protected void
copyValues
(@NonNull AbstractGroovyElement element) Copies additional values after the element was constructed bycopyConstructor()
.boolean
Returns the native underlying type.int
hashCode()
boolean
protected final @NonNull ClassElement
newClassElement
(@NonNull org.codehaus.groovy.ast.ClassNode type, @Nullable Map<String, ClassElement> genericsSpec) protected final @NonNull ClassElement
newClassElement
(org.codehaus.groovy.ast.ClassNode type) protected final @NonNull ClassElement
newClassElement
(org.codehaus.groovy.ast.GenericsType genericsType) protected final @NonNull Map<String,
ClassElement> resolveClassTypeArguments
(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.ClassNode classNode, @Nullable Map<String, ClassElement> parentTypeArguments, Set<Object> visitedTypes) protected final @NonNull Map<String,
ClassElement> resolveMethodTypeArguments
(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.MethodNode methodNode, @Nullable Map<String, ClassElement> parentTypeArguments) protected Set<ElementModifier>
resolveModifiers
(org.codehaus.groovy.ast.ClassNode classNode) Resolve modifiers for a class node.protected Set<ElementModifier>
resolveModifiers
(org.codehaus.groovy.ast.FieldNode fieldNode) Resolve modifiers for a field node.protected Set<ElementModifier>
resolveModifiers
(org.codehaus.groovy.ast.MethodNode methodNode) Resolve modifiers for a method node.protected final @NonNull Map<String,
ClassElement> resolveTypeArgumentsToObject
(org.codehaus.groovy.ast.ClassNode classNode) withAnnotationMetadata
(AnnotationMetadata annotationMetadata) Copies this element and overrides its annotations.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
-
-
Constructor Details
-
AbstractGroovyElement
protected AbstractGroovyElement(GroovyVisitorContext visitorContext, GroovyNativeElement nativeElement, ElementAnnotationMetadataFactory annotationMetadataFactory) Default constructor.- Parameters:
visitorContext
- The groovy visitor contextnativeElement
- The native elementannotationMetadataFactory
- The annotation metadata factory
-
-
Method Details
-
copyConstructor
Constructs this element by invoking the constructor.- Returns:
- the copy
-
copyValues
Copies additional values after the element was constructed bycopyConstructor()
.- Parameters:
element
- the values to be copied to
-
copy
Makes a copy of this element.- Returns:
- a copy
-
withAnnotationMetadata
Description copied from interface:Element
Copies this element and overrides its annotations.- Parameters:
annotationMetadata
- The annotation metadata- Returns:
- A new element
-
getNativeType
Description copied from interface:Element
Returns the native underlying type. This API is extended by all of the inject language implementations. The object returned by this method will be the language native type the information is being retrieved from.- Returns:
- The native type
-
isPackagePrivate
public boolean isPackagePrivate()- Returns:
- True if the element is package private.
-
newClassElement
@NonNull protected final @NonNull ClassElement newClassElement(@NonNull @NonNull org.codehaus.groovy.ast.ClassNode type, @Nullable @Nullable Map<String, ClassElement> genericsSpec) -
newClassElement
@NonNull protected final @NonNull ClassElement newClassElement(org.codehaus.groovy.ast.GenericsType genericsType) -
newClassElement
@NonNull protected final @NonNull ClassElement newClassElement(org.codehaus.groovy.ast.ClassNode type) -
resolveMethodTypeArguments
@NonNull protected final @NonNull Map<String,ClassElement> resolveMethodTypeArguments(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.MethodNode methodNode, @Nullable @Nullable Map<String, ClassElement> parentTypeArguments) -
resolveClassTypeArguments
@NonNull protected final @NonNull Map<String,ClassElement> resolveClassTypeArguments(GroovyNativeElement declaredElement, org.codehaus.groovy.ast.ClassNode classNode, @Nullable @Nullable Map<String, ClassElement> parentTypeArguments, Set<Object> visitedTypes) -
resolveTypeArgumentsToObject
@NonNull protected final @NonNull Map<String,ClassElement> resolveTypeArgumentsToObject(org.codehaus.groovy.ast.ClassNode classNode) -
getDocumentation
- Returns:
- The documentation, if any.
-
equals
-
hashCode
public int hashCode() -
resolveModifiers
Resolve modifiers for a method node.- Parameters:
methodNode
- The method node- Returns:
- The modifiers
-
resolveModifiers
Resolve modifiers for a field node.- Parameters:
fieldNode
- The field node- Returns:
- The modifiers
-
resolveModifiers
Resolve modifiers for a class node.- Parameters:
classNode
- The class node- Returns:
- The modifiers
-