public abstract class AbstractGroovyElement extends java.lang.Object implements AnnotationMetadataDelegate, Element
Modifier and Type | Field and Description |
---|---|
protected org.codehaus.groovy.control.CompilationUnit |
compilationUnit |
protected org.codehaus.groovy.control.SourceUnit |
sourceUnit |
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Constructor and Description |
---|
AbstractGroovyElement(org.codehaus.groovy.control.SourceUnit sourceUnit,
org.codehaus.groovy.control.CompilationUnit compilationUnit,
org.codehaus.groovy.ast.AnnotatedNode annotatedNode,
AnnotationMetadata annotationMetadata)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,org.codehaus.groovy.ast.ClassNode> |
alignNewGenericsInfo(org.codehaus.groovy.ast.GenericsType[] genericsTypes,
org.codehaus.groovy.ast.GenericsType[] redirectTypes,
java.util.Map<java.lang.String,org.codehaus.groovy.ast.ClassNode> genericsSpec)
Align the given generic types.
|
<T extends java.lang.annotation.Annotation> |
annotate(java.lang.String annotationType,
java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Annotate this element with the given annotation type.
|
AnnotationMetadata |
getAnnotationMetadata()
Supplies the metadata.
|
protected ClassElement |
getGenericElement(org.codehaus.groovy.control.SourceUnit sourceUnit,
org.codehaus.groovy.ast.ClassNode type,
ClassElement rawElement,
java.util.Map<java.lang.String,org.codehaus.groovy.ast.ClassNode> genericsSpec)
Get a generic element for the given element and data.
|
static ClassElement |
toClassElement(org.codehaus.groovy.control.SourceUnit sourceUnit,
org.codehaus.groovy.control.CompilationUnit compilationUnit,
org.codehaus.groovy.ast.ClassNode classNode,
AnnotationMetadata annotationMetadata) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
annotate, annotate, annotate, getDocumentation, getName, getNativeType, getSimpleName, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic
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, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
protected final org.codehaus.groovy.control.SourceUnit sourceUnit
protected final org.codehaus.groovy.control.CompilationUnit compilationUnit
public AbstractGroovyElement(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.control.CompilationUnit compilationUnit, org.codehaus.groovy.ast.AnnotatedNode annotatedNode, AnnotationMetadata annotationMetadata)
sourceUnit
- The source unitcompilationUnit
- The compilation unitannotatedNode
- The annotated nodeannotationMetadata
- The annotation metadatapublic AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
@CompileStatic public <T extends java.lang.annotation.Annotation> Element annotate(@NonNull java.lang.String annotationType, @NonNull java.util.function.Consumer<AnnotationValueBuilder<T>> consumer)
Element
annotate
in interface Element
T
- The annotation generic typeannotationType
- The annotation typeconsumer
- A function that receives the AnnotationValueBuilder
protected java.util.Map<java.lang.String,org.codehaus.groovy.ast.ClassNode> alignNewGenericsInfo(@NonNull org.codehaus.groovy.ast.GenericsType[] genericsTypes, @NonNull org.codehaus.groovy.ast.GenericsType[] redirectTypes, @NonNull java.util.Map<java.lang.String,org.codehaus.groovy.ast.ClassNode> genericsSpec)
genericsTypes
- The generic typesredirectTypes
- The redirect typesgenericsSpec
- The current generics spec@NonNull protected ClassElement getGenericElement(@NonNull org.codehaus.groovy.control.SourceUnit sourceUnit, @NonNull org.codehaus.groovy.ast.ClassNode type, @NonNull ClassElement rawElement, @NonNull java.util.Map<java.lang.String,org.codehaus.groovy.ast.ClassNode> genericsSpec)
sourceUnit
- The source unittype
- The typerawElement
- A raw element to fall back togenericsSpec
- The generics specpublic static ClassElement toClassElement(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.control.CompilationUnit compilationUnit, org.codehaus.groovy.ast.ClassNode classNode, AnnotationMetadata annotationMetadata)