Top Description Inners Methods
org.graalvm.nativeimage.hosted

public Interface Feature

Annotations
@Platforms:HOSTED_ONLY
Imports
java.lang.reflect.Executable, .Field, java.nio.file.Path, java.util.Collections, .List, .Set, java.util.function.BiConsumer, .Consumer, .Function, .Predicate, org.graalvm.nativeimage.ImageSingletons, .Platform, .Platforms

Features allow clients to intercept the native image generation and run custom initialization code at various stages. All code within feature classes is executed during native image generation, and never at run time.

Features have several advantages over static class initializers (which also run during native image generation):

Implementation classes must have a no-argument constructor, which is used to instantiate a singleton instance for each feature using reflection. The following features are included during native image generation:

Since
19.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static interface
public static interface
public static interface
public static interface
public static interface
public static interface
public static interface
public static interface
public static interface
public static interface
public static interface
Feature.DuringSetupAccess

Access methods available for Feature#duringSetup.

public static interface
Feature.FeatureAccess

Access methods that are available for all feature methods.

public static interface
public static interface
public static interface

Method Summary

Modifier and TypeMethod and Description
public default void
afterAnalysis(Feature.AfterAnalysisAccess
The supported operations that the feature can perform at this time
access
)

Handler for initializations after analysis and before universe creation.

public default void
afterCompilation(Feature.AfterCompilationAccess
The supported operations that the feature can perform at this time
access
)

Handler for initializations after compilation, i.e., before the native image is written.

public default void
afterHeapLayout(Feature.AfterHeapLayoutAccess
The supported operations that the feature can perform at this time
access
)

Handler for initializations after the native image heap and code layout.

public default void
afterImageWrite(Feature.AfterImageWriteAccess
The supported operations that the feature can perform at this time.
access
)

Handler for altering the image (or shared object) that the linker command produced.

public default void
afterRegistration(Feature.AfterRegistrationAccess
The supported operations that the feature can perform at this time
access
)

Handler for initializations after all features have been registered and all options have been parsed; but before any initializations for the static analysis have happened.

public default void
beforeAnalysis(Feature.BeforeAnalysisAccess
The supported operations that the feature can perform at this time
access
)

Handler for initializations before the static analysis.

public default void
beforeCompilation(Feature.BeforeCompilationAccess
The supported operations that the feature can perform at this time
access
)

Handler for initializations before compilation.

public default void
beforeImageWrite(Feature.BeforeImageWriteAccess
The supported operations that the feature can perform at this time.
access
)

Handler for altering the linker command after the native image has been built and before it is written.

public default void
beforeUniverseBuilding(Feature.BeforeUniverseBuildingAccess
The supported operations that the feature can perform at this time
access
)

Handler for code that needs to run before universe building, but after hosted meta-access has been created.

public default void
cleanup()

Handler for cleanup.

public default void
duringAnalysis(Feature.DuringAnalysisAccess
The supported operations that the feature can perform at this time
access
)

Handler for performing operations during the static analysis.

public default void
duringSetup(Feature.DuringSetupAccess
The supported operations that the feature can perform at this time
access
)

Handler for initializations at startup time.

public default String
getDescription()

A short description of the feature (e.g., "Enables Truffle support").

public default List<Class<? extends Feature>>
getRequiredFeatures()

Returns the list of features that this feature depends on.

public default String
getURL()

A URL to documentation or the sources of the feature.

public default boolean
isInConfiguration(Feature.IsInConfigurationAccess
The supported operations that the feature can perform at this time
access
)

This method is called immediately after the constructor, to check whether the feature is part of the configuration or not.

public default void
onAnalysisExit(Feature.OnAnalysisExitAccess
The supported operations that the feature can perform at this time
access
)

Handler for code that needs to run after the analysis, even if an error has occurred, e.g., like reporting code.

Method Detail

afterAnalysisback to summary
public default void afterAnalysis(Feature.AfterAnalysisAccess access)

Handler for initializations after analysis and before universe creation.

Parameters
access:Feature.AfterAnalysisAccess

The supported operations that the feature can perform at this time

Since
19.0
afterCompilationback to summary
public default void afterCompilation(Feature.AfterCompilationAccess access)

Handler for initializations after compilation, i.e., before the native image is written.

Parameters
access:Feature.AfterCompilationAccess

The supported operations that the feature can perform at this time

Since
19.0
afterHeapLayoutback to summary
public default void afterHeapLayout(Feature.AfterHeapLayoutAccess access)

