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

@Internal public abstract class AbstractJavaElement extends AbstractAnnotationElement
An abstract class for other elements to extend from.
Since:
1.0
Author:
James Kleeh, graemerocher
  • Field Details

  • Method Details

    • copyThis

      protected abstract AbstractJavaElement copyThis()
      Returns:
      copy of this element
    • copyValues

      protected void copyValues(AbstractJavaElement element)
      Parameters:
      element - the values to be copied to
    • makeCopy

      protected final AbstractJavaElement makeCopy()
    • withAnnotationMetadata

      public Element withAnnotationMetadata(AnnotationMetadata annotationMetadata)
      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

      @NonNull public @NonNull String getName()
      Returns:
      The name of the element. For a type this represents the binary name.
    • getModifiers

      public Set<ElementModifier> getModifiers()
      Returns:
      The ElementModifier types for this class element
    • getDocumentation

      public Optional<String> 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

      @NonNull public @NonNull JavaNativeElement 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

      public String toString()
      Overrides:
      toString in class Object
    • 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 owner
      type - The type
      declaredElementTypeArguments - 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 type
      declaredElementTypeArguments - 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object