Package org.springframework.aot.generate
Class MethodNameGenerator
java.lang.Object
org.springframework.aot.generate.MethodNameGenerator
Generates unique method names that can be used in ahead-of-time generated
source code. This class is stateful so one instance should be used per
generated type.
- Since:
- 6.0
- Author:
- Phillip Webb
-
Constructor Summary
ConstructorDescriptionCreate a newMethodNameGenerator
instance without any reserved names.MethodNameGenerator
(Iterable<String> reservedNames) Create a newMethodNameGenerator
instance with the specified reserved names.MethodNameGenerator
(String... reservedNames) Create a newMethodNameGenerator
instance with the specified reserved names. -
Method Summary
-
Constructor Details
-
MethodNameGenerator
public MethodNameGenerator()Create a newMethodNameGenerator
instance without any reserved names. -
MethodNameGenerator
Create a newMethodNameGenerator
instance with the specified reserved names.- Parameters:
reservedNames
- the method names to reserve
-
MethodNameGenerator
Create a newMethodNameGenerator
instance with the specified reserved names.- Parameters:
reservedNames
- the method names to reserve
-
-
Method Details
-
generateMethodName
Generate a new method name from the given parts.- Parameters:
parts
- the parts used to build the name.- Returns:
- the generated method name
-
join
Join the specified parts to create a valid camel case method name.- Parameters:
parts
- the parts to join- Returns:
- a method name from the joined parts.
-