ValueType.FieldReceiver| Constructor and Description |
|---|
Type() |
| Modifier and Type | Method and Description |
|---|---|
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 |
diamondOperator()
Returns a source excerpt equivalent to the diamond operator for this type.
|
static Type |
from(java.lang.Class<?> cls) |
static Type |
from(javax.lang.model.type.DeclaredType declaredType) |
abstract QualifiedName |
getQualifiedName()
Returns the qualified name of the type class.
|
java.lang.String |
getSimpleName()
Returns the simple name of the type class.
|
protected abstract java.util.List<?> |
getTypeParameters() |
boolean |
isParameterized()
Returns true if the type class is generic.
|
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.
|
Excerpt |
typeParameters()
Returns a source excerpt of the type parameters of this type, including angle brackets.
|
Type |
withWildcards()
Returns a new type of the same class, parameterized with wildcards ("?").
|
public static Type from(javax.lang.model.type.DeclaredType declaredType)
public static Type from(java.lang.Class<?> cls)
public abstract QualifiedName getQualifiedName()
protected abstract java.util.List<?> getTypeParameters()
public java.lang.String getSimpleName()
public boolean isParameterized()
public Excerpt constructor()
At SourceLevel.JAVA_7 and above, we can use the diamond operator. Otherwise, we
write out the type parameters in full.
public Excerpt javadocLink()
public Excerpt javadocNoArgMethodLink(java.lang.String memberName)
public Excerpt typeParameters()
e.g. <N, C>
public Excerpt diamondOperator()
Always an empty string if the type class is not generic. Matches typeParameters()
for SourceLevel.JAVA_6.
public Type withWildcards()
If the type class is not generic, the returned object will be equal to this one.
public void addTo(SourceBuilder source)