Package org.springframework.nativex.hint
Annotation Type TypeHint
-
@Repeatable(TypeHints.class) @Retention(RUNTIME) public @interface TypeHint
Configure reflection or*.class
resources access on specified types. Class references via thetypes()
member are the preferred form of use but sometimes due to accessibility restrictions the type names may need to be specified in thetypeNames()
member. Seeaccess()
for inferred type of access and how to customize it withAccessBits
. It can be important to limit it to only what is necessary for an optimal compiled image size.- Author:
- Andy Clement, Sebastien Deleuze
- See Also:
- Manual configuration of reflection use in native images
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description TypeAccess[]
access
Defined the scope of the reflection entries or resource access to be configured.FieldHint[]
fields
Specific fields information, useful to reduce the footprint impact of the generated configuration or to specify unsafe access.MethodHint[]
methods
Specific method information for reflective invocation and metadata query, useful to reduce the footprint impact of the generated configuration.MethodHint[]
queriedMethods
Specific method information for reflective metadata query, useful to reduce the footprint impact of the generated configuration.String[]
typeNames
Alternative way to specify class references, should be used when type visibility prevents usingClass
references, or for nested types which should be specified using a$
separator (for examplecom.example.Foo$Bar
).Class<?>[]
types
Preferred (because typesafe) way to specify class references.
-
-
-
Element Detail
-
types
Class<?>[] types
Preferred (because typesafe) way to specify class references.- Returns:
- the types
- Default:
- {}
-
-
-
access
TypeAccess[] access
Defined the scope of the reflection entries or resource access to be configured. Autodetected when not set, seeTypeAccess.AUTO_DETECT
related documentation.Use empty array ({code {}}) for class access only (to allow for example
Class.forName(String)
) with non-constant argument (with constant argument no need it is inlined at compile time).- Returns:
- the type accesses
- Default:
- {org.springframework.nativex.hint.TypeAccess.AUTO_DETECT}
-
-
-
methods
MethodHint[] methods
Specific method information for reflective invocation and metadata query, useful to reduce the footprint impact of the generated configuration.- Returns:
- the methods information
- Default:
- {}
-
-
-
queriedMethods
MethodHint[] queriedMethods
Specific method information for reflective metadata query, useful to reduce the footprint impact of the generated configuration.- Returns:
- the methods information
- Default:
- {}
-
-
-
fields
FieldHint[] fields
Specific fields information, useful to reduce the footprint impact of the generated configuration or to specify unsafe access.- Returns:
- the fields information
- Default:
- {}
-
-