Package org.springframework.aot.hint
Class ReflectionHints
java.lang.Object
org.springframework.aot.hint.ReflectionHints
Gather the need for reflection at runtime.
- Since:
- 6.0
- Author:
- Stephane Nicoll, Phillip Webb, Andy Wilkinson, Sebastien Deleuze
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetTypeHint(Class<?> type) Return the reflection hints for the specified type.getTypeHint(TypeReference type) Return the reflection hints for the type defined by the specifiedTypeReference.registerConstructor(Constructor<?> constructor, ExecutableMode mode) Register the need for reflection on the specifiedConstructor, using the specifiedExecutableMode.registerField(Field field) Register the need for reflective field access on the specifiedField.registerForInterfaces(Class<?> type, Consumer<TypeHint.Builder> typeHint) Register or customize reflection hints for all the interfaces implemented by the given type and its parent classes, ignoring the common Java language interfaces.registerMethod(Method method, ExecutableMode mode) Register the need for reflection on the specifiedMethod, using the specifiedExecutableMode.registerType(Class<?> type, Consumer<TypeHint.Builder> typeHint) Register or customize reflection hints for the specified type.registerType(Class<?> type, MemberCategory... memberCategories) Register or customize reflection hints for the specified type using the specifiedMemberCategories.registerType(TypeReference type, Consumer<TypeHint.Builder> typeHint) Register or customize reflection hints for the type defined by the specifiedTypeReference.registerType(TypeReference type, MemberCategory... memberCategories) Register or customize reflection hints for the specified type using the specifiedMemberCategories.registerTypeIfPresent(ClassLoader classLoader, String typeName, Consumer<TypeHint.Builder> typeHint) Register or customize reflection hints for the specified type if it is available using the specifiedClassLoader.registerTypeIfPresent(ClassLoader classLoader, String typeName, MemberCategory... memberCategories) Register or customize reflection hints for the specified type if it is available using the specifiedClassLoader.registerTypes(Iterable<TypeReference> types, Consumer<TypeHint.Builder> typeHint) Register or customize reflection hints for the types defined by the specified list oftype references.Return the types that require reflection.
- 
Constructor Details- 
ReflectionHintspublic ReflectionHints()
 
- 
- 
Method Details- 
typeHintsReturn the types that require reflection.- Returns:
- the type hints
 
- 
getTypeHintReturn the reflection hints for the type defined by the specifiedTypeReference.- Parameters:
- type- the type to inspect
- Returns:
- the reflection hints for this type, or null
 
- 
getTypeHintReturn the reflection hints for the specified type.- Parameters:
- type- the type to inspect
- Returns:
- the reflection hints for this type, or null
 
- 
registerTypeRegister or customize reflection hints for the type defined by the specifiedTypeReference.- Parameters:
- type- the type to customize
- typeHint- a builder to further customize hints for that type
- Returns:
- this, to facilitate method chaining
- See Also:
 
- 
registerTypeRegister or customize reflection hints for the specified type using the specifiedMemberCategories.- Parameters:
- type- the type to customize
- memberCategories- the member categories to apply
- Returns:
- this, to facilitate method chaining
 
- 
registerTypeRegister or customize reflection hints for the specified type.- Parameters:
- type- the type to customize
- typeHint- a builder to further customize hints for that type
- Returns:
- this, to facilitate method chaining
- See Also:
 
- 
registerTypeRegister or customize reflection hints for the specified type using the specifiedMemberCategories.- Parameters:
- type- the type to customize
- memberCategories- the member categories to apply
- Returns:
- this, to facilitate method chaining
 
- 
registerTypeIfPresentpublic ReflectionHints registerTypeIfPresent(@Nullable ClassLoader classLoader, String typeName, Consumer<TypeHint.Builder> typeHint) Register or customize reflection hints for the specified type if it is available using the specifiedClassLoader.- Parameters:
- classLoader- the classloader to use to check if the type is present
- typeName- the type to customize
- typeHint- a builder to further customize hints for that type
- Returns:
- this, to facilitate method chaining
- See Also:
 
- 
registerTypeIfPresentpublic ReflectionHints registerTypeIfPresent(@Nullable ClassLoader classLoader, String typeName, MemberCategory... memberCategories) Register or customize reflection hints for the specified type if it is available using the specifiedClassLoader.- Parameters:
- classLoader- the classloader to use to check if the type is present
- typeName- the type to customize
- memberCategories- the member categories to apply
- Returns:
- this, to facilitate method chaining
 
- 
registerTypespublic ReflectionHints registerTypes(Iterable<TypeReference> types, Consumer<TypeHint.Builder> typeHint) Register or customize reflection hints for the types defined by the specified list oftype references. The specifiedtypeHintconsumer is invoked for each type.- Parameters:
- types- the types to customize
- typeHint- a builder to further customize hints for each type
- Returns:
- this, to facilitate method chaining
 
- 
registerForInterfacesRegister or customize reflection hints for all the interfaces implemented by the given type and its parent classes, ignoring the common Java language interfaces. The specifiedtypeHintconsumer is invoked for each type.- Parameters:
- type- the type to consider
- typeHint- a builder to further customize hints for each type
- Returns:
- this, to facilitate method chaining
- Since:
- 6.2
 
- 
registerFieldRegister the need for reflective field access on the specifiedField.- Parameters:
- field- the field that requires reflective access
- Returns:
- this, to facilitate method chaining
 
- 
registerConstructorRegister the need for reflection on the specifiedConstructor, using the specifiedExecutableMode.- Parameters:
- constructor- the constructor that requires reflection
- mode- the requested mode
- Returns:
- this, to facilitate method chaining
 
- 
registerMethodRegister the need for reflection on the specifiedMethod, using the specifiedExecutableMode.- Parameters:
- method- the method that requires reflection
- mode- the requested mode
- Returns:
- this, to facilitate method chaining
 
 
-