public interface JExpression extends JGenerable
Unlike most of CodeModel, JExpressions are built bottom-up ( meaning you start from leaves and then gradually build compliated expressions by combining them.)
JExpression
defines a series of composer methods,
which returns a complicated expression (by often taking other JExpression
s
as parameters.
For example, you can build "5+2" by
JExpr.lit(5).add(JExpr.lit(2))
Modifier and Type | Method and Description |
---|---|
JExpression |
_instanceof(JType right)
Returns "[this] instanceof [right]"
|
JExpression |
band(JExpression right)
Bit-wise AND '&'.
|
JExpression |
bor(JExpression right)
Bit-wise OR '|'.
|
JExpression |
cand(JExpression right)
Logical AND '&&'.
|
JExpression |
complement()
Returns "~[this]" from "[this]".
|
com.sun.codemodel.JArrayCompRef |
component(JExpression index) |
JExpression |
cor(JExpression right)
Logical OR '||'.
|
JExpression |
decr()
Returns "[this]--" from "[this]".
|
JExpression |
div(JExpression right)
Returns "[this]/[right]"
|
JExpression |
eq(JExpression right) |
JExpression |
gt(JExpression right) |
JExpression |
gte(JExpression right) |
JExpression |
incr()
Returns "[this]++" from "[this]".
|
JInvocation |
invoke(JMethod method)
Returns "[this].[method]".
|
JInvocation |
invoke(String method)
Returns "[this].[method]".
|
JExpression |
lt(JExpression right) |
JExpression |
lte(JExpression right) |
JExpression |
minus()
Returns "-[this]" from "[this]".
|
JExpression |
minus(JExpression right)
Returns "[this]-[right]"
|
JExpression |
mod(JExpression right)
Returns "[this]%[right]"
|
JExpression |
mul(JExpression right)
Returns "[this]*[right]"
|
JExpression |
ne(JExpression right) |
JExpression |
not()
Returns "![this]" from "[this]".
|
JExpression |
plus(JExpression right)
Returns "[this]+[right]"
|
JFieldRef |
ref(JVar field) |
JFieldRef |
ref(String field) |
JExpression |
shl(JExpression right)
Returns "[this]<<[right]"
|
JExpression |
shr(JExpression right)
Returns "[this]>>[right]"
|
JExpression |
shrz(JExpression right)
Returns "[this]>>>[right]"
|
JExpression |
xor(JExpression right) |
generate
JExpression minus()
JExpression not()
JExpression complement()
JExpression incr()
JExpression decr()
JExpression plus(JExpression right)
JExpression minus(JExpression right)
JExpression mul(JExpression right)
JExpression div(JExpression right)
JExpression mod(JExpression right)
JExpression shl(JExpression right)
JExpression shr(JExpression right)
JExpression shrz(JExpression right)
JExpression band(JExpression right)
JExpression bor(JExpression right)
JExpression cand(JExpression right)
JExpression cor(JExpression right)
JExpression xor(JExpression right)
JExpression lt(JExpression right)
JExpression lte(JExpression right)
JExpression gt(JExpression right)
JExpression gte(JExpression right)
JExpression eq(JExpression right)
JExpression ne(JExpression right)
JExpression _instanceof(JType right)
JInvocation invoke(JMethod method)
JInvocation
object.JInvocation invoke(String method)
JInvocation
object.com.sun.codemodel.JArrayCompRef component(JExpression index)
Copyright © 2017 JBoss by Red Hat. All rights reserved.