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
public interface ElementFactory<E,C extends E,M extends E,F extends E>A factory for creating elements.- Since:
- 2.3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClassElementnewClassElement(C type, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Builds a new class element for the given type.ClassElementnewClassElement(C type, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.util.Map<java.lang.String,ClassElement> resolvedGenerics)Builds a new class element for the given type.ConstructorElementnewConstructorElement(ClassElement declaringClass, M constructor, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Builds a new constructor element for the given type.FieldElementnewFieldElement(F field, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Builds a new field element for the given field.FieldElementnewFieldElement(ClassElement declaringClass, F field, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Builds a new field element for the given type.MethodElementnewMethodElement(ClassElement declaringClass, M method, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Builds a new method element for the given type.ClassElementnewSourceClassElement(C type, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Builds a new source class element for the given type.MethodElementnewSourceMethodElement(ClassElement declaringClass, M method, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)Builds a new source method element for the given method.
-
-
-
Method Detail
-
newClassElement
@NonNull ClassElement newClassElement(@NonNull C type, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Builds a new class element for the given type.- Parameters:
type- The typeannotationMetadata- The resolved annotation metadata- Returns:
- The class element
-
newClassElement
@NonNull ClassElement newClassElement(@NonNull C type, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull java.util.Map<java.lang.String,ClassElement> resolvedGenerics)
Builds a new class element for the given type.- Parameters:
type- The typeannotationMetadata- The resolved annotation metadataresolvedGenerics- The resolved generics- Returns:
- The class element
- Since:
- 3.0.0
-
newSourceClassElement
@NonNull ClassElement newSourceClassElement(@NonNull C type, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Builds a new source class element for the given type. This method differs fromnewClassElement(Object, AnnotationMetadata)in that it should only be called from elements that are known to originate from source code.- Parameters:
type- The typeannotationMetadata- The resolved annotation metadata- Returns:
- The class element
- Since:
- 3.0.0
-
newSourceMethodElement
@NonNull MethodElement newSourceMethodElement(ClassElement declaringClass, @NonNull M method, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Builds a new source method element for the given method. This method differs fromnewMethodElement(ClassElement, Object, AnnotationMetadata)in that it should only be called from elements that are known to originate from source code.- Parameters:
declaringClass- The declaring classmethod- The methodannotationMetadata- The resolved annotation metadata- Returns:
- The class element
- Since:
- 3.0.0
-
newMethodElement
@NonNull MethodElement newMethodElement(ClassElement declaringClass, @NonNull M method, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Builds a new method element for the given type.- Parameters:
declaringClass- The declaring classmethod- The methodannotationMetadata- The resolved annotation metadata- Returns:
- The method element
-
newConstructorElement
@NonNull ConstructorElement newConstructorElement(ClassElement declaringClass, @NonNull M constructor, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Builds a new constructor element for the given type.- Parameters:
declaringClass- The declaring classconstructor- The constructorannotationMetadata- The resolved annotation metadata- Returns:
- The constructor element
-
newFieldElement
@NonNull FieldElement newFieldElement(ClassElement declaringClass, @NonNull F field, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Builds a new field element for the given type.- Parameters:
declaringClass- The declaring classfield- The fieldannotationMetadata- The resolved annotation metadata- Returns:
- The field element
-
newFieldElement
@NonNull FieldElement newFieldElement(@NonNull F field, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
Builds a new field element for the given field.- Parameters:
field- The fieldannotationMetadata- The resolved annotation metadata- Returns:
- The field element
-
-