public interface JType
JTypes
.Modifier and Type | Field and Description |
---|---|
static JType |
BOOLEAN
The
boolean primitive type. |
static JType |
BYTE
The
byte primitive type. |
static JType |
CHAR
The
char primitive type. |
static JType |
DOUBLE
The
double primitive type. |
static JType |
FLOAT
The
float primitive type. |
static JType |
INT
The
int primitive type. |
static JType |
LONG
The
long primitive type. |
static JType[] |
NONE
An empty array of types.
|
static JType |
OBJECT
The type of
java.lang.Object . |
static JType |
SHORT
The
short primitive type. |
static JType |
THIS
A special type that always renders to the type of the class it is encountered in.
|
static JType |
VOID
The
void type. |
static JType |
WILDCARD
The wildcard type of
<? extends Object> , also known as <?> . |
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(String name)
Get a nested type within this reference type.
|
JAssignableExpr |
$v(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(ExecutableElement method)
Call a static method on this type.
|
JCall |
call(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(String name)
Look up a static field on this type.
|
JExpr |
methodRef(ExecutableElement method)
Get a method reference of this type.
|
JExpr |
methodRef(String name)
Get a method reference of this type.
|
JType |
nestedType(String name)
Get a nested type within this reference type.
|
String |
simpleName()
Get the simple name of this type.
|
JType |
typeArg(Class<?>... args)
This type, with the given generic type arguments.
|
JType |
typeArg(JType... args)
This type, with the given generic type arguments.
|
JType |
typeArg(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.
|
static final JType[] NONE
static final JType THIS
static final JType VOID
void
type.static final JType BOOLEAN
boolean
primitive type.static final JType FLOAT
float
primitive type.static final JType DOUBLE
double
primitive type.static final JType CHAR
char
primitive type.static final JType BYTE
byte
primitive type.static final JType SHORT
short
primitive type.static final JType INT
int
primitive type.static final JType LONG
long
primitive type.static final JType OBJECT
java.lang.Object
.static final JType WILDCARD
<? extends Object>
, also known as <?>
.String simpleName()
JExpr _class()
ThisType.class
.JExpr _this()
ThisType.this
. If the type is an array type, an exception is thrown.JExpr _super()
ThisType.super
. If the type is an array type, an exception is thrown.JType array()
JCall _new()
JExpr _new(JExpr dim)
dim
- the array sizeJExpr _new(int dim)
dim
- the array sizeJArrayExpr _newArray()
JAnonymousClassDef _newAnon()
JType typeArg(String... args)
args
- the type argumentsJType typeArg(JType... args)
args
- the type argumentsJType typeArg(Class<?>... args)
args
- the type argumentsJType[] typeArgs()
JType box()
JType unbox()
JType erasure()
JType elementType()
null
).null
if it is not an arrayJType wildcardExtends()
JType wildcardSuper()
JType nestedType(String name)
name
- the name of the nested typeJType $t(String name)
name
- the name of the nested typeJAssignableExpr field(String name)
name
- the field nameJAssignableExpr $v(String name)
name
- the field nameJCall call(String name)
name
- the method to callJCall call(ExecutableElement method)
method
- the method to callJExpr methodRef(String name)
name
- the method nameJExpr methodRef(ExecutableElement method)
method
- the method elementCopyright © 2016. All rights reserved.