Package org.jboss.jdeparser
Class JExprs
java.lang.Object
org.jboss.jdeparser.JExprs
The factory for generating simple expressions.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final ThreadLocal<LinkedHashMap<String,
JAssignableExpr>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JAssignableExpr
Return a name expression.static JAssignableExpr
$v
(JParamDeclaration paramDeclaration) Return a name expression from an annotation processor parameter declaration.static JAssignableExpr
$v
(JVarDeclaration varDeclaration) Return a name expression from an annotation processor variable declaration.static JArrayExpr
array()
Return a new array expression.static JArrayExpr
array
(int... members) Return a new array expression.static JArrayExpr
array
(long... members) Return a new array expression.static JArrayExpr
Return a new array expression.static JArrayExpr
Return a new array expression.static JExpr
binary
(int val) Generate anint
value in binary base.static JExpr
binary
(long val) Generate along
value in binary base.static JCall
Generate a method call expression to the given method name.static JCall
call
(ExecutableElement element) Generate a method call expression to the given element.static JCall
callStatic
(Class<?> type, String name) Generate a method call expression to a method on the given static type.static JCall
callStatic
(String type, String name) Generate a method call expression to a method on the given static type.static JCall
callStatic
(JType type, String name) Generate a method call expression to a method on the given static type.static JExpr
ch
(int val) Generate achar
value constant.static JExpr
decimal
(double val) Generate adouble
value in decimal base.static JExpr
decimal
(float val) Generate afloat
value in decimal base.static JExpr
decimal
(int val) Generate anint
value in decimal base.static JExpr
decimal
(long val) Generate along
value in decimal base.static JExpr
hex
(double val) Generate adouble
value in hexadecimal base.static JExpr
hex
(float val) Generate afloat
value in hexadecimal base.static JExpr
hex
(int val) Generate anint
value in hexadecimal base.static JExpr
hex
(long val) Generate along
value in hexadecimal base.static JLambda
lambda()
Return a lambda expression.static JAssignableExpr
Return a name expression.static JAssignableExpr
name
(JParamDeclaration paramDeclaration) Return a name expression from an annotation processor parameter declaration.static JAssignableExpr
name
(JVarDeclaration varDeclaration) Return a name expression from an annotation processor variable declaration.static JExpr
Generate a string constant value.
-
Field Details
-
cache
-
-
Constructor Details
-
JExprs
private JExprs()
-
-
Method Details
-
decimal
Generate anint
value in decimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
decimal
Generate along
value in decimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
decimal
Generate afloat
value in decimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
decimal
Generate adouble
value in decimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
hex
Generate anint
value in hexadecimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
hex
Generate along
value in hexadecimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
hex
Generate afloat
value in hexadecimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
hex
Generate adouble
value in hexadecimal base.- Parameters:
val
- the value- Returns:
- the value expression
-
binary
Generate anint
value in binary base.- Parameters:
val
- the value- Returns:
- the value expression
-
binary
Generate along
value in binary base.- Parameters:
val
- the value- Returns:
- the value expression
-
str
Generate a string constant value.- Parameters:
string
- the string- Returns:
- the string expression
-
ch
Generate achar
value constant.- Parameters:
val
- the value- Returns:
- the value expression
-
call
Generate a method call expression to the given element.- Parameters:
element
- the method to call- Returns:
- the method call
-
call
Generate a method call expression to the given method name.- Parameters:
name
- the name of the method to call- Returns:
- the method call
-
callStatic
Generate a method call expression to a method on the given static type.- Parameters:
type
- the type to call againstname
- the name of the method to call- Returns:
- the method call
-
callStatic
Generate a method call expression to a method on the given static type.- Parameters:
type
- the type to call againstname
- the name of the method to call- Returns:
- the method call
-
callStatic
Generate a method call expression to a method on the given static type.- Parameters:
type
- the type to call againstname
- the name of the method to call- Returns:
- the method call
-
$v
Return a name expression. This method is a shortcut forname(String)
.- Parameters:
name
- the name- Returns:
- the expression
-
$v
Return a name expression from an annotation processor parameter declaration.- Parameters:
paramDeclaration
- the method parameter- Returns:
- the expression
-
$v
Return a name expression from an annotation processor variable declaration.- Parameters:
varDeclaration
- the variable declaration- Returns:
- the expression
-
name
Return a name expression.- Parameters:
name
- the name- Returns:
- the expression
-
name
Return a name expression from an annotation processor parameter declaration.- Parameters:
paramDeclaration
- the method parameter- Returns:
- the expression
-
name
Return a name expression from an annotation processor variable declaration.- Parameters:
varDeclaration
- the variable declaration- Returns:
- the expression
-
array
Return a new array expression. The array is initially empty.- Returns:
- an array expression
-
array
Return a new array expression. The array is initially filled with the given members.- Parameters:
members
- the initial members of the array- Returns:
- an array expression
-
array
Return a new array expression. The array is initially filled with the given strings.- Parameters:
members
- the initial members of the array- Returns:
- an array expression
-
array
Return a new array expression. The array is initially filled with the given integers.- Parameters:
members
- the initial members of the array- Returns:
- an array expression
-
array
Return a new array expression. The array is initially filled with the given integers.- Parameters:
members
- the initial members of the array- Returns:
- an array expression
-
lambda
Return a lambda expression. The expression is initially empty.- Returns:
- the lambda expression
-