Class JavaElementFactory

  • All Implemented Interfaces:
    io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>

    public class JavaElementFactory
    extends java.lang.Object
    implements io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
    An implementation of ElementFactory for Java.
    Since:
    2.3.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      JavaClassElement newClassElement​(javax.lang.model.element.TypeElement type, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      io.micronaut.inject.ast.ClassElement newClassElement​(javax.lang.model.element.TypeElement type, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement> resolvedGenerics)  
      io.micronaut.annotation.processing.visitor.JavaConstructorElement newConstructorElement​(io.micronaut.inject.ast.ClassElement declaringClass, javax.lang.model.element.ExecutableElement constructor, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      io.micronaut.annotation.processing.visitor.JavaEnumConstantElement newEnumConstantElement​(io.micronaut.inject.ast.ClassElement declaringClass, javax.lang.model.element.VariableElement enumConstant, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      io.micronaut.annotation.processing.visitor.JavaFieldElement newFieldElement​(io.micronaut.inject.ast.ClassElement declaringClass, javax.lang.model.element.VariableElement field, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      io.micronaut.annotation.processing.visitor.JavaFieldElement newFieldElement​(javax.lang.model.element.VariableElement field, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      JavaMethodElement newMethodElement​(io.micronaut.inject.ast.ClassElement declaringClass, javax.lang.model.element.ExecutableElement method, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      JavaMethodElement newMethodElement​(io.micronaut.inject.ast.ClassElement declaringClass, javax.lang.model.element.ExecutableElement method, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​javax.lang.model.type.TypeMirror>> genericTypes)
      Constructs a method method element with the given generic type information.
      io.micronaut.annotation.processing.visitor.JavaParameterElement newParameterElement​(io.micronaut.inject.ast.ClassElement declaringClass, javax.lang.model.element.VariableElement field, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
      Creates a new parameter element for the given arguments.
      JavaClassElement newSourceClassElement​(javax.lang.model.element.TypeElement type, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      JavaMethodElement newSourceMethodElement​(io.micronaut.inject.ast.ClassElement declaringClass, javax.lang.model.element.ExecutableElement method, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • newClassElement

        @NonNull
        public JavaClassElement newClassElement​(@NonNull
                                                javax.lang.model.element.TypeElement type,
                                                @NonNull
                                                io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newClassElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newClassElement

        @NonNull
        public io.micronaut.inject.ast.ClassElement newClassElement​(@NonNull
                                                                    javax.lang.model.element.TypeElement type,
                                                                    @NonNull
                                                                    io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
                                                                    @NonNull
                                                                    java.util.Map<java.lang.String,​io.micronaut.inject.ast.ClassElement> resolvedGenerics)
        Specified by:
        newClassElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newSourceClassElement

        @NonNull
        public JavaClassElement newSourceClassElement​(@NonNull
                                                      javax.lang.model.element.TypeElement type,
                                                      @NonNull
                                                      io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newSourceClassElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newSourceMethodElement

        @NonNull
        public JavaMethodElement newSourceMethodElement​(io.micronaut.inject.ast.ClassElement declaringClass,
                                                        @NonNull
                                                        javax.lang.model.element.ExecutableElement method,
                                                        @NonNull
                                                        io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newSourceMethodElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newMethodElement

        @NonNull
        public JavaMethodElement newMethodElement​(io.micronaut.inject.ast.ClassElement declaringClass,
                                                  @NonNull
                                                  javax.lang.model.element.ExecutableElement method,
                                                  @NonNull
                                                  io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newMethodElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newMethodElement

        public JavaMethodElement newMethodElement​(io.micronaut.inject.ast.ClassElement declaringClass,
                                                  @NonNull
                                                  javax.lang.model.element.ExecutableElement method,
                                                  @NonNull
                                                  io.micronaut.core.annotation.AnnotationMetadata annotationMetadata,
                                                  @Nullable
                                                  java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​javax.lang.model.type.TypeMirror>> genericTypes)
        Constructs a method method element with the given generic type information.
        Parameters:
        declaringClass - The declaring class
        method - The method
        annotationMetadata - The annotation metadata
        genericTypes - The generic type info
        Returns:
        The method element
      • newConstructorElement

        @NonNull
        public io.micronaut.annotation.processing.visitor.JavaConstructorElement newConstructorElement​(io.micronaut.inject.ast.ClassElement declaringClass,
                                                                                                       @NonNull
                                                                                                       javax.lang.model.element.ExecutableElement constructor,
                                                                                                       @NonNull
                                                                                                       io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newConstructorElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newEnumConstantElement

        @NonNull
        public io.micronaut.annotation.processing.visitor.JavaEnumConstantElement newEnumConstantElement​(io.micronaut.inject.ast.ClassElement declaringClass,
                                                                                                         @NonNull
                                                                                                         javax.lang.model.element.VariableElement enumConstant,
                                                                                                         @NonNull
                                                                                                         io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newEnumConstantElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newFieldElement

        @NonNull
        public io.micronaut.annotation.processing.visitor.JavaFieldElement newFieldElement​(io.micronaut.inject.ast.ClassElement declaringClass,
                                                                                           @NonNull
                                                                                           javax.lang.model.element.VariableElement field,
                                                                                           @NonNull
                                                                                           io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newFieldElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newFieldElement

        @NonNull
        public io.micronaut.annotation.processing.visitor.JavaFieldElement newFieldElement​(@NonNull
                                                                                           javax.lang.model.element.VariableElement field,
                                                                                           @NonNull
                                                                                           io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Specified by:
        newFieldElement in interface io.micronaut.inject.ast.ElementFactory<javax.lang.model.element.Element,​javax.lang.model.element.TypeElement,​javax.lang.model.element.ExecutableElement,​javax.lang.model.element.VariableElement>
      • newParameterElement

        @NonNull
        public io.micronaut.annotation.processing.visitor.JavaParameterElement newParameterElement​(io.micronaut.inject.ast.ClassElement declaringClass,
                                                                                                   @NonNull
                                                                                                   javax.lang.model.element.VariableElement field,
                                                                                                   @NonNull
                                                                                                   io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
        Creates a new parameter element for the given arguments.
        Parameters:
        declaringClass - The declaring class
        field - The field
        annotationMetadata - The annotation metadata
        Returns:
        The parameter element