abstract class AbstractJType extends java.lang.Object implements JType
| Modifier and Type | Field and Description |
|---|---|
private ArrayJType |
array |
private CachingLinkedHashMap<java.lang.String,JAssignableExpr> |
staticRefs |
private WildcardJType |
wildcardExtends |
private WildcardJType |
wildcardSuper |
| Constructor and Description |
|---|
AbstractJType() |
| Modifier and Type | Method and Description |
|---|---|
JExpr |
_class()
An expression of the form
ThisType.class. |
JCall |
_new()
Construct a new instance of this non-array type.
|
JExpr |
_new(int dim)
Construct a new instance of this array type.
|
JExpr |
_new(JExpr dim)
Construct a new instance of this array type.
|
JAnonymousClassDef |
_newAnon()
Construct a new anonymous subclass of this type.
|
JArrayExpr |
_newArray()
Create a new array of this type which is inline-initialized.
|
JExpr |
_super()
An expression of the form
ThisType.super. |
JExpr |
_this()
An expression of the form
ThisType.this. |
JType |
$t(java.lang.String name)
Get a nested type within this reference type.
|
JAssignableExpr |
$v(java.lang.String name)
Look up a static field on this type.
|
JType |
array()
An array of this type.
|
JType |
box()
The primitive-boxed version of this type.
|
JCall |
call(javax.lang.model.element.ExecutableElement method)
Call a static method on this type.
|
JCall |
call(java.lang.String name)
Call a static method on this type.
|
JType |
elementType()
The element type, if this an array (otherwise
null). |
JType |
erasure()
The erasure of this type.
|
JAssignableExpr |
field(java.lang.String name)
Look up a static field on this type.
|
JExpr |
methodRef(javax.lang.model.element.ExecutableElement method)
Get a method reference of this type.
|
JExpr |
methodRef(java.lang.String name)
Get a method reference of this type.
|
JType |
nestedType(java.lang.String name)
Get a nested type within this reference type.
|
(package private) static AbstractJType |
of(JType type) |
(package private) java.lang.String |
qualifiedName(SourceFileWriter writer) |
abstract java.lang.String |
simpleName()
Get the simple name of this type.
|
abstract java.lang.String |
toString() |
JType |
typeArg(java.lang.Class<?>... args)
This type, with the given generic type arguments.
|
JType |
typeArg(JType... args)
This type, with the given generic type arguments.
|
JType |
typeArg(java.lang.String... args)
This type, with the given generic type arguments.
|
JType[] |
typeArgs()
Get the type arguments of this type.
|
JType |
unbox()
The primitive-unboxed version of this type.
|
JType |
wildcardExtends()
Get a wildcard that extends this type.
|
JType |
wildcardSuper()
Get a wildcard that this type extends.
|
(package private) abstract void |
writeDirect(SourceFileWriter sourceFileWriter) |
private ArrayJType array
private WildcardJType wildcardExtends
private WildcardJType wildcardSuper
private CachingLinkedHashMap<java.lang.String,JAssignableExpr> staticRefs
static AbstractJType of(JType type)
java.lang.String qualifiedName(SourceFileWriter writer)
public abstract java.lang.String simpleName()
JTypesimpleName in interface JTypepublic abstract java.lang.String toString()
toString in class java.lang.Objectpublic JExpr _class()
JTypeThisType.class.public JExpr _this()
JTypeThisType.this. If the type is an array type, an exception is thrown.public JExpr _super()
JTypeThisType.super. If the type is an array type, an exception is thrown.public JCall _new()
JTypepublic JExpr _new(JExpr dim)
JTypepublic JExpr _new(int dim)
JTypepublic JArrayExpr _newArray()
JTypepublic JAnonymousClassDef _newAnon()
JTypepublic JType typeArg(java.lang.String... args)
JTypepublic JType typeArg(JType... args)
JTypepublic JType typeArg(java.lang.Class<?>... args)
JTypepublic JType[] typeArgs()
JTypepublic JType elementType()
JTypenull).elementType in interface JTypenull if it is not an arraypublic JType box()
JTypepublic JType unbox()
JTypepublic JType wildcardExtends()
JTypewildcardExtends in interface JTypepublic JType wildcardSuper()
JTypewildcardSuper in interface JTypepublic JType nestedType(java.lang.String name)
JTypenestedType in interface JTypename - the name of the nested typepublic JType $t(java.lang.String name)
JTypepublic JAssignableExpr field(java.lang.String name)
JTypepublic JAssignableExpr $v(java.lang.String name)
JTypepublic JCall call(java.lang.String name)
JTypepublic JCall call(javax.lang.model.element.ExecutableElement method)
JTypepublic JExpr methodRef(java.lang.String name)
JTypepublic JExpr methodRef(javax.lang.model.element.ExecutableElement method)
JTypeabstract void writeDirect(SourceFileWriter sourceFileWriter) throws java.io.IOException
java.io.IOException