Class NativeElementsHelper<C,M>

java.lang.Object
io.micronaut.inject.utils.NativeElementsHelper<C,M>
Type Parameters:
C - The class native element type
M - The method native element type
Direct Known Subclasses:
GroovyNativeElementHelper, JavaNativeElementsHelper

@Internal public abstract class NativeElementsHelper<C,M> extends Object
The native elements helper.
Since:
4.3.0
Author:
Denis Stepanov
  • Constructor Details

    • NativeElementsHelper

      public NativeElementsHelper()
  • Method Details

    • overrides

      protected abstract boolean overrides(M m1, M m2, C owner)
      Check if one method overrides another.
      Parameters:
      m1 - The override method
      m2 - The overridden method
      owner - The class owner of the methods
      Returns:
      true if overridden
    • getMethodName

      @NonNull protected abstract @NonNull String getMethodName(M element)
      Gets the element name.
      Parameters:
      element - The element
      Returns:
      The name
    • getSuperClass

      @Nullable protected abstract C getSuperClass(C classNode)
      Extracts the super class.
      Parameters:
      classNode - The class
      Returns:
      The super calss
    • getInterfaces

      @NonNull protected abstract @NonNull Collection<C> getInterfaces(C classNode)
      Extracts the interfaces of the class.
      Parameters:
      classNode - The class
      Returns:
      The interfaces
    • getMethods

      @NonNull protected abstract @NonNull List<M> getMethods(C classNode)
      Extracts the enclosed elements of the class.
      Parameters:
      classNode - The class
      Returns:
      The enclosed elements
    • excludeClass

      protected abstract boolean excludeClass(C classNode)
      Checks if the class needs to be excluded.
      Parameters:
      classNode - The class
      Returns:
      true if to exclude
    • isInterface

      protected abstract boolean isInterface(C classNode)
      Is interface.
      Parameters:
      classNode - The class node
      Returns:
      true if interface
    • getClassCacheKey

      protected Object getClassCacheKey(C classElement)
      Get a class cache key.
      Parameters:
      classElement - The class element
      Returns:
      a new key or the previous value
    • getMethodCacheKey

      protected Object getMethodCacheKey(M methodElement)
      Get a method cache key.
      Parameters:
      methodElement - The method element
      Returns:
      a new key or the previous value
    • populateTypeHierarchy

      public final void populateTypeHierarchy(C element, List<C> hierarchy)
      Populate with the class hierarchy.
      Parameters:
      element - The element
      hierarchy - The hierarchy
    • findOverriddenMethods

      public final Collection<M> findOverriddenMethods(C classNode, M methodElement)
      Find overridden methods.
      Parameters:
      classNode - The class of the method
      methodElement - The method
      Returns:
      the overridden methods