Package com.sun.codemodel
Class JExpr
java.lang.Object
com.sun.codemodel.JExpr
Factory methods that generate various
JExpressions.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JExpressionBoolean constant that representsfalsestatic final JExpressionBoolean constant that representstrue -
Method Summary
Modifier and TypeMethodDescriptionstatic JInvocationstatic JInvocationstatic JExpression_null()static JExpression_super()Returns a reference to "super", an implicit reference to the super class.static JExpression_this()Returns a reference to "this", an implicit reference to the current object.static JExpressionassign(JAssignmentTarget lhs, JExpression rhs) static JExpressionassignPlus(JAssignmentTarget lhs, JExpression rhs) static JCastcast(JType type, JExpression expr) static JArrayCompRefcomponent(JExpression lhs, JExpression index) static JExpressionCreates an expression directly from a source code fragment.static JExpressionstatic JInvocationinvoke(JExpression lhs, JMethod method) static JInvocationinvoke(JExpression lhs, String method) static JInvocationstatic JInvocationstatic JExpressionlit(boolean b) static JExpressionlit(char c) static JExpressionlit(double d) static JExpressionlit(float f) static JExpressionlit(int n) static JExpressionlit(long n) static JExpressionstatic JArraystatic JArrayGeneratesnew T[size].static JArraynewArray(JType type, JExpression size) Generatesnew T[size].static StringEscapes the given string, then surrounds it by the specified quotation mark.static JFieldRefref(JExpression lhs, JVar field) static JFieldRefref(JExpression lhs, String field) static JFieldRefstatic JFieldRef
-
Field Details
-
TRUE
Boolean constant that representstrue -
FALSE
Boolean constant that representsfalse
-
-
Method Details
-
assign
-
assignPlus
-
_new
-
_new
-
invoke
-
invoke
-
invoke
-
invoke
-
ref
-
ref
-
ref
-
refthis
-
dotclass
-
component
-
cast
-
newArray
-
newArray
Generatesnew T[size].- Parameters:
type- The type of the array component. 'T' ornew T[size].
-
newArray
Generatesnew T[size].- Parameters:
type- The type of the array component. 'T' ornew T[size].
-
_this
Returns a reference to "this", an implicit reference to the current object. -
_super
Returns a reference to "super", an implicit reference to the super class. -
_null
-
lit
-
lit
-
lit
-
lit
-
lit
-
quotify
Escapes the given string, then surrounds it by the specified quotation mark. -
lit
-
lit
-
direct
Creates an expression directly from a source code fragment.This method can be used as a short-cut to create a JExpression. For example, instead of
_a.gt(_b), you can write it as:JExpr.direct("a>b").Be warned that there is a danger in using this method, as it obfuscates the object model.
-