public interface JExpr
JExprs class.| Modifier and Type | Field and Description |
|---|---|
static JExpr |
FALSE
The constant expression for
false. |
static JExpr |
NULL
The constant expression for
null. |
static JExpr |
ONE
The constant expression for the integer one.
|
static JExpr |
THIS
The constant expression for
this. |
static JExpr |
TRUE
The constant expression for
true. |
static JExpr |
ZERO
The constant expression for the integer zero.
|
| Modifier and Type | Method and Description |
|---|---|
JExpr |
_instanceof(java.lang.Class<?> type)
Get a type-testing expression using the
instanceof operator. |
JExpr |
_instanceof(JType type)
Get a type-testing expression using the
instanceof operator. |
JExpr |
_instanceof(java.lang.String type)
Get a type-testing expression using the
instanceof operator. |
JCall |
_new(java.lang.Class<?> type)
Get an expression to construct a new inner class instance of this instance expression.
|
JCall |
_new(JType type)
Get an expression to construct a new inner class instance of this instance expression.
|
JCall |
_new(java.lang.String type)
Get an expression to construct a new inner class instance of this instance expression.
|
JAnonymousClassDef |
_newAnon(java.lang.Class<?> type)
Construct a new anonymous subclass of the given type, which must be an inner class of the type of this
expression.
|
JAnonymousClassDef |
_newAnon(JType type)
Construct a new anonymous subclass of the given type, which must be an inner class of the type of this
expression.
|
JAnonymousClassDef |
_newAnon(java.lang.String type)
Construct a new anonymous subclass of the given type, which must be an inner class of the type of this
expression.
|
JAssignableExpr |
$v(java.lang.String name)
Get a field of this object instance (shorthand for
field(String). |
JExpr |
and(JExpr e1)
Combine this expression with another using the binary
&& operator. |
JExpr |
band(JExpr e1)
Combine this expression with another using the binary
& operator. |
JExpr |
bor(JExpr e1)
Combine this expression with another using the binary
| operator. |
JExpr |
bxor(JExpr e1)
Combine this expression with another using the binary
^ operator. |
JCall |
call(java.lang.String name)
Call the given method on this expression.
|
JExpr |
cast(java.lang.Class<?> type)
Get an expression which is a cast of this expression to the given type.
|
JExpr |
cast(JType type)
Get an expression which is a cast of this expression to the given type.
|
JExpr |
cast(java.lang.String type)
Get an expression which is a cast of this expression to the given type.
|
JExpr |
comp()
Invert this expression using the unary
~ operator. |
JExpr |
cond(JExpr ifTrue,
JExpr ifFalse)
Combine this expression with two others using the ternary
? : operator. |
JExpr |
div(JExpr e1)
Combine this expression with another using the binary
/ operator. |
JExpr |
eq(JExpr e1)
Combine this expression with another using the binary
== operator. |
JAssignableExpr |
field(java.lang.String name)
Get a field of this object instance.
|
JExpr |
ge(JExpr e1)
Combine this expression with another using the binary
>= operator. |
JExpr |
gt(JExpr e1)
Combine this expression with another using the binary
> operator. |
JExpr |
idx(int idx)
Get an element of this array expression.
|
JAssignableExpr |
idx(JExpr idx)
Get an element of this array expression.
|
JExpr |
le(JExpr e1)
Combine this expression with another using the binary
<= operator. |
JExpr |
length()
Get the
length expression of this array expression. |
JExpr |
lshr(JExpr e1)
Combine this expression with another using the binary
>>> operator. |
JExpr |
lt(JExpr e1)
Combine this expression with another using the binary
< operator. |
JExpr |
minus(JExpr e1)
Combine this expression with another using the binary
- operator. |
JExpr |
mod(JExpr e1)
Combine this expression with another using the binary
% operator. |
JExpr |
ne(JExpr e1)
Combine this expression with another using the binary
!= operator. |
JExpr |
neg()
Negate this expression using the unary
- operator. |
JExpr |
not()
Invert this expression using the unary
! operator. |
JExpr |
or(JExpr e1)
Combine this expression with another using the binary
|| operator. |
JExpr |
paren()
Explicitly wrap this expression in parentheses.
|
JExpr |
plus(JExpr e1)
Combine this expression with another using the binary
+ operator. |
JExpr |
shl(JExpr e1)
Combine this expression with another using the binary
<< operator. |
JExpr |
shr(JExpr e1)
Combine this expression with another using the binary
>> operator. |
JExpr |
times(JExpr e1)
Combine this expression with another using the binary
* operator. |
static final JExpr FALSE
false.static final JExpr TRUE
true.static final JExpr THIS
this.static final JExpr NULL
null.static final JExpr ZERO
static final JExpr ONE
JExpr plus(JExpr e1)
+ operator.e1 - the other expressionJExpr minus(JExpr e1)
- operator.e1 - the other expressionJExpr times(JExpr e1)
* operator.e1 - the other expressionJExpr div(JExpr e1)
/ operator.e1 - the other expressionJExpr mod(JExpr e1)
% operator.e1 - the other expressionJExpr neg()
- operator.JExpr band(JExpr e1)
& operator.e1 - the other expressionJExpr bor(JExpr e1)
| operator.e1 - the other expressionJExpr bxor(JExpr e1)
^ operator.e1 - the other expressionJExpr shr(JExpr e1)
>> operator.e1 - the other expressionJExpr lshr(JExpr e1)
>>> operator.e1 - the other expressionJExpr shl(JExpr e1)
<< operator.e1 - the other expressionJExpr comp()
~ operator.JExpr and(JExpr e1)
&& operator.e1 - the other expressionJExpr or(JExpr e1)
|| operator.e1 - the other expressionJExpr not()
! operator.JExpr eq(JExpr e1)
== operator.e1 - the other expressionJExpr ne(JExpr e1)
!= operator.e1 - the other expressionJExpr lt(JExpr e1)
< operator.e1 - the other expressionJExpr gt(JExpr e1)
> operator.e1 - the other expressionJExpr le(JExpr e1)
<= operator.e1 - the other expressionJExpr ge(JExpr e1)
>= operator.e1 - the other expressionJExpr cond(JExpr ifTrue, JExpr ifFalse)
? : operator.ifTrue - the true expression branchifFalse - the false expression branchJExpr paren()
JExpr _instanceof(java.lang.String type)
instanceof operator.type - the type to testJExpr _instanceof(JType type)
instanceof operator.type - the type to testJExpr _instanceof(java.lang.Class<?> type)
instanceof operator.type - the type to testJExpr cast(java.lang.String type)
type - the type to cast toJExpr cast(JType type)
type - the type to cast toJExpr cast(java.lang.Class<?> type)
type - the type to cast toJCall call(java.lang.String name)
name - the method nameJCall _new(java.lang.String type)
type - the inner class type to constructnew constructor callJCall _new(JType type)
type - the inner class type to constructnew constructor callJCall _new(java.lang.Class<?> type)
type - the inner class type to constructnew constructor callJAnonymousClassDef _newAnon(java.lang.String type)
type - the type of object to constructJAnonymousClassDef _newAnon(JType type)
type - the type of object to constructJAnonymousClassDef _newAnon(java.lang.Class<?> type)
type - the type of object to constructJAssignableExpr field(java.lang.String name)
name - the field nameJAssignableExpr $v(java.lang.String name)
field(String).name - the field nameJAssignableExpr idx(JExpr idx)
idx - the array index expressionJExpr idx(int idx)
idx - the array indexJExpr length()
length expression of this array expression.length expression