public class GroovyElementFactory extends Object implements ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
ElementFactory
for Groovy.Constructor and Description |
---|
GroovyElementFactory(GroovyVisitorContext groovyVisitorContext) |
Modifier and Type | Method and Description |
---|---|
ClassElement |
newClassElement(org.codehaus.groovy.ast.ClassNode classNode,
AnnotationMetadata annotationMetadata)
Builds a new class element for the given type.
|
ClassElement |
newClassElement(org.codehaus.groovy.ast.ClassNode classNode,
AnnotationMetadata annotationMetadata,
Map<String,ClassElement> resolvedGenerics)
Builds a new class element for the given type.
|
ConstructorElement |
newConstructorElement(ClassElement declaringClass,
org.codehaus.groovy.ast.MethodNode constructor,
AnnotationMetadata annotationMetadata)
Builds a new constructor element for the given type.
|
FieldElement |
newFieldElement(ClassElement declaringClass,
org.codehaus.groovy.ast.FieldNode field,
AnnotationMetadata annotationMetadata)
Builds a new field element for the given type.
|
FieldElement |
newFieldElement(org.codehaus.groovy.ast.FieldNode field,
AnnotationMetadata annotationMetadata)
Builds a new field element for the given field.
|
FieldElement |
newFieldElement(org.codehaus.groovy.ast.PropertyNode property,
AnnotationMetadata annotationMetadata)
Builds a new field element for the given property.
|
MethodElement |
newMethodElement(ClassElement declaringClass,
org.codehaus.groovy.ast.MethodNode method,
AnnotationMetadata annotationMetadata)
Builds a new method element for the given type.
|
ParameterElement |
newParameterElement(FieldElement field,
AnnotationMetadata annotationMetadata)
Constructs a new
ParameterElement for the given field element and metadata. |
ClassElement |
newSourceClassElement(org.codehaus.groovy.ast.ClassNode classNode,
AnnotationMetadata annotationMetadata)
Builds a new source class element for the given type.
|
MethodElement |
newSourceMethodElement(ClassElement declaringClass,
org.codehaus.groovy.ast.MethodNode method,
AnnotationMetadata annotationMetadata)
Builds a new source method element for the given method.
|
public GroovyElementFactory(GroovyVisitorContext groovyVisitorContext)
@NonNull public ClassElement newClassElement(@NonNull org.codehaus.groovy.ast.ClassNode classNode, @NonNull AnnotationMetadata annotationMetadata)
ElementFactory
newClassElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
classNode
- The typeannotationMetadata
- The resolved annotation metadata@NonNull public ClassElement newClassElement(@NonNull org.codehaus.groovy.ast.ClassNode classNode, @NonNull AnnotationMetadata annotationMetadata, @NonNull Map<String,ClassElement> resolvedGenerics)
ElementFactory
newClassElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
classNode
- The typeannotationMetadata
- The resolved annotation metadataresolvedGenerics
- The resolved generics@NonNull public MethodElement newMethodElement(ClassElement declaringClass, @NonNull org.codehaus.groovy.ast.MethodNode method, @NonNull AnnotationMetadata annotationMetadata)
ElementFactory
newMethodElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
declaringClass
- The declaring classmethod
- The methodannotationMetadata
- The resolved annotation metadata@NonNull public ClassElement newSourceClassElement(@NonNull org.codehaus.groovy.ast.ClassNode classNode, @NonNull AnnotationMetadata annotationMetadata)
ElementFactory
ElementFactory.newClassElement(Object, AnnotationMetadata)
in that
it should only be called from elements that are known to originate from source code.newSourceClassElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
classNode
- The typeannotationMetadata
- The resolved annotation metadata@NonNull public MethodElement newSourceMethodElement(ClassElement declaringClass, @NonNull org.codehaus.groovy.ast.MethodNode method, @NonNull AnnotationMetadata annotationMetadata)
ElementFactory
ElementFactory.newMethodElement(ClassElement, Object, AnnotationMetadata)
in that
it should only be called from elements that are known to originate from source code.newSourceMethodElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
declaringClass
- The declaring classmethod
- The methodannotationMetadata
- The resolved annotation metadata@NonNull public ConstructorElement newConstructorElement(ClassElement declaringClass, @NonNull org.codehaus.groovy.ast.MethodNode constructor, @NonNull AnnotationMetadata annotationMetadata)
ElementFactory
newConstructorElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
declaringClass
- The declaring classconstructor
- The constructorannotationMetadata
- The resolved annotation metadata@NonNull public FieldElement newFieldElement(ClassElement declaringClass, @NonNull org.codehaus.groovy.ast.FieldNode field, @NonNull AnnotationMetadata annotationMetadata)
ElementFactory
newFieldElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
declaringClass
- The declaring classfield
- The fieldannotationMetadata
- The resolved annotation metadata@NonNull public FieldElement newFieldElement(@NonNull org.codehaus.groovy.ast.FieldNode field, @NonNull AnnotationMetadata annotationMetadata)
ElementFactory
newFieldElement
in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
field
- The fieldannotationMetadata
- The resolved annotation metadatapublic FieldElement newFieldElement(@NonNull org.codehaus.groovy.ast.PropertyNode property, @NonNull AnnotationMetadata annotationMetadata)
property
- The propertyannotationMetadata
- The resolved annotation metadatapublic ParameterElement newParameterElement(@NonNull FieldElement field, @NonNull AnnotationMetadata annotationMetadata)
ParameterElement
for the given field element and metadata.field
- The fieldannotationMetadata
- The metadata