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 |
protected GroovyVisitorContext |
visitorContext |
EMPTY_ELEMENT_ARRAY
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
EMPTY
Constructor and Description |
---|
AbstractGroovyElement(GroovyVisitorContext visitorContext,
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.
|
boolean |
isPackagePrivate() |
protected AnnotationMetadata |
resolveAnnotationMetadata(org.codehaus.groovy.ast.ClassNode type)
Resolves the annotation metadata for the given type.
|
static ClassElement |
toClassElement(org.codehaus.groovy.control.SourceUnit sourceUnit,
org.codehaus.groovy.control.CompilationUnit compilationUnit,
org.codehaus.groovy.ast.ClassNode classNode,
AnnotationMetadata annotationMetadata)
Deprecated.
Use
ElementFactory instead |
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, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, 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
hasDeclaredStereotype
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
protected final org.codehaus.groovy.control.SourceUnit sourceUnit
protected final org.codehaus.groovy.control.CompilationUnit compilationUnit
protected final GroovyVisitorContext visitorContext
public AbstractGroovyElement(GroovyVisitorContext visitorContext, org.codehaus.groovy.ast.AnnotatedNode annotatedNode, AnnotationMetadata annotationMetadata)
visitorContext
- The groovy visitor contextannotatedNode
- The annotated nodeannotationMetadata
- The annotation metadatapublic AnnotationMetadata getAnnotationMetadata()
AnnotationMetadataProvider
AnnotationMetadata.EMPTY_METADATA
.getAnnotationMetadata
in interface AnnotationMetadataProvider
AnnotationMetadata
public boolean isPackagePrivate()
isPackagePrivate
in interface Element
@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 spec@Deprecated public static ClassElement toClassElement(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.control.CompilationUnit compilationUnit, org.codehaus.groovy.ast.ClassNode classNode, AnnotationMetadata annotationMetadata)
ElementFactory
insteadsourceUnit
- The source unitcompilationUnit
- The compilation unitclassNode
- The class nodeannotationMetadata
- The metadata@NonNull protected AnnotationMetadata resolveAnnotationMetadata(@NonNull org.codehaus.groovy.ast.ClassNode type)
type
- The type