Class JavaElementFactory
java.lang.Object
io.micronaut.annotation.processing.visitor.JavaElementFactory
- All Implemented Interfaces:
ElementFactory<Element, TypeElement, ExecutableElement, VariableElement>
@Internal
public class JavaElementFactory
extends Object
implements ElementFactory<Element, TypeElement, ExecutableElement, VariableElement>
An implementation of
ElementFactory for Java.- Since:
- 2.3.0
- Author:
- graemerocher
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnewClassElement(TypeElement type, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new class element for the given type.newClassElement(TypeElement type, ElementAnnotationMetadataFactory annotationMetadataFactory, Map<String, ClassElement> resolvedGenerics) Builds a new class element for the given type.io.micronaut.annotation.processing.visitor.JavaConstructorElementnewConstructorElement(ClassElement owningType, ExecutableElement constructor, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new constructor element for the given type.io.micronaut.annotation.processing.visitor.JavaEnumConstantElementnewEnumConstantElement(ClassElement owningType, VariableElement enumConstant, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new enum constant element for the given type.io.micronaut.annotation.processing.visitor.JavaFieldElementnewFieldElement(ClassElement owningType, VariableElement field, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new field element for the given type.newMethodElement(ClassElement owningType, ExecutableElement method, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new method element for the given type.newSourceClassElement(TypeElement type, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new source class element for the given type.newSourceMethodElement(ClassElement declaringClass, ExecutableElement method, ElementAnnotationMetadataFactory annotationMetadataFactory) Builds a new source method element for the given method.
-
Constructor Details
-
JavaElementFactory
-
-
Method Details
-
newClassElement
public JavaClassElement newClassElement(TypeElement type, ElementAnnotationMetadataFactory annotationMetadataFactory) Description copied from interface:ElementFactoryBuilds a new class element for the given type.- Specified by:
newClassElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
type- The typeannotationMetadataFactory- The element annotation metadata factory- Returns:
- The class element
-
newClassElement
public ClassElement newClassElement(TypeElement type, ElementAnnotationMetadataFactory annotationMetadataFactory, Map<String, ClassElement> resolvedGenerics) Description copied from interface:ElementFactoryBuilds a new class element for the given type.- Specified by:
newClassElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
type- The typeannotationMetadataFactory- The element annotation metadata factoryresolvedGenerics- The resolved generics- Returns:
- The class element
-
newSourceClassElement
public JavaClassElement newSourceClassElement(TypeElement type, ElementAnnotationMetadataFactory annotationMetadataFactory) Description copied from interface:ElementFactoryBuilds a new source class element for the given type. This method differs fromElementFactory.newClassElement(Object, ElementAnnotationMetadataFactory)in that it should only be called from elements that are known to originate from source code.- Specified by:
newSourceClassElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
type- The typeannotationMetadataFactory- The element annotation metadata factory- Returns:
- The class element
-
newSourceMethodElement
public JavaMethodElement newSourceMethodElement(ClassElement declaringClass, ExecutableElement method, ElementAnnotationMetadataFactory annotationMetadataFactory) Description copied from interface:ElementFactoryBuilds a new source method element for the given method. This method differs fromElementFactory.newMethodElement(ClassElement, Object, ElementAnnotationMetadataFactory)in that it should only be called from elements that are known to originate from source code.- Specified by:
newSourceMethodElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
declaringClass- The owning classmethod- The methodannotationMetadataFactory- The element annotation metadata factory- Returns:
- The class element
-
newMethodElement
public JavaMethodElement newMethodElement(ClassElement owningType, ExecutableElement method, ElementAnnotationMetadataFactory annotationMetadataFactory) Description copied from interface:ElementFactoryBuilds a new method element for the given type.- Specified by:
newMethodElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
owningType- The owning classmethod- The methodannotationMetadataFactory- The element annotation metadata factory- Returns:
- The method element
-
newConstructorElement
public io.micronaut.annotation.processing.visitor.JavaConstructorElement newConstructorElement(ClassElement owningType, ExecutableElement constructor, ElementAnnotationMetadataFactory annotationMetadataFactory) Description copied from interface:ElementFactoryBuilds a new constructor element for the given type.- Specified by:
newConstructorElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
owningType- The owning classconstructor- The constructorannotationMetadataFactory- The element annotation metadata factory- Returns:
- The constructor element
-
newEnumConstantElement
public io.micronaut.annotation.processing.visitor.JavaEnumConstantElement newEnumConstantElement(ClassElement owningType, VariableElement enumConstant, ElementAnnotationMetadataFactory annotationMetadataFactory) Description copied from interface:ElementFactoryBuilds a new enum constant element for the given type.- Specified by:
newEnumConstantElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
owningType- The owning classenumConstant- The enum constantannotationMetadataFactory- The element annotation metadata factory- Returns:
- The enum constant element
-
newFieldElement
public io.micronaut.annotation.processing.visitor.JavaFieldElement newFieldElement(ClassElement owningType, VariableElement field, ElementAnnotationMetadataFactory annotationMetadataFactory) Description copied from interface:ElementFactoryBuilds a new field element for the given type.- Specified by:
newFieldElementin interfaceElementFactory<Element, TypeElement, ExecutableElement, VariableElement>- Parameters:
owningType- The owning classfield- The fieldannotationMetadataFactory- The element annotation metadata factory- Returns:
- The field element
-