Handler for initializations after the native image heap and code layout. Objects and methods have their offsets assigned. At this point, no additional objects must be added to the native image heap, i.e., modifying object fields of native image objects that are part of the native image heap is not allowed at this point.

Parameters
access:Feature.AfterHeapLayoutAccess

The supported operations that the feature can perform at this time

Since
19.0
afterImageWriteback to summary
public default void afterImageWrite(Feature.AfterImageWriteAccess access)

Handler for altering the image (or shared object) that the linker command produced.

Parameters
access:Feature.AfterImageWriteAccess

The supported operations that the feature can perform at this time.

Since
19.0
afterRegistrationback to summary
public default void afterRegistration(Feature.AfterRegistrationAccess access)

Handler for initializations after all features have been registered and all options have been parsed; but before any initializations for the static analysis have happened.

Parameters
access:Feature.AfterRegistrationAccess

The supported operations that the feature can perform at this time

Since
19.0
beforeAnalysisback to summary
public default void beforeAnalysis(Feature.BeforeAnalysisAccess access)

Handler for initializations before the static analysis.

Parameters
access:Feature.BeforeAnalysisAccess

The supported operations that the feature can perform at this time

Since
19.0
beforeCompilationback to summary
public default void beforeCompilation(Feature.BeforeCompilationAccess access)

Handler for initializations before compilation.

Parameters
access:Feature.BeforeCompilationAccess

The supported operations that the feature can perform at this time

Since
19.0
beforeImageWriteback to summary
public default void beforeImageWrite(Feature.BeforeImageWriteAccess access)

Handler for altering the linker command after the native image has been built and before it is written.

Parameters
access:Feature.BeforeImageWriteAccess

The supported operations that the feature can perform at this time.

Since
19.0
beforeUniverseBuildingback to summary
public default void beforeUniverseBuilding(Feature.BeforeUniverseBuildingAccess access)

Handler for code that needs to run before universe building, but after hosted meta-access has been created.

Parameters
access:Feature.BeforeUniverseBuildingAccess

The supported operations that the feature can perform at this time

Since
21.1
cleanupback to summary
public default void cleanup()

Handler for cleanup. Can be used to cleanup static data. This can avoid memory leaks if native image generation is done many times, e.g. during unit tests.

Usually, overriding this method can be avoided by putting a configuration object into the ImageSingletons.

Since
19.0
duringAnalysisback to summary
public default void duringAnalysis(Feature.DuringAnalysisAccess access)

Handler for performing operations during the static analysis. This handler is called after analysis is complete. So all analysis meta data is available. If the handler performs changes, e.g., makes new types or methods reachable, it needs to call DuringAnalysisAccess#requireAnalysisIteration(). This triggers a new iteration: analysis is performed again and the handler is called again.

Parameters
access:Feature.DuringAnalysisAccess

The supported operations that the feature can perform at this time

Since
19.0
duringSetupback to summary
public default void duringSetup(Feature.DuringSetupAccess access)

Handler for initializations at startup time. It allows customization of the static analysis setup.

Parameters
access:Feature.DuringSetupAccess

The supported operations that the feature can perform at this time

Since
19.0
getDescriptionback to summary
public default String getDescription()

A short description of the feature (e.g., "Enables Truffle support"). The description is displayed to users as part of the build output.

Since
22.2
getRequiredFeaturesback to summary
public default List<Class<? extends Feature>> getRequiredFeatures()

Returns the list of features that this feature depends on. As long as the dependency chain is non-cyclic, all required features are processed before this feature.

Since
19.0
getURLback to summary
public default String getURL()

