类 GeneratedClass
java.lang.Object
cn.taketoday.aot.generate.GeneratedClass
A single generated class.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Stephane Nicoll
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private final Map<cn.taketoday.javapoet.ClassName,GeneratedClass> private final GeneratedClassprivate final Map<MethodName,AtomicInteger> private final GeneratedMethodsprivate final cn.taketoday.javapoet.ClassNameprivate final Consumer<cn.taketoday.javapoet.TypeSpec.Builder> -
构造器概要
构造器限定符构造器说明privateGeneratedClass(GeneratedClass enclosingClass, cn.taketoday.javapoet.ClassName name, Consumer<cn.taketoday.javapoet.TypeSpec.Builder> type) (专用程序包)GeneratedClass(cn.taketoday.javapoet.ClassName name, Consumer<cn.taketoday.javapoet.TypeSpec.Builder> type) Create a newGeneratedClassinstance with the given name. -
方法概要
修饰符和类型方法说明private cn.taketoday.javapoet.TypeSpec.Builderapply()(专用程序包) voidassertSameType(Consumer<cn.taketoday.javapoet.TypeSpec.Builder> type) (专用程序包) cn.taketoday.javapoet.JavaFileprivate Stringprivate cn.taketoday.javapoet.TypeSpec.BuildergetBuilder(Consumer<cn.taketoday.javapoet.TypeSpec.Builder> type) Return the enclosingGeneratedClassornullif this instance represents a top-level class.Return generated methods for this instance.cn.taketoday.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.
-
字段详细资料
-
enclosingClass
-
name
private final cn.taketoday.javapoet.ClassName name -
methods
-
type
-
declaredClasses
-
methodNameSequenceGenerator
-
-
构造器详细资料
-
GeneratedClass
GeneratedClass(cn.taketoday.javapoet.ClassName name, Consumer<cn.taketoday.javapoet.TypeSpec.Builder> type) Create a newGeneratedClassinstance with the given name. This constructor is package-private since names should only be generated via aGeneratedClasses.- 参数:
name- the generated nametype- aConsumerused to build the type
-
GeneratedClass
private GeneratedClass(@Nullable GeneratedClass enclosingClass, cn.taketoday.javapoet.ClassName name, Consumer<cn.taketoday.javapoet.TypeSpec.Builder> type)
-
-
方法详细资料
-
reserveMethodNames
Update 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.- 参数:
reservedMethodNames- the reserved method names
-
generateSequencedMethodName
-
getEnclosingClass
Return the enclosingGeneratedClassornullif this instance represents a top-level class.- 返回:
- the enclosing generated class, if any
-
getName
public cn.taketoday.javapoet.ClassName getName()Return the name of the generated class.- 返回:
- the name of the generated class
-
getMethods
Return generated methods for this instance.- 返回:
- the generated methods
-
getOrAdd
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.- 参数:
name- the name of the nested classtype- aConsumerused to build the type- 返回:
- an existing or newly generated class whose enclosing class is this class
-
generateJavaFile
cn.taketoday.javapoet.JavaFile generateJavaFile() -
apply
private cn.taketoday.javapoet.TypeSpec.Builder apply() -
getBuilder
private cn.taketoday.javapoet.TypeSpec.Builder getBuilder(Consumer<cn.taketoday.javapoet.TypeSpec.Builder> type) -
assertSameType
-