public class TypeClass extends Type
When used as an excerpt or Type, it acts as a prototypical type of the class.
This is the element's invocation on the type variables corresponding to its own formal type
parameters. For example, the TypeClass of EnumSet would appear in code as
EnumSet<E>. This is probably the most common use of a type class in code generation.
The declaration() and declarationParameters() methods, on the other hand,
return excerpts reflecting the type element. For example, the declaration of EnumSet
would be EnumSet<E extends Enum<E>>.
A hybrid of a TypeElement and its prototypical DeclaredType.
Element.asType()ValueType.FieldReceiver| Modifier and Type | Method and Description |
|---|---|
protected void |
addFields(ValueType.FieldReceiver fields)
Implement this method to report the name and value of each field.
|
Excerpt |
declaration()
Returns a source excerpt suitable for declaring this type element.
|
Excerpt |
declarationParameters()
Returns a source excerpt of the type parameters of this type element, including bounds and
angle brackets.
|
static TypeClass |
from(javax.lang.model.element.TypeElement typeElement) |
QualifiedName |
getQualifiedName()
Returns the qualified name of the type class.
|
protected java.util.List<javax.lang.model.element.TypeParameterElement> |
getTypeParameters() |
java.lang.String |
toString() |
addTo, constructor, diamondOperator, from, from, getSimpleName, isParameterized, javadocLink, javadocNoArgMethodLink, typeParameters, withWildcardspublic static TypeClass from(javax.lang.model.element.TypeElement typeElement)
public QualifiedName getQualifiedName()
TypegetQualifiedName in class Typepublic Excerpt declaration()
e.g. MyType<N extends Number, C extends Consumer<N>>
public Excerpt declarationParameters()
e.g. <N extends Number, C extends Consumer<N>>
protected java.util.List<javax.lang.model.element.TypeParameterElement> getTypeParameters()
getTypeParameters in class Typeprotected void addFields(ValueType.FieldReceiver fields)
ValueType