A URL to documentation or the sources of the feature. The URL will be used as a link for the feature in the build output (if supported by the user's terminal).

Since
22.2
isInConfigurationback to summary
public default boolean isInConfiguration(Feature.IsInConfigurationAccess access)

This method is called immediately after the constructor, to check whether the feature is part of the configuration or not. If this method returns false, the feature is not included in the list of features and no other methods are called (in particular, the required features are not processed).

Parameters
access:Feature.IsInConfigurationAccess

The supported operations that the feature can perform at this time

Since
19.0
onAnalysisExitback to summary
public default void onAnalysisExit(Feature.OnAnalysisExitAccess access)

Handler for code that needs to run after the analysis, even if an error has occurred, e.g., like reporting code.

Parameters
access:Feature.OnAnalysisExitAccess

The supported operations that the feature can perform at this time

Since
19.0
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.AfterAnalysisAccess

extends QueryReachabilityAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#afterAnalysis.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.QueryReachabilityAccess:
isReachableisReachableisReachablereachableMethodOverridesreachableSubtypes
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.AfterCompilationAccess

extends CompilationAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#afterCompilation.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.CompilationAccess:
objectFieldOffsetregisterAsImmutableregisterAsImmutable
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.AfterHeapLayoutAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#afterHeapLayout.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.AfterImageWriteAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#afterImageWrite.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public Path
getImagePath()

Returns the path to the created native-image file (includes the native-image file name).

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath

Method Detail

getImagePathback to summary
public Path getImagePath()

Returns the path to the created native-image file (includes the native-image file name).

Since
19.0
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.AfterRegistrationAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#afterRegistration.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.BeforeAnalysisAccess

extends FeatureAccess
Known Direct Subinterfaces
org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#beforeAnalysis.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public void
registerAsAccessed(Field field)

Registers the provided field as accesses, i.e., the static analysis assumes the field is used even if there are no explicit reads or writes in the bytecodes.

public void
registerAsInHeap(Class<?> type)

Registers the provided type as instantiated, i.e., the static analysis assumes that instances of this type exist at run time even if there is no explicit instantiation in the bytecodes.

public void
registerAsUnsafeAccessed(Field field)

Registers the provided field as written or read by sun.misc.Unsafe, i.e., the static analysis merges together all values of unsafe accessed fields of a specific type.

public void
registerAsUsed(Class<?> type)

Registers the provided type a used, i.e., metadata for the type is put into the native image.

public void
registerClassInitializerReachabilityHandler(Consumer<Feature.DuringAnalysisAccess> callback, Class<?> clazz)

Registers a callback that is invoked once during analysis when the class initializer for the given type is determined to be reachable at run time.

public void
registerFieldValueTransformer(Field field, FieldValueTransformer transformer)

Registers a field value transformer for the provided field.

public void
registerMethodOverrideReachabilityHandler(BiConsumer<Feature.DuringAnalysisAccess, Executable> callback, Executable baseMethod)

Registers a callback that is invoked once during analysis for each time a method that overrides the specified {param baseMethod} is determined to be reachable at run time.

public void
registerReachabilityHandler(Consumer<Feature.DuringAnalysisAccess> callback, Object... elements)

Registers a callback that is invoked once during analysis when any of the provided elements is determined to be reachable at run time.

public void
registerSubtypeReachabilityHandler(BiConsumer<Feature.DuringAnalysisAccess, Class<?>> callback, Class<?> baseClass)

Registers a callback that is invoked once during analysis for each time a subtype of the class specified by {param baseClass} is determined to be reachable at run time.

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath

Method Detail

registerAsAccessedback to summary
public void registerAsAccessed(Field field)

Registers the provided field as accesses, i.e., the static analysis assumes the field is used even if there are no explicit reads or writes in the bytecodes.

Since
19.0
registerAsInHeapback to summary
public void registerAsInHeap(Class<?> type)

Registers the provided type as instantiated, i.e., the static analysis assumes that instances of this type exist at run time even if there is no explicit instantiation in the bytecodes.

This implies that the type is also marked as used.

Since
19.0
registerAsUnsafeAccessedback to summary
public void registerAsUnsafeAccessed(Field field)

Registers the provided field as written or read by sun.misc.Unsafe, i.e., the static analysis merges together all values of unsafe accessed fields of a specific type.

This implies that the field is also marked as accessed.

Since
19.0
registerAsUsedback to summary
public void registerAsUsed(Class<?> type)

Registers the provided type a used, i.e., metadata for the type is put into the native image.

Since
19.0
registerClassInitializerReachabilityHandlerback to summary
public void registerClassInitializerReachabilityHandler(Consumer<Feature.DuringAnalysisAccess> callback, Class<?> clazz)

Registers a callback that is invoked once during analysis when the class initializer for the given type is determined to be reachable at run time.

Since
21.0
registerFieldValueTransformerback to summary
public void registerFieldValueTransformer(Field field, FieldValueTransformer transformer)

Registers a field value transformer for the provided field. See the JavaDoc of FieldValueTransformer for details.

Since
22.3
registerMethodOverrideReachabilityHandlerback to summary
public void registerMethodOverrideReachabilityHandler(BiConsumer<Feature.DuringAnalysisAccess, Executable> callback, Executable baseMethod)

Registers a callback that is invoked once during analysis for each time a method that overrides the specified {param baseMethod} is determined to be reachable at run time. In addition, the handler will also get invoked once when the {param baseMethod} itself becomes reachable. The specific method that becomes reachable is passed to the handler as the second parameter.

A method is considered reachable at run time if it can be executed, as determined via static analysis.

Therefore, if a method can be statically bound (usually, that means it is final or private or static, but not abstract, or the declaring class is final), or it is a constructors, and it is the target of a reachable invoke, or it is inlined, then it is considered run time reachable.

A virtual methods is considered run time reachable if its declaring-class or any of its subtypes is instantiated and the method is the target of a reachable invoke, or it is inlined. Even if the declaring type itself is not marked as instantiated the method can still be reachable via special invokes, e.g., `super` calls.

Since
19.3
registerReachabilityHandlerback to summary
public void registerReachabilityHandler(Consumer<Feature.DuringAnalysisAccess> callback, Object... elements)

Registers a callback that is invoked once during analysis when any of the provided elements is determined to be reachable at run time. The elements can only be of the following types:

  • Class to specify reachability of the given class
  • Field to specify reachability of a field
  • Executable to specify reachability of a method or constructor

Since
19.2
registerSubtypeReachabilityHandlerback to summary
public void registerSubtypeReachabilityHandler(BiConsumer<Feature.DuringAnalysisAccess, Class<?>> callback, Class<?> baseClass)

Registers a callback that is invoked once during analysis for each time a subtype of the class specified by {param baseClass} is determined to be reachable at run time. In addition the handler will also get invoked once when the {param baseClass} itself becomes reachable. The specific class that becomes reachable is passed to the handler as the second parameter.

Since
19.3
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.BeforeCompilationAccess

extends CompilationAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#beforeCompilation.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.CompilationAccess:
objectFieldOffsetregisterAsImmutableregisterAsImmutable
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.BeforeImageWriteAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#beforeImageWrite.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.BeforeUniverseBuildingAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#beforeUniverseBuilding.
Since
21.1

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.CompilationAccess

extends FeatureAccess
Known Direct Subinterfaces
org.graalvm.nativeimage.hosted.Feature.BeforeCompilationAccess, org.graalvm.nativeimage.hosted.Feature.AfterCompilationAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#beforeCompilation and Feature#afterCompilation.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public long
objectFieldOffset(Field field)

Returns the field offset of the provided instance field.

public void
registerAsImmutable(Object object)

Hint to the native image generator that the given object is immutable at runtime, i.e., can be placed in a read-only section of the native image heap.

public void
registerAsImmutable(Object root, Predicate<Object> includeObject)

Register the object, and everything it transitively references, as immutable.

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath

Method Detail

objectFieldOffsetback to summary
public long objectFieldOffset(Field field)

Returns the field offset of the provided instance field.

Since
19.0
registerAsImmutableback to summary
public void registerAsImmutable(Object object)

Hint to the native image generator that the given object is immutable at runtime, i.e., can be placed in a read-only section of the native image heap.

Since
19.0
registerAsImmutableback to summary
public void registerAsImmutable(Object root, Predicate<Object> includeObject)

Register the object, and everything it transitively references, as immutable. When the provided predicate returns false for an object, the object is not marked as immutable and the transitive iteration is stopped.

Since
19.0
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.DuringAnalysisAccess

extends BeforeAnalysisAccess, QueryReachabilityAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#duringAnalysis.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public void
requireAnalysisIteration()

Notifies the static analysis that changes are made that enforce a new iteration of the analysis.

Inherited from org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess:
registerAsAccessedregisterAsInHeapregisterAsUnsafeAccessedregisterAsUsedregisterClassInitializerReachabilityHandlerregisterFieldValueTransformerregisterMethodOverrideReachabilityHandlerregisterReachabilityHandlerregisterSubtypeReachabilityHandler
Inherited from org.graalvm.nativeimage.hosted.Feature.QueryReachabilityAccess:
isReachableisReachableisReachablereachableMethodOverridesreachableSubtypes

Method Detail

requireAnalysisIterationback to summary
public void requireAnalysisIteration()

Notifies the static analysis that changes are made that enforce a new iteration of the analysis.

Since
19.0
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.DuringSetupAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#duringSetup.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public void
registerObjectReplacer(Function<Object, Object> replacer)

Registers the provided function to replace objects.

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath

Method Detail

registerObjectReplacerback to summary
public void registerObjectReplacer(Function<Object, Object> replacer)

Registers the provided function to replace objects.

The function checks if an object should be replaced. In such a case, the function creates the new object and returns it. The function must return the original object if the object should not be replaced.

Since
19.0
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.FeatureAccess

Known Direct Subinterfaces
org.graalvm.nativeimage.hosted.Feature.IsInConfigurationAccess, org.graalvm.nativeimage.hosted.Feature.AfterRegistrationAccess, org.graalvm.nativeimage.hosted.Feature.DuringSetupAccess, org.graalvm.nativeimage.hosted.Feature.BeforeAnalysisAccess, org.graalvm.nativeimage.hosted.Feature.QueryReachabilityAccess, org.graalvm.nativeimage.hosted.Feature.OnAnalysisExitAccess, org.graalvm.nativeimage.hosted.Feature.BeforeUniverseBuildingAccess, org.graalvm.nativeimage.hosted.Feature.CompilationAccess, org.graalvm.nativeimage.hosted.Feature.AfterHeapLayoutAccess, org.graalvm.nativeimage.hosted.Feature.BeforeImageWriteAccess, org.graalvm.nativeimage.hosted.Feature.AfterImageWriteAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods that are available for all feature methods.
Since
19.0

Method Summary

Modifier and TypeMethod and Description
public Class<?>
findClassByName(String className)

Returns a class if it is present on the classpath.

public ClassLoader
getApplicationClassLoader()

Returns the ClassLoader that can find all classes of the class path and module path.

public List<Path>
getApplicationClassPath()

Returns the class path of the native image that is currently built.

public List<Path>
getApplicationModulePath()

Returns the module path of the native image that is currently built.

Method Detail

findClassByNameback to summary
public Class<?> findClassByName(String className)

Returns a class if it is present on the classpath.

Since
19.0
getApplicationClassLoaderback to summary
public ClassLoader getApplicationClassLoader()

Returns the ClassLoader that can find all classes of the class path and module path.

Since
20.2
getApplicationClassPathback to summary
public List<Path> getApplicationClassPath()

Returns the class path of the native image that is currently built. The returned list does not include the native image generator itself, and does not include the JDK.

Since
20.2
getApplicationModulePathback to summary
public List<Path> getApplicationModulePath()

Returns the module path of the native image that is currently built. The returned list does not include the native image generator itself, and does not include the JDK.

Since
20.2
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.IsInConfigurationAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#isInConfiguration.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.OnAnalysisExitAccess

extends FeatureAccess
Annotations
@Platforms:HOSTED_ONLY

Access methods available for Feature#onAnalysisExit.
Since
19.0

Method Summary

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath
org.graalvm.nativeimage.hosted back to summary

public Interface Feature.QueryReachabilityAccess

extends FeatureAccess
Known Direct Subinterfaces
org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess, org.graalvm.nativeimage.hosted.Feature.AfterAnalysisAccess
Annotations
@Platforms:HOSTED_ONLY

Access reachability methods available for Feature#afterAnalysis and Feature#duringAnalysis.
Since
19.2

Method Summary

Modifier and TypeMethod and Description
public boolean
isReachable(Class<?> clazz)

Returns true if the static analysis determined that the provided class is reachable at run time.

public boolean
isReachable(Field field)

Returns true if the static analysis determined that the provided field is reachable at run time.

public boolean
isReachable(Executable method)

Returns true if the static analysis determined that the provided method is reachable at run time.

public Set<Executable>
reachableMethodOverrides(Executable baseMethod)

Returns all method overrides of the given {param baseMethod} that the static analysis determined to be reachable at run time (including the {param baseMethod} itself).

public Set<Class<?>>
reachableSubtypes(Class<?> baseClass)

Returns all subtypes of the given {param baseClass} that the static analysis determined to be reachable at run time (including the {param baseClass} itself).

Inherited from org.graalvm.nativeimage.hosted.Feature.FeatureAccess:
findClassByNamegetApplicationClassLoadergetApplicationClassPathgetApplicationModulePath

Method Detail

isReachableback to summary
public boolean isReachable(Class<?> clazz)

Returns true if the static analysis determined that the provided class is reachable at run time.

Since
19.2
isReachableback to summary
public boolean isReachable(Field field)

Returns true if the static analysis determined that the provided field is reachable at run time.

Since
19.2
isReachableback to summary
public boolean isReachable(Executable method)

Returns true if the static analysis determined that the provided method is reachable at run time.

Since
19.2
reachableMethodOverridesback to summary
public Set<Executable> reachableMethodOverrides(Executable baseMethod)

Returns all method overrides of the given {param baseMethod} that the static analysis determined to be reachable at run time (including the {param baseMethod} itself).

Since
19.3
reachableSubtypesback to summary
public Set<Class<?>> reachableSubtypes(Class<?> baseClass)

Returns all subtypes of the given {param baseClass} that the static analysis determined to be reachable at run time (including the {param baseClass} itself).

Since
19.3