public class TypeDef extends ModifierSupport implements Renderable, Nameable, Annotatable, Commentable, Mappable<TypeDef>
| Modifier and Type | Field and Description |
|---|---|
static TypeDef |
ENUM |
static ClassRef |
ENUM_REF |
static TypeDef |
OBJECT |
static ClassRef |
OBJECT_REF |
ABSTRACT, FINAL, modifiers, PRIVATE, PROTECTED, PUBLIC, STATIC, SYNCHRONIZEDIN_PACKAGE, IS_UPPER_CASE, OUT_OF_PACKAGE, PACKAGE_SEPARATOR_REGEXAT, CB, CC, CLP, COMA, CP, DOT, DQ, EQ, EXTENDS, GT, IMPLEMENTS, JAVA_LANG, JAVA_LANG_ENUM, JAVA_LANG_OBJECT, JAVA_LANG_STRING, LT, NEWLINE, OB, OC, OP, Q, SEMICOLN, SPACE, STAR, THROWS, VARARGALSO_IMPORT, DEFAULT_VALUE, INIT, INIT_FUNCTION, LAZY_INIT| Modifier | Constructor and Description |
|---|---|
|
TypeDef(Kind kind,
java.lang.String packageName,
java.lang.String name,
java.util.List<java.lang.String> comments,
java.util.List<AnnotationRef> annotations,
java.util.List<ClassRef> extendsList,
java.util.List<ClassRef> implementsList,
java.util.List<TypeParamDef> parameters,
java.util.List<Property> properties,
java.util.List<Method> constructors,
java.util.List<Method> methods,
java.lang.String outerTypeName,
java.util.List<TypeDef> innerTypes,
int modifiers,
java.util.Map<AttributeKey,java.lang.Object> attributes) |
protected |
TypeDef(java.lang.String fullyQualifiedName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
static TypeDef |
forName(java.lang.String fullyQualifiedName) |
java.util.List<AnnotationRef> |
getAnnotations() |
java.util.List<java.lang.String> |
getComments()
Get the list of comments.
|
java.util.List<Method> |
getConstructors() |
java.util.List<ClassRef> |
getExtendsList() |
java.lang.String |
getFullyQualifiedName()
Returns the fully qualified name of the type.
|
java.util.List<ClassRef> |
getImplementsList() |
java.util.Set<java.lang.String> |
getImports() |
java.util.List<TypeDef> |
getInnerTypes() |
Kind |
getKind() |
java.util.List<Method> |
getMethods() |
java.lang.String |
getName()
Get the name.
|
java.lang.String |
getOuterTypeName() |
java.lang.String |
getPackageName()
Get the package name
|
java.util.List<TypeParamDef> |
getParameters() |
java.util.List<Property> |
getProperties() |
java.util.List<ClassRef> |
getReferences() |
int |
hashCode() |
boolean |
isAnnotation() |
boolean |
isClass() |
boolean |
isEnum() |
boolean |
isInterface() |
java.lang.String |
render()
Render the type into a
String for the purpose of code generation. |
java.lang.String |
renderDefinition() |
void |
renderDefinition(java.lang.StringBuilder sb) |
ClassRef |
toInternalReference()
Creates a
ClassRef for internal use inside the scope of the type (methods, properties
etc). |
ClassRef |
toReference(java.util.Collection<TypeRef> arguments)
Creates a
ClassRef for the current definition with the specified arguments. |
ClassRef |
toReference(java.util.List<TypeRef> arguments)
Creates a
ClassRef for the current definition with the specified arguments. |
ClassRef |
toReference(TypeRef... arguments)
Creates a
ClassRef for the current definition with the specified arguments. |
java.lang.String |
toString() |
ClassRef |
toUnboundedReference()
Creates a
ClassRef without bounds. |
getModifiers, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic, isSynchronized, isTransient, renderModifiers, renderModifiersgetAttribute, getAttributes, hasAttributeclone, finalize, getClass, notify, notifyAll, wait, wait, waitrenderafter, getClassName, getPackageName, untilrenderAnnotationsrenderCommentspublic static TypeDef OBJECT
public static TypeDef ENUM
public static ClassRef OBJECT_REF
public static ClassRef ENUM_REF
public TypeDef(Kind kind, java.lang.String packageName, java.lang.String name, java.util.List<java.lang.String> comments, java.util.List<AnnotationRef> annotations, java.util.List<ClassRef> extendsList, java.util.List<ClassRef> implementsList, java.util.List<TypeParamDef> parameters, java.util.List<Property> properties, java.util.List<Method> constructors, java.util.List<Method> methods, java.lang.String outerTypeName, java.util.List<TypeDef> innerTypes, int modifiers, java.util.Map<AttributeKey,java.lang.Object> attributes)
protected TypeDef(java.lang.String fullyQualifiedName)
public static TypeDef forName(java.lang.String fullyQualifiedName)
public java.lang.String getFullyQualifiedName()
getFullyQualifiedName in interface Nameablepublic Kind getKind()
public java.util.List<java.lang.String> getComments()
CommentablegetComments in interface CommentableList of comments.public java.util.List<AnnotationRef> getAnnotations()
getAnnotations in interface Annotatablepublic java.lang.String getPackageName()
NameablegetPackageName in interface Nameablepublic java.lang.String getName()
Nameablepublic java.util.List<ClassRef> getExtendsList()
public java.util.List<ClassRef> getImplementsList()
public java.util.List<TypeParamDef> getParameters()
public java.util.List<Property> getProperties()
public java.util.List<Method> getConstructors()
public java.util.List<Method> getMethods()
public java.lang.String getOuterTypeName()
public java.util.List<TypeDef> getInnerTypes()
public boolean isClass()
public boolean isInterface()
public boolean isEnum()
public boolean isAnnotation()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic ClassRef toReference(TypeRef... arguments)
ClassRef for the current definition with the specified arguments.arguments - The arguments to be passed to the reference.ClassRef for the currnet type, with the specified type argumentspublic ClassRef toReference(java.util.List<TypeRef> arguments)
ClassRef for the current definition with the specified arguments.arguments - The arguments to be passed to the reference.ClassRef for the currnet type, with the specified type argumentspublic ClassRef toReference(java.util.Collection<TypeRef> arguments)
ClassRef for the current definition with the specified arguments.arguments - The arguments to be passed to the reference.ClassRef for the currnet type, with the specified type argumentspublic ClassRef toInternalReference()
ClassRef for internal use inside the scope of the type (methods, properties
etc). It uses as arguments the same 'letters' as the parameters definition.ClassRef for the currnet type, using the type parameter names as as arguments.public ClassRef toUnboundedReference()
ClassRef without bounds.ClassRef for the currnet type, with the specified type argumentspublic java.util.Set<java.lang.String> getImports()
public java.util.List<ClassRef> getReferences()
public java.lang.String renderDefinition()
public void renderDefinition(java.lang.StringBuilder sb)
public java.lang.String render()
RenderableString for the purpose of code generation.
This is slightly different from the `toString()` method as `toString()` is mostly needed for logging / debugging and should
be idempotent.
Regarding idempotency this method may yield different result based on the context it is used even if the internal state of
the object does not change.
An example of such case, is a reference to class that may change based on the package from which it's refenced.render in interface RenderableString representation of the object as it's meant to appear in the generated code.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2022. All Rights Reserved.