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
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe method element. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupForClass(Object nativeClassType) protected abstract booleanexcludeClass(C classNode) Checks if the class needs to be excluded.final Collection<M> findOverriddenMethods(C classNode, M methodElement) Find overridden methods.protected ObjectgetClassCacheKey(C classElement) Get a class cache key.protected abstract @NonNull Collection<C> getInterfaces(C classNode) Extracts the interfaces of the class.protected ObjectgetMethodCacheKey(M methodElement) Get a method cache key.protected abstract @NonNull StringgetMethodName(M element) Gets the element name.getMethods(C classNode) Extracts the enclosed elements of the class.protected abstract @Nullable CgetSuperClass(C classNode) Extracts the super class.protected abstract booleanisInterface(C classNode) Is interface.protected abstract booleanCheck if one method overrides another.final voidpopulateTypeHierarchy(C element, List<C> hierarchy) Populate with the class hierarchy.
-
Constructor Details
-
NativeElementsHelper
public NativeElementsHelper()
-
-
Method Details
-
cleanupForClass
- Parameters:
nativeClassType- The native class type to cleanup
-
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
-