Package org.jboss.jdeparser
Class AbstractJExpr
- java.lang.Object
-
- org.jboss.jdeparser.AbstractJExpr
-
- Direct Known Subclasses:
AbstractJAssignableExpr,AbstractJCall,BinaryJExpr,BooleanJExpr,CastJExpr,CharJExpr,CondJExpr,DecimalDoubleJExpr,DecimalFloatJExpr,HexDoubleJExpr,HexFloatJExpr,InstanceOfJExpr,IntegerJExpr,JLambdaImpl,KeywordJExpr,LongJExpr,MethodRefJExpr,NewDimJArrayExpr,ParenJExpr,PlainJArrayExpr,StringJExpr,UnaryJExpr
abstract class AbstractJExpr extends java.lang.Object implements JExpr, Writable
-
-
Field Summary
Fields Modifier and Type Field Description private CachingLinkedHashMap<java.lang.String,JAssignableExpr>fieldCacheprivate JExprlengthprivate intprec
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractJExpr(int prec)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JExpr_instanceof(java.lang.Class<?> type)Get a type-testing expression using theinstanceofoperator.JExpr_instanceof(java.lang.String type)Get a type-testing expression using theinstanceofoperator.JExpr_instanceof(JType type)Get a type-testing expression using theinstanceofoperator.JCall_new(java.lang.Class<?> 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.JCall_new(JType 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(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.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.JAssignableExpr$v(java.lang.String name)Get a field of this object instance (shorthand forJExpr.field(String).JExprand(JExpr e1)Combine this expression with another using the binary&&operator.JExprband(JExpr e1)Combine this expression with another using the binary&operator.JExprbor(JExpr e1)Combine this expression with another using the binary|operator.JExprbxor(JExpr e1)Combine this expression with another using the binary^operator.JCallcall(java.lang.String name)Call the given method on this expression.JExprcast(java.lang.Class<?> type)Get an expression which is a cast of this expression to the given type.JExprcast(java.lang.String type)Get an expression which is a cast of this expression to the given type.JExprcast(JType type)Get an expression which is a cast of this expression to the given type.JExprcomp()Invert this expression using the unary~operator.JExprcond(JExpr ifTrue, JExpr ifFalse)Combine this expression with two others using the ternary? :operator.JExprdiv(JExpr e1)Combine this expression with another using the binary/operator.JExpreq(JExpr e1)Combine this expression with another using the binary==operator.JAssignableExprfield(java.lang.String name)Get a field of this object instance.JExprge(JExpr e1)Combine this expression with another using the binary>=operator.JExprgt(JExpr e1)Combine this expression with another using the binary>operator.JExpridx(int idx)Get an element of this array expression.JAssignableExpridx(JExpr idx)Get an element of this array expression.JExprle(JExpr e1)Combine this expression with another using the binary<=operator.JExprlength()Get thelengthexpression of this array expression.JExprlshr(JExpr e1)Combine this expression with another using the binary>>>operator.JExprlt(JExpr e1)Combine this expression with another using the binary<operator.JExprminus(JExpr e1)Combine this expression with another using the binary-operator.JExprmod(JExpr e1)Combine this expression with another using the binary%operator.JExprne(JExpr e1)Combine this expression with another using the binary!=operator.JExprneg()Negate this expression using the unary-operator.JExprnot()Invert this expression using the unary!operator.(package private) static AbstractJExprof(JExpr expr)JExpror(JExpr e1)Combine this expression with another using the binary||operator.JExprparen()Explicitly wrap this expression in parentheses.JExprplus(JExpr e1)Combine this expression with another using the binary+operator.intprec()JExprshl(JExpr e1)Combine this expression with another using the binary<<operator.JExprshr(JExpr e1)Combine this expression with another using the binary>>operator.JExprtimes(JExpr e1)Combine this expression with another using the binary*operator.
-
-
-
Field Detail
-
prec
private final int prec
-
fieldCache
private CachingLinkedHashMap<java.lang.String,JAssignableExpr> fieldCache
-
length
private JExpr length
-
-
Method Detail
-
of
static AbstractJExpr of(JExpr expr)
-
plus
public JExpr plus(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary+operator.
-
minus
public JExpr minus(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary-operator.
-
times
public JExpr times(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary*operator.
-
div
public JExpr div(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary/operator.
-
mod
public JExpr mod(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary%operator.
-
neg
public JExpr neg()
Description copied from interface:JExprNegate this expression using the unary-operator.
-
band
public JExpr band(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary&operator.
-
bor
public JExpr bor(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary|operator.
-
bxor
public JExpr bxor(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary^operator.
-
shr
public JExpr shr(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary>>operator.
-
lshr
public JExpr lshr(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary>>>operator.
-
shl
public JExpr shl(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary<<operator.
-
comp
public JExpr comp()
Description copied from interface:JExprInvert this expression using the unary~operator.
-
and
public JExpr and(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary&&operator.
-
or
public JExpr or(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary||operator.
-
not
public JExpr not()
Description copied from interface:JExprInvert this expression using the unary!operator.
-
eq
public JExpr eq(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary==operator.
-
ne
public JExpr ne(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary!=operator.
-
lt
public JExpr lt(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary<operator.
-
gt
public JExpr gt(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary>operator.
-
le
public JExpr le(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary<=operator.
-
ge
public JExpr ge(JExpr e1)
Description copied from interface:JExprCombine this expression with another using the binary>=operator.
-
cond
public JExpr cond(JExpr ifTrue, JExpr ifFalse)
Description copied from interface:JExprCombine this expression with two others using the ternary? :operator.
-
paren
public JExpr paren()
Description copied from interface:JExprExplicitly wrap this expression in parentheses.
-
_instanceof
public JExpr _instanceof(java.lang.String type)
Description copied from interface:JExprGet a type-testing expression using theinstanceofoperator.- Specified by:
_instanceofin interfaceJExpr- Parameters:
type- the type to test- Returns:
- the expression
-
_instanceof
public JExpr _instanceof(JType type)
Description copied from interface:JExprGet a type-testing expression using theinstanceofoperator.- Specified by:
_instanceofin interfaceJExpr- Parameters:
type- the type to test- Returns:
- the expression
-
_instanceof
public JExpr _instanceof(java.lang.Class<?> type)
Description copied from interface:JExprGet a type-testing expression using theinstanceofoperator.- Specified by:
_instanceofin interfaceJExpr- Parameters:
type- the type to test- Returns:
- the expression
-
cast
public JExpr cast(java.lang.String type)
Description copied from interface:JExprGet an expression which is a cast of this expression to the given type.
-
cast
public JExpr cast(JType type)
Description copied from interface:JExprGet an expression which is a cast of this expression to the given type.
-
cast
public JExpr cast(java.lang.Class<?> type)
Description copied from interface:JExprGet an expression which is a cast of this expression to the given type.
-
call
public JCall call(java.lang.String name)
Description copied from interface:JExprCall the given method on this expression.
-
_new
public JCall _new(java.lang.String type)
Description copied from interface:JExprGet an expression to construct a new inner class instance of this instance expression.
-
_new
public JCall _new(JType type)
Description copied from interface:JExprGet an expression to construct a new inner class instance of this instance expression.
-
_new
public JCall _new(java.lang.Class<?> type)
Description copied from interface:JExprGet an expression to construct a new inner class instance of this instance expression.
-
_newAnon
public JAnonymousClassDef _newAnon(java.lang.String type)
Description copied from interface:JExprConstruct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
-
_newAnon
public JAnonymousClassDef _newAnon(JType type)
Description copied from interface:JExprConstruct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
-
_newAnon
public JAnonymousClassDef _newAnon(java.lang.Class<?> type)
Description copied from interface:JExprConstruct a new anonymous subclass of the given type, which must be an inner class of the type of this expression.
-
field
public JAssignableExpr field(java.lang.String name)
Description copied from interface:JExprGet a field of this object instance.
-
$v
public JAssignableExpr $v(java.lang.String name)
Description copied from interface:JExprGet a field of this object instance (shorthand forJExpr.field(String).
-
idx
public JAssignableExpr idx(JExpr idx)
Description copied from interface:JExprGet an element of this array expression.
-
idx
public JExpr idx(int idx)
Description copied from interface:JExprGet an element of this array expression.
-
length
public JExpr length()
Description copied from interface:JExprGet thelengthexpression of this array expression.
-
prec
public int prec()
-
-