Package org.springframework.aot.generate
Class GeneratedClass
java.lang.Object
org.springframework.aot.generate.GeneratedClass
A single generated class.
- Since:
- 6.0
- Author:
- Phillip Webb, Stephane Nicoll
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionReturn the enclosingGeneratedClassornullif this instance represents a top-level class.Return generated methods for this instance.org.springframework.javapoet.ClassNamegetName()Return the name of the generated class.Get or add a nested generated class with the specified name.voidreserveMethodNames(String... reservedMethodNames) Update this instance with a set of reserved method names that should not be used for generated methods.
- 
Method Details- 
reserveMethodNamesUpdate this instance with a set of reserved method names that should not be used for generated methods. Reserved names are often needed when a generated class implements a specific interface.- Parameters:
- reservedMethodNames- the reserved method names
 
- 
getEnclosingClassReturn the enclosingGeneratedClassornullif this instance represents a top-level class.- Returns:
- the enclosing generated class, if any
 
- 
getNamepublic org.springframework.javapoet.ClassName getName()Return the name of the generated class.- Returns:
- the name of the generated class
 
- 
getMethodsReturn generated methods for this instance.- Returns:
- the generated methods
 
- 
getOrAddpublic GeneratedClass getOrAdd(String name, Consumer<org.springframework.javapoet.TypeSpec.Builder> type) Get or add a nested generated class with the specified name. If this method has previously been called with the givenname, the existing class will be returned, otherwise a new class will be generated.- Parameters:
- name- the name of the nested class
- type- a- Consumerused to build the type
- Returns:
- an existing or newly generated class whose enclosing class is this class
 
 
-