Interface Feature.DuringAnalysisAccess
- All Superinterfaces:
Feature.BeforeAnalysisAccess, Feature.FeatureAccess, Feature.QueryReachabilityAccess
- Enclosing interface:
Feature
public static interface Feature.DuringAnalysisAccess
extends Feature.BeforeAnalysisAccess, Feature.QueryReachabilityAccess
Access methods available for
Feature.duringAnalysis(Feature.DuringAnalysisAccess)
.- Since:
- 19.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Notifies the static analysis that changes are made that enforce a new iteration of the analysis.Methods inherited from interface Feature.BeforeAnalysisAccess
registerAsAccessed, registerAsInHeap, registerAsUnsafeAccessed, registerAsUnsafeAllocated, registerAsUsed, registerClassInitializerReachabilityHandler, registerFieldValueTransformer, registerMethodOverrideReachabilityHandler, registerReachabilityHandler, registerSubtypeReachabilityHandler
Modifier and TypeMethodDescriptionvoid
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.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.void
registerAsUnsafeAccessed
(Field field) Registers the provided field as written or read byUnsafe
, i.e., the static analysis merges together all values of unsafe accessed fields of a specific type.void
registerAsUnsafeAllocated
(Class<?> type) Registers the provided type as allocatable without running a constructor, via Unsafe.allocateInstance or via the JNI function AllocObject.void
registerAsUsed
(Class<?> type) Registers the provided type a used, i.e., metadata for the type is put into the native image.void
registerClassInitializerReachabilityHandler
(Consumer<Feature.DuringAnalysisAccess> callback, Class<?> clazz) Registers a callback that is invoked onceduring analysis
when the class initializer for the given type is determined to be reachable at run time.void
registerFieldValueTransformer
(Field field, FieldValueTransformer transformer) Registers a field value transformer for the provided field.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.void
registerReachabilityHandler
(Consumer<Feature.DuringAnalysisAccess> callback, Object... elements) Registers a callback that is invoked onceduring analysis
when any of the provided elements is determined to be reachable at run time.void
registerSubtypeReachabilityHandler
(BiConsumer<Feature.DuringAnalysisAccess, Class<?>> callback, Class<?> baseClass) Registers a callback that is invoked onceduring analysis
for each time a subtype of the class specified by {param baseClass} is determined to be reachable at run time.Methods inherited from interface Feature.FeatureAccess
findClassByName, getApplicationClassLoader, getApplicationClassPath, getApplicationModulePath
Modifier and TypeMethodDescriptionClass
<?> findClassByName
(String className) Returns a class if it is present on the classpath.Returns theClassLoader
that can find all classes of the class path and module path.Returns the class path of the native image that is currently built.Returns the module path of the native image that is currently built.Methods inherited from interface Feature.QueryReachabilityAccess
isReachable, isReachable, isReachable, reachableMethodOverrides, reachableSubtypes
Modifier and TypeMethodDescriptionboolean
isReachable
(Class<?> clazz) Returns true if the static analysis determined that the provided class is reachable at run time.boolean
isReachable
(Executable method) Returns true if the static analysis determined that the provided method is reachable at run time.boolean
isReachable
(Field field) Returns true if the static analysis determined that the provided field is reachable at run time.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).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).
-
Method Details
-
requireAnalysisIteration
void requireAnalysisIteration()Notifies the static analysis that changes are made that enforce a new iteration of the analysis.- Since:
- 19.0
-