Class GroovyElementFactory

java.lang.Object
io.micronaut.ast.groovy.visitor.GroovyElementFactory
All Implemented Interfaces:
ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>

@Internal 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>
Implementation of ElementFactory for Groovy.
Since:
2.3.0
Author:
graemerocher
  • Constructor Details

  • Method Details

    • newClassElement

      public ClassElement newClassElement(org.codehaus.groovy.ast.ClassNode classNode, ElementAnnotationMetadataFactory annotationMetadataFactory)
      Description copied from interface: ElementFactory
      Builds a new class element for the given type.
      Specified by:
      newClassElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      classNode - The type
      annotationMetadataFactory - The element annotation metadata factory
      Returns:
      The class element
    • newClassElement

      @NonNull public @NonNull ClassElement newClassElement(org.codehaus.groovy.ast.ClassNode classNode, ElementAnnotationMetadataFactory annotationMetadataFactory, Map<String,ClassElement> resolvedGenerics)
      Description copied from interface: ElementFactory
      Builds a new class element for the given type.
      Specified by:
      newClassElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      classNode - The type
      annotationMetadataFactory - The element annotation metadata factory
      resolvedGenerics - The resolved generics
      Returns:
      The class element
    • newMethodElement

      @NonNull public @NonNull GroovyMethodElement newMethodElement(ClassElement owningType, org.codehaus.groovy.ast.MethodNode method, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Description copied from interface: ElementFactory
      Builds a new method element for the given type.
      Specified by:
      newMethodElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      owningType - The owning class
      method - The method
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The method element
    • newSourceClassElement

      @NonNull public @NonNull ClassElement newSourceClassElement(org.codehaus.groovy.ast.ClassNode classNode, ElementAnnotationMetadataFactory annotationMetadataFactory)
      Description copied from interface: ElementFactory
      Builds a new source class element for the given type. This method differs from ElementFactory.newClassElement(Object, ElementAnnotationMetadataFactory) in that it should only be called from elements that are known to originate from source code.
      Specified by:
      newSourceClassElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      classNode - The type
      annotationMetadataFactory - The element annotation metadata factory
      Returns:
      The class element
    • newSourceMethodElement

      public GroovyMethodElement newSourceMethodElement(ClassElement owningType, org.codehaus.groovy.ast.MethodNode method, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Description copied from interface: ElementFactory
      Builds a new source method element for the given method. This method differs from ElementFactory.newMethodElement(ClassElement, Object, ElementAnnotationMetadataFactory) in that it should only be called from elements that are known to originate from source code.
      Specified by:
      newSourceMethodElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      owningType - The owning class
      method - The method
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The class element
    • newConstructorElement

      @NonNull public @NonNull ConstructorElement newConstructorElement(ClassElement owningType, org.codehaus.groovy.ast.MethodNode constructor, ElementAnnotationMetadataFactory annotationMetadataFactory)
      Description copied from interface: ElementFactory
      Builds a new constructor element for the given type.
      Specified by:
      newConstructorElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      owningType - The owning class
      constructor - The constructor
      annotationMetadataFactory - The element annotation metadata factory
      Returns:
      The constructor element
    • newEnumConstantElement

      public EnumConstantElement newEnumConstantElement(ClassElement declaringClass, org.codehaus.groovy.ast.FieldNode enumConstant, ElementAnnotationMetadataFactory annotationMetadataFactory)
      Description copied from interface: ElementFactory
      Builds a new enum constant element for the given type.
      Specified by:
      newEnumConstantElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      declaringClass - The owning class
      enumConstant - The enum constant
      annotationMetadataFactory - The element annotation metadata factory
      Returns:
      The enum constant element
    • newFieldElement

      @NonNull public @NonNull GroovyFieldElement newFieldElement(ClassElement owningType, org.codehaus.groovy.ast.FieldNode field, ElementAnnotationMetadataFactory annotationMetadataFactory)
      Description copied from interface: ElementFactory
      Builds a new field element for the given type.
      Specified by:
      newFieldElement in interface ElementFactory<org.codehaus.groovy.ast.AnnotatedNode,org.codehaus.groovy.ast.ClassNode,org.codehaus.groovy.ast.MethodNode,org.codehaus.groovy.ast.FieldNode>
      Parameters:
      owningType - The owning class
      field - The field
      annotationMetadataFactory - The element annotation metadata factory
      Returns:
      The field element