Package io.micronaut.inject.utils
Class NativeElementsHelper<C,M>
java.lang.Object
io.micronaut.inject.utils.NativeElementsHelper<C,M>
- Type Parameters:
C
- The class native element typeM
- The method native element type
- Direct Known Subclasses:
GroovyNativeElementHelper
,JavaNativeElementsHelper
The native elements helper.
- Since:
- 4.3.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
The method element. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
excludeClass
(C classNode) Checks if the class needs to be excluded.final Collection<M>
findOverriddenMethods
(C classNode, M methodElement) Find overridden methods.protected Object
getClassCacheKey
(C classElement) Get a class cache key.protected abstract @NonNull Collection<C>
getInterfaces
(C classNode) Extracts the interfaces of the class.protected Object
getMethodCacheKey
(M methodElement) Get a method cache key.getMethodName
(M element) Gets the element name.getMethods
(C classNode) Extracts the enclosed elements of the class.protected abstract C
getSuperClass
(C classNode) Extracts the super class.protected abstract boolean
isInterface
(C classNode) Is interface.protected abstract boolean
Check if one method overrides another.final void
populateTypeHierarchy
(C element, List<C> hierarchy) Populate with the class hierarchy.
-
Constructor Details
-
NativeElementsHelper
public NativeElementsHelper()
-
-
Method Details
-
overrides
Check if one method overrides another.- Parameters:
m1
- The override methodm2
- The overridden methodowner
- The class owner of the methods- Returns:
- true if overridden
-
getMethodName
Gets the element name.- Parameters:
element
- The element- Returns:
- The name
-
getSuperClass
Extracts the super class.- Parameters:
classNode
- The class- Returns:
- The super calss
-
getInterfaces
Extracts the interfaces of the class.- Parameters:
classNode
- The class- Returns:
- The interfaces
-
getMethods
Extracts the enclosed elements of the class.- Parameters:
classNode
- The class- Returns:
- The enclosed elements
-
excludeClass
Checks if the class needs to be excluded.- Parameters:
classNode
- The class- Returns:
- true if to exclude
-
isInterface
Is interface.- Parameters:
classNode
- The class node- Returns:
- true if interface
-
getClassCacheKey
Get a class cache key.- Parameters:
classElement
- The class element- Returns:
- a new key or the previous value
-
getMethodCacheKey
Get a method cache key.- Parameters:
methodElement
- The method element- Returns:
- a new key or the previous value
-
populateTypeHierarchy
Populate with the class hierarchy.- Parameters:
element
- The elementhierarchy
- The hierarchy
-
findOverriddenMethods
Find overridden methods.- Parameters:
classNode
- The class of the methodmethodElement
- The method- Returns:
- the overridden methods
-