Package org.springframework.ai.aot
Class AiRuntimeHints
java.lang.Object
org.springframework.ai.aot.AiRuntimeHints
Utility methods for creating native runtime hints. See other modules for their
respective native runtime hints.
- Author:
- Josh Long, Christian Tzolov, Mark Pollack
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<org.springframework.aot.hint.TypeReference>
findClassesInPackage
(String packageName, org.springframework.core.type.filter.TypeFilter typeFilter) Finds all classes in the specified package that match the given type filter.static Set<org.springframework.aot.hint.TypeReference>
findInnerClassesFor
(Class<?> clazz) Discovers all inner classes of a given class.static Set<org.springframework.aot.hint.TypeReference>
findJsonAnnotatedClassesInPackage
(Class<?> packageClass) Finds classes in a package that are annotated with JsonInclude or have Jackson annotations.static Set<org.springframework.aot.hint.TypeReference>
findJsonAnnotatedClassesInPackage
(String packageName) Finds classes in a package that are annotated with JsonInclude or have Jackson annotations.
-
Constructor Details
-
AiRuntimeHints
public AiRuntimeHints()
-
-
Method Details
-
findJsonAnnotatedClassesInPackage
public static Set<org.springframework.aot.hint.TypeReference> findJsonAnnotatedClassesInPackage(String packageName) Finds classes in a package that are annotated with JsonInclude or have Jackson annotations.- Parameters:
packageName
- The name of the package to search for annotated classes.- Returns:
- A set of TypeReference objects representing the annotated classes found.
-
findJsonAnnotatedClassesInPackage
public static Set<org.springframework.aot.hint.TypeReference> findJsonAnnotatedClassesInPackage(Class<?> packageClass) Finds classes in a package that are annotated with JsonInclude or have Jackson annotations.- Parameters:
packageClass
- The class in the package to search for annotated classes.- Returns:
- A set of TypeReference objects representing the annotated classes found.
-
findClassesInPackage
public static Set<org.springframework.aot.hint.TypeReference> findClassesInPackage(String packageName, org.springframework.core.type.filter.TypeFilter typeFilter) Finds all classes in the specified package that match the given type filter.- Parameters:
packageName
- The name of the package to scan for classes.typeFilter
- The type filter used to filter the scanned classes.- Returns:
- A set of TypeReference objects representing the found classes.
-
findInnerClassesFor
Discovers all inner classes of a given class.This method recursively finds all nested classes (both declared and inherited) of the provided class and converts them to type references.
- Parameters:
clazz
- the class to find inner classes for- Returns:
- a set of type references for all discovered inner classes
-