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 voidregisterClassForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers an entire class for reflection 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
public static void registerClassForReflection(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access, String name) Registers an entire class for reflection use. -
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.
-