Package org.springframework.aot.generate
Class ClassNameGenerator
java.lang.Object
org.springframework.aot.generate.ClassNameGenerator
Generates unique class names that can be used in ahead-of-time generated
source code. This class is stateful so the same instance should be used for
all name generation. Most commonly the class name generator is obtained via a
GenerationContext
.- Since:
- 6.0
- Author:
- Phillip Webb
- See Also:
-
GeneratedClassName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.javapoet.ClassName
generateClassName
(Class<?> target, String featureName) Generate a new class name for the giventarget
/featureName
combination.org.springframework.javapoet.ClassName
generateClassName
(String target, String featureName) Generate a new class name for the givenname
/featureName
combination.
-
Constructor Details
-
ClassNameGenerator
public ClassNameGenerator()
-
-
Method Details
-
generateClassName
public org.springframework.javapoet.ClassName generateClassName(Class<?> target, String featureName) Generate a new class name for the giventarget
/featureName
combination.- Parameters:
target
- the target of the newly generated classfeatureName
- the name of the feature that the generated class supports- Returns:
- a unique generated class name
-
generateClassName
Generate a new class name for the givenname
/featureName
combination.- Parameters:
target
- the target of the newly generated class. When possible, this should be a class namefeatureName
- the name of the feature that the generated class supports- Returns:
- a unique generated class name
-