Interface ElementFactory<E, C extends E, M extends E, F extends E>

Type Parameters:
E - The type that represents the super type of all elements in the AST
C - The type that represents a class in the AST
M - The type that represents a method in the AST
F - The type that represents a field in the AST
All Known Implementing Classes:
GroovyElementFactory, JavaElementFactory

public interface ElementFactory<E, C extends E, M extends E, F extends E>
A factory for creating elements.
Since:
2.3.0
Author:
graemerocher
  • Method Details

    • newClassElement

      ClassElement newClassElement(C type, ElementAnnotationMetadataFactory annotationMetadataFactory)
      Builds a new class element for the given type.
      Parameters:
      type - The type
      annotationMetadataFactory - The element annotation metadata factory
      Returns:
      The class element
      Since:
      4.0.0
    • newClassElement

      @Deprecated default ClassElement newClassElement(C type, ElementAnnotationMetadataFactory annotationMetadataFactory, Map<String, ClassElement> typeArguments)
      Deprecated.
      no longer used
      Builds a new class element for the given type.
      Parameters:
      type - The type
      annotationMetadataFactory - The element annotation metadata factory
      typeArguments - The resolved generics
      Returns:
      The class element
      Since:
      4.0.0
    • newSourceClassElement

      ClassElement newSourceClassElement(C type, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Builds a new source class element for the given type. This method differs from newClassElement(Object, ElementAnnotationMetadataFactory) in that it should only be called from elements that are known to originate from source code.
      Parameters:
      type - The type
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The class element
      Since:
      4.0.0
    • newSourceMethodElement

      MethodElement newSourceMethodElement(ClassElement owningClass, M method, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Builds a new source method element for the given method. This method differs from newMethodElement(ClassElement, Object, ElementAnnotationMetadataFactory) in that it should only be called from elements that are known to originate from source code.
      Parameters:
      owningClass - The owning class
      method - The method
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The class element
      Since:
      4.0.0
    • newMethodElement

      MethodElement newMethodElement(ClassElement owningClass, M method, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Builds a new method element for the given type.
      Parameters:
      owningClass - The owning class
      method - The method
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The method element
      Since:
      4.0.0
    • newConstructorElement

      ConstructorElement newConstructorElement(ClassElement owningClass, M constructor, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Builds a new constructor element for the given type.
      Parameters:
      owningClass - The owning class
      constructor - The constructor
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The constructor element
      Since:
      4.0.0
    • newEnumConstantElement

      EnumConstantElement newEnumConstantElement(ClassElement owningClass, F enumConstant, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Builds a new enum constant element for the given type.
      Parameters:
      owningClass - The owning class
      enumConstant - The enum constant
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The enum constant element
      Since:
      4.0.0
    • newFieldElement

      FieldElement newFieldElement(ClassElement owningClass, F field, ElementAnnotationMetadataFactory elementAnnotationMetadataFactory)
      Builds a new field element for the given type.
      Parameters:
      owningClass - The owning class
      field - The field
      elementAnnotationMetadataFactory - The element annotation metadata factory
      Returns:
      The field element
      Since:
      4.0.0