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()
JType
simpleName
in interface JType
public abstract java.lang.String toString()
toString
in class java.lang.Object
public JExpr _class()
JType
ThisType.class
.public JExpr _this()
JType
ThisType.this
. If the type is an array type, an exception is thrown.public JExpr _super()
JType
ThisType.super
. If the type is an array type, an exception is thrown.public JCall _new()
JType
public JExpr _new(JExpr dim)
JType
public JExpr _new(int dim)
JType
public JArrayExpr _newArray()
JType
public JAnonymousClassDef _newAnon()
JType
public JType typeArg(java.lang.String... args)
JType
public JType typeArg(JType... args)
JType
public JType typeArg(java.lang.Class<?>... args)
JType
public JType[] typeArgs()
JType
public JType elementType()
JType
null
).elementType
in interface JType
null
if it is not an arraypublic JType box()
JType
public JType unbox()
JType
public JType wildcardExtends()
JType
wildcardExtends
in interface JType
public JType wildcardSuper()
JType
wildcardSuper
in interface JType
public JType nestedType(java.lang.String name)
JType
nestedType
in interface JType
name
- the name of the nested typepublic JType $t(java.lang.String name)
JType
public JAssignableExpr field(java.lang.String name)
JType
public JAssignableExpr $v(java.lang.String name)
JType
public JCall call(java.lang.String name)
JType
public JCall call(javax.lang.model.element.ExecutableElement method)
JType
public JExpr methodRef(java.lang.String name)
JType
public JExpr methodRef(javax.lang.model.element.ExecutableElement method)
JType
abstract void writeDirect(SourceFileWriter sourceFileWriter) throws java.io.IOException
java.io.IOException