public class JavaElementFactory extends Object implements ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>
ElementFactory for Java.| Constructor and Description |
|---|
JavaElementFactory(JavaVisitorContext visitorContext) |
| Modifier and Type | Method and Description |
|---|---|
JavaClassElement |
newClassElement(TypeElement type,
AnnotationMetadata annotationMetadata)
Builds a new class element for the given type.
|
ClassElement |
newClassElement(TypeElement type,
AnnotationMetadata annotationMetadata,
Map<String,ClassElement> resolvedGenerics)
Builds a new class element for the given type.
|
io.micronaut.annotation.processing.visitor.JavaConstructorElement |
newConstructorElement(ClassElement declaringClass,
ExecutableElement constructor,
AnnotationMetadata annotationMetadata)
Builds a new constructor element for the given type.
|
io.micronaut.annotation.processing.visitor.JavaFieldElement |
newFieldElement(ClassElement declaringClass,
VariableElement field,
AnnotationMetadata annotationMetadata)
Builds a new field element for the given type.
|
io.micronaut.annotation.processing.visitor.JavaFieldElement |
newFieldElement(VariableElement field,
AnnotationMetadata annotationMetadata)
Builds a new field element for the given field.
|
JavaMethodElement |
newMethodElement(ClassElement declaringClass,
ExecutableElement method,
AnnotationMetadata annotationMetadata)
Builds a new method element for the given type.
|
JavaMethodElement |
newMethodElement(ClassElement declaringClass,
ExecutableElement method,
AnnotationMetadata annotationMetadata,
Map<String,Map<String,TypeMirror>> genericTypes)
Constructs a method method element with the given generic type information.
|
io.micronaut.annotation.processing.visitor.JavaParameterElement |
newParameterElement(ClassElement declaringClass,
VariableElement field,
AnnotationMetadata annotationMetadata)
Creates a new parameter element for the given arguments.
|
JavaClassElement |
newSourceClassElement(TypeElement type,
AnnotationMetadata annotationMetadata)
Builds a new source class element for the given type.
|
JavaMethodElement |
newSourceMethodElement(ClassElement declaringClass,
ExecutableElement method,
AnnotationMetadata annotationMetadata)
Builds a new source method element for the given method.
|
public JavaElementFactory(JavaVisitorContext visitorContext)
@NonNull public JavaClassElement newClassElement(@NonNull TypeElement type, @NonNull AnnotationMetadata annotationMetadata)
ElementFactorynewClassElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>type - The typeannotationMetadata - The resolved annotation metadata@NonNull public ClassElement newClassElement(@NonNull TypeElement type, @NonNull AnnotationMetadata annotationMetadata, @NonNull Map<String,ClassElement> resolvedGenerics)
ElementFactorynewClassElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>type - The typeannotationMetadata - The resolved annotation metadataresolvedGenerics - The resolved generics@NonNull public JavaClassElement newSourceClassElement(@NonNull TypeElement type, @NonNull AnnotationMetadata annotationMetadata)
ElementFactoryElementFactory.newClassElement(Object, AnnotationMetadata) in that
it should only be called from elements that are known to originate from source code.newSourceClassElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>type - The typeannotationMetadata - The resolved annotation metadata@NonNull public JavaMethodElement newSourceMethodElement(ClassElement declaringClass, @NonNull ExecutableElement method, @NonNull AnnotationMetadata annotationMetadata)
ElementFactoryElementFactory.newMethodElement(ClassElement, Object, AnnotationMetadata) in that
it should only be called from elements that are known to originate from source code.newSourceMethodElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>declaringClass - The declaring classmethod - The methodannotationMetadata - The resolved annotation metadata@NonNull public JavaMethodElement newMethodElement(ClassElement declaringClass, @NonNull ExecutableElement method, @NonNull AnnotationMetadata annotationMetadata)
ElementFactorynewMethodElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>declaringClass - The declaring classmethod - The methodannotationMetadata - The resolved annotation metadatapublic JavaMethodElement newMethodElement(ClassElement declaringClass, @NonNull ExecutableElement method, @NonNull AnnotationMetadata annotationMetadata, @Nullable Map<String,Map<String,TypeMirror>> genericTypes)
declaringClass - The declaring classmethod - The methodannotationMetadata - The annotation metadatagenericTypes - The generic type info@NonNull public io.micronaut.annotation.processing.visitor.JavaConstructorElement newConstructorElement(ClassElement declaringClass, @NonNull ExecutableElement constructor, @NonNull AnnotationMetadata annotationMetadata)
ElementFactorynewConstructorElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>declaringClass - The declaring classconstructor - The constructorannotationMetadata - The resolved annotation metadata@NonNull public io.micronaut.annotation.processing.visitor.JavaFieldElement newFieldElement(ClassElement declaringClass, @NonNull VariableElement field, @NonNull AnnotationMetadata annotationMetadata)
ElementFactorynewFieldElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>declaringClass - The declaring classfield - The fieldannotationMetadata - The resolved annotation metadata@NonNull public io.micronaut.annotation.processing.visitor.JavaFieldElement newFieldElement(@NonNull VariableElement field, @NonNull AnnotationMetadata annotationMetadata)
ElementFactorynewFieldElement in interface ElementFactory<Element,TypeElement,ExecutableElement,VariableElement>field - The fieldannotationMetadata - The resolved annotation metadata@NonNull public io.micronaut.annotation.processing.visitor.JavaParameterElement newParameterElement(ClassElement declaringClass, @NonNull VariableElement field, @NonNull AnnotationMetadata annotationMetadata)
declaringClass - The declaring classfield - The fieldannotationMetadata - The annotation metadata