Module java4ever.binding
Class TypeSpec.Builder
java.lang.Object
tech.deplant.java4ever.binding.generator.javapoet.TypeSpec.Builder
- Enclosing class:
TypeSpec
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal List<AnnotationSpec>final List<MethodSpec>final List<ParameterSpec>final List<TypeVariableName> -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotation(Class<?> annotation) addAnnotation(AnnotationSpec annotationSpec) addAnnotation(ClassName annotation) addAnnotations(Iterable<AnnotationSpec> annotationSpecs) addEnumConstant(String name) addEnumConstant(String name, TypeSpec typeSpec) addInitializerBlock(CodeBlock block) addJavadoc(String format, Object... args) addJavadoc(CodeBlock block) addMethod(MethodSpec methodSpec) addMethods(Iterable<MethodSpec> methodSpecs) addModifiers(Modifier... modifiers) addOriginatingElement(Element originatingElement) addRecordComponent(Iterable<ParameterSpec> parameterSpecs) addRecordComponent(Type type, String name) addRecordComponent(ParameterSpec parameterSpec) addRecordComponent(TypeName type, String name) addStaticBlock(CodeBlock block) addSuperinterface(Type superinterface) addSuperinterface(Type superinterface, boolean avoidNestedTypeNameClashes) addSuperinterface(TypeMirror superinterface) addSuperinterface(TypeMirror superinterface, boolean avoidNestedTypeNameClashes) addSuperinterface(TypeName superinterface) addSuperinterfaces(Iterable<? extends TypeName> superinterfaces) addTypeVariable(TypeVariableName typeVariable) addTypeVariables(Iterable<TypeVariableName> typeVariables) alwaysQualify(String... simpleNames) avoidClashesWithNestedClasses(Class<?> clazz) Call this to always fully qualify any types that would conflict with possibly nested types of thistypeElement.avoidClashesWithNestedClasses(TypeElement typeElement) Call this to always fully qualify any types that would conflict with possibly nested types of thistypeElement.build()superclass(Type superclass) superclass(Type superclass, boolean avoidNestedTypeNameClashes) superclass(TypeMirror superclass) superclass(TypeMirror superclass, boolean avoidNestedTypeNameClashes) superclass(TypeName superclass)
-
Field Details
-
enumConstants
-
annotations
-
recordComponents
-
modifiers
-
typeVariables
-
superinterfaces
-
fieldSpecs
-
methodSpecs
-
typeSpecs
-
originatingElements
-
alwaysQualifiedNames
-
-
Method Details
-
addJavadoc
-
addJavadoc
-
addAnnotations
-
addAnnotation
-
addAnnotation
-
addAnnotation
-
addModifiers
-
addTypeVariables
-
addTypeVariable
-
superclass
-
superclass
-
superclass
-
superclass
-
superclass
-
addSuperinterfaces
-
addSuperinterface
-
addSuperinterface
-
addSuperinterface
-
addSuperinterface
-
addSuperinterface
public TypeSpec.Builder addSuperinterface(TypeMirror superinterface, boolean avoidNestedTypeNameClashes) -
addEnumConstant
-
addEnumConstant
-
addFields
-
addField
-
addField
-
addField
-
addStaticBlock
-
addInitializerBlock
-
addMethods
-
addMethod
-
addTypes
-
addType
-
addRecordComponent
-
addRecordComponent
-
addRecordComponent
-
addRecordComponent
-
addOriginatingElement
-
alwaysQualify
-
avoidClashesWithNestedClasses
Call this to always fully qualify any types that would conflict with possibly nested types of thistypeElement. For example - if the following type was passed in as the typeElement:class Foo { class NestedTypeA { } class NestedTypeB { } }Then this would add
"NestedTypeA"and"NestedTypeB"as names that should always be qualified viaalwaysQualify(String...). This way they would avoid possible import conflicts when this JavaFile is written.- Parameters:
typeElement- theTypeElementwith nested types to avoid clashes with.- Returns:
- this builder instance.
-
avoidClashesWithNestedClasses
Call this to always fully qualify any types that would conflict with possibly nested types of thistypeElement. For example - if the following type was passed in as the typeElement:class Foo { class NestedTypeA { } class NestedTypeB { } }Then this would add
"NestedTypeA"and"NestedTypeB"as names that should always be qualified viaalwaysQualify(String...). This way they would avoid possible import conflicts when this JavaFile is written.- Parameters:
clazz- theClasswith nested types to avoid clashes with.- Returns:
- this builder instance.
-
build
-