Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.util

public Class NativeImageUtil

extends Object
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException

Utilities for graal native image support; mostly to improve error message handling in case of missing information for native image.
Since
2.14

Field Summary

Modifier and TypeField and Description
private static final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean
isInNativeImage()

Checks whether we're running in SubstrateVM native image only by the presence of "org.graalvm.nativeimage.imagecode" system property, regardless of its value (buildtime or runtime).

public static boolean
isInNativeImageAndIsAtRuntime()

Check whether we're running in SubstrateVM native image and also in "runtime" mode.

public static boolean
isUnsupportedFeatureError(Throwable e)

Check whether the given error is a substratevm UnsupportedFeatureError

public static boolean
needsReflectionConfiguration(Class<?> cl)

Check whether the given class is likely missing reflection configuration (running in native image, and no members visible in reflection).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

RUNNING_IN_SVMback to summary
private static final boolean RUNNING_IN_SVM

Constructor Detail

NativeImageUtilback to summary
private NativeImageUtil()

Method Detail

isInNativeImageback to summary
public static boolean isInNativeImage()

Checks whether we're running in SubstrateVM native image only by the presence of "org.graalvm.nativeimage.imagecode" system property, regardless of its value (buildtime or runtime). We are irrespective of the build or runtime phase, because native-image can initialize static initializers at build time.

Since
2.16
isInNativeImageAndIsAtRuntimeback to summary
public static boolean isInNativeImageAndIsAtRuntime()

Check whether we're running in SubstrateVM native image and also in "runtime" mode. The "runtime" check cannot be a constant, because the static initializer may run early during build time

As optimization, RUNNING_IN_SVM is used to short-circuit on normal JVMs.

Since
2.16
isUnsupportedFeatureErrorback to summary
public static boolean isUnsupportedFeatureError(Throwable e)

Check whether the given error is a substratevm UnsupportedFeatureError

needsReflectionConfigurationback to summary
public static boolean needsReflectionConfiguration(Class<?> cl)

Check whether the given class is likely missing reflection configuration (running in native image, and no members visible in reflection).