public class ParameterizedType extends Excerpt
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.
|
void |
addTo(SourceBuilder source) |
Excerpt |
constructor()
Returns a source excerpt suitable for constructing an instance of this type, including "new"
keyword but excluding brackets.
|
Excerpt |
declaration()
Returns a source excerpt suitable for declaring this type, i.e.
|
Excerpt |
declarationParameters()
Returns a source excerpt of the type parameters of this type, including bounds and angle
brackets.
|
static ParameterizedType |
from(java.lang.Class<?> cls) |
static ParameterizedType |
from(javax.lang.model.type.DeclaredType declaredType) |
static ParameterizedType |
from(javax.lang.model.element.TypeElement typeElement) |
QualifiedName |
getQualifiedName() |
java.lang.String |
getSimpleName() |
boolean |
isParameterized() |
Excerpt |
javadocLink()
Returns a source excerpt of a JavaDoc link to this type.
|
Excerpt |
javadocNoArgMethodLink(java.lang.String memberName)
Returns a source excerpt of a JavaDoc link to a no-args method on this type.
|
java.lang.String |
toString() |
Excerpt |
typeParameters()
Returns a source excerpt of the type parameters of this type, including angle brackets.
|
ParameterizedType |
withParameters(javax.lang.model.type.TypeMirror... parameters)
Returns a new
ParameterizedType of the same length as this type, filled with
parameters. |
ParameterizedType |
withWildcards()
Returns a new
ParameterizedType of the same length as this type, filled with wildcards
("?"). |
public static ParameterizedType from(javax.lang.model.element.TypeElement typeElement)
public static ParameterizedType from(javax.lang.model.type.DeclaredType declaredType)
public static ParameterizedType from(java.lang.Class<?> cls)
public java.lang.String getSimpleName()
public QualifiedName getQualifiedName()
public boolean isParameterized()
public void addTo(SourceBuilder source)
public ParameterizedType withParameters(javax.lang.model.type.TypeMirror... parameters)
ParameterizedType of the same length as this type, filled with
parameters.public ParameterizedType withWildcards()
ParameterizedType of the same length as this type, filled with wildcards
("?").public Excerpt constructor()
In Java 7+, we can use the diamond operator. Otherwise, we write out the type parameters in full.
public Excerpt declaration()
SimpleName<...>public Excerpt typeParameters()
public Excerpt declarationParameters()
public Excerpt javadocLink()
public Excerpt javadocNoArgMethodLink(java.lang.String memberName)
protected void addFields(ValueType.FieldReceiver fields)
ValueType