Module io.helidon.graal.nativeimage
Class NativeUtil
java.lang.Object
io.helidon.integrations.graal.nativeimage.extension.NativeUtil
Utilities to help with discovery and analysis of the image.
-
Method Summary
Modifier and TypeMethodDescriptionclassMapper
(String description) Class mapper.static NativeUtil
create
(NativeTrace tracer, io.github.classgraph.ScanResult scan, Function<String, Class<?>> classResolver, Function<Class<?>, Boolean> exclusion) Create a new instance.findAnnotated
(String annotation) Find all classes annotated with the provided annotation.findInterfaces
(Class<?> aClass) Get all interfaces of the type.findSubclasses
(String superclassName) Find all direct subclasses of the provided type.findSuperclasses
(Class<?> aClass) Find all superclasses of this type.Class
<?> getSimpleType
(Function<String, Class<?>> classResolver, io.github.classgraph.FieldInfo fieldInfo) Get the type of the field.Class
<?> getSimpleType
(Function<String, Class<?>> classResolver, io.github.classgraph.MethodParameterInfo paramInfo) Get the type of the parameter.boolean
Check if method has the required parameters.inclusionFilter
(String description) Filter to exclude types that are marked as excluded.
-
Method Details
-
create
public static NativeUtil create(NativeTrace tracer, io.github.classgraph.ScanResult scan, Function<String, Class<?>> classResolver, Function<Class<?>, Boolean> exclusion) Create a new instance.- Parameters:
tracer
- tracer to log messagesscan
- classpath scan resultclassResolver
- resolver of class names to classesexclusion
- excluded classes- Returns:
- a new utility
-
getSimpleType
public Class<?> getSimpleType(Function<String, Class<?>> classResolver, io.github.classgraph.FieldInfo fieldInfo) Get the type of the field.- Parameters:
classResolver
- resolver of names to classesfieldInfo
- field info to get type from- Returns:
- class of the field
-
findAnnotated
Find all classes annotated with the provided annotation.- Parameters:
annotation
- annotation to look for- Returns:
- set of annotated types
-
inclusionFilter
Filter to exclude types that are marked as excluded.- Parameters:
description
- filter description- Returns:
- a new predicate
-
classMapper
Class mapper.- Parameters:
description
- description of this instance- Returns:
- a new mapper from class names to classes
-
getSimpleType
public Class<?> getSimpleType(Function<String, Class<?>> classResolver, io.github.classgraph.MethodParameterInfo paramInfo) Get the type of the parameter.- Parameters:
classResolver
- resolver of names to classesparamInfo
- parameter info to get type from- Returns:
- class of the parameter
-
hasParams
Check if method has the required parameters.- Parameters:
method
- method to checkparams
- parameters to expect- Returns:
true
if parameters of the method match the expected parameters
-
findSuperclasses
Find all superclasses of this type.- Parameters:
aClass
- type- Returns:
- all super types
-
findInterfaces
Get all interfaces of the type.- Parameters:
aClass
- class to get interfaces for- Returns:
- set of interfaces with proper exclusions
-
findSubclasses
Find all direct subclasses of the provided type.- Parameters:
superclassName
- type- Returns:
- subclasses
-