Package org.springframework.aot.hint
Class TypeHint.Builder
java.lang.Object
org.springframework.aot.hint.TypeHint.Builder
- Enclosing class:
- TypeHint
Builder for
TypeHint
.-
Method Summary
Modifier and TypeMethodDescriptiononReachableType
(Class<?> reachableType) Make this hint conditional on the fact that the specified type is in a reachable code path from a static analysis point of view.onReachableType
(TypeReference reachableType) Make this hint conditional on the fact that the specified type is in a reachable code path from a static analysis point of view.withConstructor
(List<TypeReference> parameterTypes, ExecutableMode mode) Register the need for reflection on the constructor with the specified parameter types, using the specifiedExecutableMode
.Register the need for reflection on the field with the specified name.withMembers
(MemberCategory... memberCategories) Adds the specified member categories.withMethod
(String name, List<TypeReference> parameterTypes, ExecutableMode mode) Register the need for reflection on the method with the specified name and parameter types, using the specifiedExecutableMode
.
-
Method Details
-
onReachableType
Make this hint conditional on the fact that the specified type is in a reachable code path from a static analysis point of view.- Parameters:
reachableType
- the type that should be reachable for this hint to apply- Returns:
this
, to facilitate method chaining
-
onReachableType
Make this hint conditional on the fact that the specified type is in a reachable code path from a static analysis point of view.- Parameters:
reachableType
- the type that should be reachable for this hint to apply- Returns:
this
, to facilitate method chaining
-
withField
Register the need for reflection on the field with the specified name.- Parameters:
name
- the name of the field- Returns:
this
, to facilitate method chaining
-
withConstructor
Register the need for reflection on the constructor with the specified parameter types, using the specifiedExecutableMode
.- Parameters:
parameterTypes
- the parameter types of the constructormode
- the requested mode- Returns:
this
, to facilitate method chaining
-
withMethod
public TypeHint.Builder withMethod(String name, List<TypeReference> parameterTypes, ExecutableMode mode) Register the need for reflection on the method with the specified name and parameter types, using the specifiedExecutableMode
.- Parameters:
name
- the name of the methodparameterTypes
- the parameter types of the constructormode
- the requested mode- Returns:
this
, to facilitate method chaining
-
withMembers
Adds the specified member categories.- Parameters:
memberCategories
- the categories to apply- Returns:
this
, to facilitate method chaining- See Also:
-