Class AbstractJavaElement
java.lang.Object
io.micronaut.inject.ast.annotation.AbstractAnnotationElement
io.micronaut.annotation.processing.visitor.AbstractJavaElement
- All Implemented Interfaces:
AnnotatedElement
,AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
,Described
,Named
,MutableAnnotationMetadataDelegate<Element>
,Element
- Direct Known Subclasses:
JavaClassElement
,JavaMethodElement
,JavaPackageElement
An abstract class for other elements to extend from.
- Since:
- 1.0
- Author:
- James Kleeh, graemerocher
-
Field Summary
Fields inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement
elementAnnotationMetadataFactory, presetAnnotationMetadata
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
Fields inherited from interface io.micronaut.inject.ast.Element
EMPTY_ELEMENT_ARRAY
Fields inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractJavaElement
copyThis()
protected void
copyValues
(AbstractJavaElement element) boolean
getName()
Returns the native underlying type.int
hashCode()
boolean
boolean
isFinal()
boolean
boolean
boolean
boolean
isPublic()
boolean
isStatic()
protected final AbstractJavaElement
makeCopy()
protected final @NonNull ClassElement
newClassElement
(JavaNativeElement owner, TypeMirror type, Map<String, ClassElement> declaredElementTypeArguments) Obtain the ClassElement for the given mirror.protected final @NonNull ClassElement
newClassElement
(TypeMirror type, Map<String, ClassElement> declaredElementTypeArguments) Obtain the ClassElement for the given mirror.protected final Map<String,
ClassElement> resolveTypeArguments
(ExecutableElement executableElement, Map<String, ClassElement> parentTypeArguments) protected final Map<String,
ClassElement> resolveTypeArguments
(TypeElement typeElement, @Nullable List<? extends TypeMirror> typeMirrorArguments) toString()
withAnnotationMetadata
(AnnotationMetadata annotationMetadata) Copies this element and overrides its annotations.Methods inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement
annotate, annotate, annotate, annotate, annotate, getAnnotationMetadata, getAnnotationMetadataToWrite, getElementAnnotationMetadata, getElementAnnotationMetadataFactory, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype
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
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, 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, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, 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
Methods inherited from interface io.micronaut.inject.ast.Element
getDescription, getDescription, getSimpleName, isSynthetic
-
Field Details
-
visitorContext
-
-
Method Details
-
copyThis
- Returns:
- copy of this element
-
copyValues
- Parameters:
element
- the values to be copied to
-
makeCopy
-
withAnnotationMetadata
Description copied from interface:Element
Copies this element and overrides its annotations.- Parameters:
annotationMetadata
- The annotation metadata- Returns:
- A new element
-
isPackagePrivate
public boolean isPackagePrivate()- Returns:
- True if the element is package private.
-
getName
- Returns:
- The name of the element. For a type this represents the binary name.
-
getModifiers
- Returns:
- The
ElementModifier
types for this class element
-
getDocumentation
- Returns:
- The documentation, if any.
-
isAbstract
public boolean isAbstract()- Returns:
- True if the element is abstract.
-
isStatic
public boolean isStatic()- Returns:
- True if the element is static.
-
isPublic
public boolean isPublic()- Returns:
- True if the element is public.
-
isPrivate
public boolean isPrivate()- Returns:
- True if the element is private.
-
isFinal
public boolean isFinal()- Returns:
- True if the element is final.
-
isProtected
public boolean isProtected()- Returns:
- True if the element is protected.
-
getNativeType
Description copied from interface:Element
Returns the native underlying type. This API is extended by all inject language implementations. The object returned by this method will be the language native type the information is being retrieved from.- Returns:
- The native type
-
toString
-
newClassElement
@NonNull protected final @NonNull ClassElement newClassElement(JavaNativeElement owner, TypeMirror type, Map<String, ClassElement> declaredElementTypeArguments) Obtain the ClassElement for the given mirror.- Parameters:
owner
- The ownertype
- The typedeclaredElementTypeArguments
- The type arguments of the declaring element (method, class)- Returns:
- The class element
-
newClassElement
@NonNull protected final @NonNull ClassElement newClassElement(TypeMirror type, Map<String, ClassElement> declaredElementTypeArguments) Obtain the ClassElement for the given mirror.- Parameters:
type
- The typedeclaredElementTypeArguments
- The type arguments of the declaring element (method, class)- Returns:
- The class element
-
resolveTypeArguments
protected final Map<String,ClassElement> resolveTypeArguments(TypeElement typeElement, @Nullable @Nullable List<? extends TypeMirror> typeMirrorArguments) -
resolveTypeArguments
protected final Map<String,ClassElement> resolveTypeArguments(ExecutableElement executableElement, Map<String, ClassElement> parentTypeArguments) -
equals
-
hashCode
public int hashCode()
-