Package io.micronaut.inject.ast
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 ASTC- The type that represents a class in the ASTM- The type that represents a method in the ASTF- 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 Summary
Modifier and TypeMethodDescriptiondefault @NonNull ClassElementnewClassElement(@NonNull C type, @NonNull ElementAnnotationMetadataFactory annotationMetadataFactory, @NonNull Map<String, ClassElement> typeArguments) Deprecated.no longer used@NonNull ClassElementnewClassElement(@NonNull C type, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new class element for the given type.@NonNull ConstructorElementnewConstructorElement(@NonNull ClassElement owningClass, @NonNull M constructor, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new constructor element for the given type.@NonNull EnumConstantElementnewEnumConstantElement(@NonNull ClassElement owningClass, @NonNull F enumConstant, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new enum constant element for the given type.@NonNull FieldElementnewFieldElement(@NonNull ClassElement owningClass, @NonNull F field, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new field element for the given type.@NonNull MethodElementnewMethodElement(@NonNull ClassElement owningClass, @NonNull M method, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new method element for the given type.@NonNull ClassElementnewSourceClassElement(@NonNull C type, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new source class element for the given type.@NonNull MethodElementnewSourceMethodElement(@NonNull ClassElement owningClass, @NonNull M method, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new source method element for the given method.
-
Method Details
-
newClassElement
@NonNull ClassElement newClassElement(@NonNull C type, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new class element for the given type.- Parameters:
type- The typeannotationMetadataFactory- The element annotation metadata factory- Returns:
- The class element
- Since:
- 4.0.0
-
newClassElement
@Deprecated default @NonNull ClassElement newClassElement(@NonNull C type, @NonNull ElementAnnotationMetadataFactory annotationMetadataFactory, @NonNull Map<String, ClassElement> typeArguments) Deprecated.no longer usedBuilds a new class element for the given type.- Parameters:
type- The typeannotationMetadataFactory- The element annotation metadata factorytypeArguments- The resolved generics- Returns:
- The class element
- Since:
- 4.0.0
-
newSourceClassElement
@NonNull ClassElement newSourceClassElement(@NonNull C type, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new source class element for the given type. This method differs fromnewClassElement(Object, ElementAnnotationMetadataFactory)in that it should only be called from elements that are known to originate from source code.- Parameters:
type- The typeelementAnnotationMetadataFactory- The element annotation metadata factory- Returns:
- The class element
- Since:
- 4.0.0
-
newSourceMethodElement
@NonNull MethodElement newSourceMethodElement(@NonNull ClassElement owningClass, @NonNull M method, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new source method element for the given method. This method differs fromnewMethodElement(ClassElement, Object, ElementAnnotationMetadataFactory)in that it should only be called from elements that are known to originate from source code.- Parameters:
owningClass- The owning classmethod- The methodelementAnnotationMetadataFactory- The element annotation metadata factory- Returns:
- The class element
- Since:
- 4.0.0
-
newMethodElement
@NonNull MethodElement newMethodElement(@NonNull ClassElement owningClass, @NonNull M method, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new method element for the given type.- Parameters:
owningClass- The owning classmethod- The methodelementAnnotationMetadataFactory- The element annotation metadata factory- Returns:
- The method element
- Since:
- 4.0.0
-
newConstructorElement
@NonNull ConstructorElement newConstructorElement(@NonNull ClassElement owningClass, @NonNull M constructor, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new constructor element for the given type.- Parameters:
owningClass- The owning classconstructor- The constructorelementAnnotationMetadataFactory- The element annotation metadata factory- Returns:
- The constructor element
- Since:
- 4.0.0
-
newEnumConstantElement
@NonNull EnumConstantElement newEnumConstantElement(@NonNull ClassElement owningClass, @NonNull F enumConstant, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new enum constant element for the given type.- Parameters:
owningClass- The owning classenumConstant- The enum constantelementAnnotationMetadataFactory- The element annotation metadata factory- Returns:
- The enum constant element
- Since:
- 4.0.0
-
newFieldElement
@NonNull FieldElement newFieldElement(@NonNull ClassElement owningClass, @NonNull F field, @NonNull ElementAnnotationMetadataFactory elementAnnotationMetadataFactory) Builds a new field element for the given type.- Parameters:
owningClass- The owning classfield- The fieldelementAnnotationMetadataFactory- The element annotation metadata factory- Returns:
- The field element
- Since:
- 4.0.0
-