Package com.google.api.gax.nativeimage
Class NativeImageUtils
java.lang.Object
com.google.api.gax.nativeimage.NativeImageUtils
Internal class offering helper methods for registering methods/classes for reflection.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MethodgetMethodOrFail(Class<?> clazz, String methodName, Class<?>... params) Returns the method of a class or fails if it is not present.static voidregisterClassForJni(Class<?> clazz) Registers an entire class for JNI use.static voidregisterClassForJni(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers an entire class for JNI use.static voidregisterClassForReflection(Class<?> clazz) Registers an entire class for reflection use.static voidregisterClassForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers an entire class for reflection use.static voidregisterClassHierarchyForJni(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className) Registers the transitive class hierarchy of the providedclassNamefor JNI use.static voidregisterClassHierarchyForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className) Registers the transitive class hierarchy of the providedclassNamefor reflection.static voidregisterConstructorsForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers all constructors of a class for reflection.static voidregisterForReflectiveInstantiation(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className) Registers a class for reflective construction via its default constructor.static voidregisterForUnsafeFieldAccess(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className, String... fields) Registers a class for unsafe reflective field access.
-
Method Details
-
getMethodOrFail
Returns the method of a class or fails if it is not present. -
registerForReflectiveInstantiation
public static void registerForReflectiveInstantiation(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className) Registers a class for reflective construction via its default constructor. -
registerConstructorsForReflection
public static void registerConstructorsForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers all constructors of a class for reflection. -
registerClassForReflection
Registers an entire class for reflection use. -
registerClassForReflection
public static void registerClassForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers an entire class for reflection use. -
registerClassForJni
Registers an entire class for JNI use. -
registerClassForJni
public static void registerClassForJni(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers an entire class for JNI use. -
registerClassHierarchyForJni
public static void registerClassHierarchyForJni(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className) Registers the transitive class hierarchy of the providedclassNamefor JNI use.The transitive class hierarchy contains the class itself and its transitive set of *non-private* nested subclasses.
-
registerClassHierarchyForReflection
public static void registerClassHierarchyForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className) Registers the transitive class hierarchy of the providedclassNamefor reflection.The transitive class hierarchy contains the class itself and its transitive set of *non-private* nested subclasses.
-
registerForUnsafeFieldAccess
public static void registerForUnsafeFieldAccess(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String className, String... fields) Registers a class for unsafe reflective field access.
-