Class AbstractJavaElement
- java.lang.Object
-
- io.micronaut.annotation.processing.visitor.AbstractJavaElement
-
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotatedElement,io.micronaut.core.annotation.AnnotationMetadata,io.micronaut.core.annotation.AnnotationMetadataDelegate,io.micronaut.core.annotation.AnnotationMetadataProvider,io.micronaut.core.annotation.AnnotationSource,io.micronaut.core.naming.Described,io.micronaut.core.naming.Named,io.micronaut.inject.ast.Element
- Direct Known Subclasses:
JavaClassElement,JavaMethodElement,JavaPackageElement
public abstract class AbstractJavaElement extends java.lang.Object implements io.micronaut.inject.ast.ElementAn abstract class for other elements to extend from.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends java.lang.annotation.Annotation>
io.micronaut.inject.ast.Elementannotate(io.micronaut.core.annotation.AnnotationValue<T> annotationValue)<T extends java.lang.annotation.Annotation>
io.micronaut.inject.ast.Elementannotate(java.lang.String annotationType, java.util.function.Consumer<io.micronaut.core.annotation.AnnotationValueBuilder<T>> consumer)booleanequals(java.lang.Object o)io.micronaut.core.annotation.AnnotationMetadatagetAnnotationMetadata()java.util.Optional<java.lang.String>getDocumentation()java.util.Set<io.micronaut.inject.ast.ElementModifier>getModifiers()java.lang.StringgetName()java.lang.ObjectgetNativeType()inthashCode()booleanisAbstract()booleanisFinal()booleanisPackagePrivate()booleanisPrivate()booleanisProtected()booleanisPublic()booleanisStatic()protected io.micronaut.inject.ast.ClassElementmirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext)Obtain the ClassElement for the given mirror.protected io.micronaut.inject.ast.ClassElementmirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> genericsInfo)Obtain the ClassElement for the given mirror.protected io.micronaut.inject.ast.ClassElementmirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> genericsInfo, boolean includeTypeAnnotations)Obtain the ClassElement for the given mirror.protected io.micronaut.inject.ast.ClassElementmirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> genericsInfo, boolean includeTypeAnnotations, boolean isTypeVariable)Obtain the ClassElement for the given mirror.protected io.micronaut.inject.ast.ClassElementparameterizedClassElement(javax.lang.model.type.TypeMirror typeMirror, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> declaredGenericInfo)Returns a class element with aligned generic information.io.micronaut.inject.ast.ElementremoveAnnotation(java.lang.String annotationType)<T extends java.lang.annotation.Annotation>
io.micronaut.inject.ast.ElementremoveAnnotationIf(java.util.function.Predicate<io.micronaut.core.annotation.AnnotationValue<T>> predicate)io.micronaut.inject.ast.ElementremoveStereotype(java.lang.String annotationType)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
getAnnotationValuesByName, getAnnotationValuesByStereotype, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
-
-
-
Method Detail
-
annotate
@NonNull public <T extends java.lang.annotation.Annotation> io.micronaut.inject.ast.Element annotate(@NonNull java.lang.String annotationType, @NonNull java.util.function.Consumer<io.micronaut.core.annotation.AnnotationValueBuilder<T>> consumer)- Specified by:
annotatein interfaceio.micronaut.inject.ast.Element
-
annotate
public <T extends java.lang.annotation.Annotation> io.micronaut.inject.ast.Element annotate(io.micronaut.core.annotation.AnnotationValue<T> annotationValue)
- Specified by:
annotatein interfaceio.micronaut.inject.ast.Element
-
removeAnnotation
public io.micronaut.inject.ast.Element removeAnnotation(@NonNull java.lang.String annotationType)- Specified by:
removeAnnotationin interfaceio.micronaut.inject.ast.Element
-
removeAnnotationIf
public <T extends java.lang.annotation.Annotation> io.micronaut.inject.ast.Element removeAnnotationIf(@NonNull java.util.function.Predicate<io.micronaut.core.annotation.AnnotationValue<T>> predicate)- Specified by:
removeAnnotationIfin interfaceio.micronaut.inject.ast.Element
-
removeStereotype
public io.micronaut.inject.ast.Element removeStereotype(@NonNull java.lang.String annotationType)- Specified by:
removeStereotypein interfaceio.micronaut.inject.ast.Element
-
isPackagePrivate
public boolean isPackagePrivate()
- Specified by:
isPackagePrivatein interfaceio.micronaut.inject.ast.Element
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceio.micronaut.inject.ast.Element- Specified by:
getNamein interfaceio.micronaut.core.naming.Named
-
getModifiers
public java.util.Set<io.micronaut.inject.ast.ElementModifier> getModifiers()
- Specified by:
getModifiersin interfaceio.micronaut.inject.ast.Element
-
getDocumentation
public java.util.Optional<java.lang.String> getDocumentation()
- Specified by:
getDocumentationin interfaceio.micronaut.inject.ast.Element
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin interfaceio.micronaut.inject.ast.Element
-
isStatic
public boolean isStatic()
- Specified by:
isStaticin interfaceio.micronaut.inject.ast.Element
-
isPublic
public boolean isPublic()
- Specified by:
isPublicin interfaceio.micronaut.inject.ast.Element
-
isPrivate
public boolean isPrivate()
- Specified by:
isPrivatein interfaceio.micronaut.inject.ast.Element
-
isFinal
public boolean isFinal()
- Specified by:
isFinalin interfaceio.micronaut.inject.ast.Element
-
isProtected
public boolean isProtected()
- Specified by:
isProtectedin interfaceio.micronaut.inject.ast.Element
-
getNativeType
public java.lang.Object getNativeType()
- Specified by:
getNativeTypein interfaceio.micronaut.inject.ast.Element
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
- Specified by:
getAnnotationMetadatain interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
parameterizedClassElement
@NonNull protected io.micronaut.inject.ast.ClassElement parameterizedClassElement(javax.lang.model.type.TypeMirror typeMirror, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> declaredGenericInfo)Returns a class element with aligned generic information.- Parameters:
typeMirror- The type mirrorvisitorContext- The visitor contextdeclaredGenericInfo- The declared generic info- Returns:
- The class element
-
mirrorToClassElement
@NonNull protected io.micronaut.inject.ast.ClassElement mirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext)Obtain the ClassElement for the given mirror.- Parameters:
returnType- The return typevisitorContext- The visitor context- Returns:
- The class element
-
mirrorToClassElement
@NonNull protected io.micronaut.inject.ast.ClassElement mirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> genericsInfo)Obtain the ClassElement for the given mirror.- Parameters:
returnType- The return typevisitorContext- The visitor contextgenericsInfo- The generic information.- Returns:
- The class element
-
mirrorToClassElement
@NonNull protected io.micronaut.inject.ast.ClassElement mirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> genericsInfo, boolean includeTypeAnnotations)Obtain the ClassElement for the given mirror.- Parameters:
returnType- The return typevisitorContext- The visitor contextgenericsInfo- The generic information.includeTypeAnnotations- Whether to include type level annotations in the metadata for the element- Returns:
- The class element
-
mirrorToClassElement
@NonNull protected io.micronaut.inject.ast.ClassElement mirrorToClassElement(javax.lang.model.type.TypeMirror returnType, JavaVisitorContext visitorContext, java.util.Map<java.lang.String,java.util.Map<java.lang.String,javax.lang.model.type.TypeMirror>> genericsInfo, boolean includeTypeAnnotations, boolean isTypeVariable)Obtain the ClassElement for the given mirror.- Parameters:
returnType- The return typevisitorContext- The visitor contextgenericsInfo- The generic information.includeTypeAnnotations- Whether to include type level annotations in the metadata for the elementisTypeVariable- is the type a type variable- Returns:
- The class element
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-