public final class JExprs
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.ThreadLocal<java.util.LinkedHashMap<java.lang.String,JAssignableExpr>> |
cache |
Modifier | Constructor and Description |
---|---|
private |
JExprs() |
Modifier and Type | Method and Description |
---|---|
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 JAssignableExpr |
$v(java.lang.String name)
Return a name expression.
|
static JArrayExpr |
array()
Return a new array expression.
|
static JArrayExpr |
array(int... members)
Return a new array expression.
|
static JArrayExpr |
array(JExpr... members)
Return a new array expression.
|
static JArrayExpr |
array(long... members)
Return a new array expression.
|
static JArrayExpr |
array(java.lang.String... members)
Return a new array expression.
|
static JExpr |
binary(int val)
Generate an
int value in binary base. |
static JExpr |
binary(long val)
Generate a
long value in binary base. |
static JCall |
call(javax.lang.model.element.ExecutableElement element)
Generate a method call expression to the given element.
|
static JCall |
call(java.lang.String name)
Generate a method call expression to the given method name.
|
static JCall |
callStatic(java.lang.Class<?> type,
java.lang.String name)
Generate a method call expression to a method on the given static type.
|
static JCall |
callStatic(JType type,
java.lang.String name)
Generate a method call expression to a method on the given static type.
|
static JCall |
callStatic(java.lang.String type,
java.lang.String name)
Generate a method call expression to a method on the given static type.
|
static JExpr |
ch(int val)
Generate a
char value constant. |
static JExpr |
decimal(double val)
Generate a
double value in decimal base. |
static JExpr |
decimal(float val)
Generate a
float value in decimal base. |
static JExpr |
decimal(int val)
Generate an
int value in decimal base. |
static JExpr |
decimal(long val)
Generate a
long value in decimal base. |
static JExpr |
hex(double val)
Generate a
double value in hexadecimal base. |
static JExpr |
hex(float val)
Generate a
float value in hexadecimal base. |
static JExpr |
hex(int val)
Generate an
int value in hexadecimal base. |
static JExpr |
hex(long val)
Generate a
long value in hexadecimal base. |
static JLambda |
lambda()
Return a lambda 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 JAssignableExpr |
name(java.lang.String name)
Return a name expression.
|
static JExpr |
str(java.lang.String string)
Generate a string constant value.
|
static final java.lang.ThreadLocal<java.util.LinkedHashMap<java.lang.String,JAssignableExpr>> cache
public static JExpr decimal(int val)
int
value in decimal base.val
- the valuepublic static JExpr decimal(long val)
long
value in decimal base.val
- the valuepublic static JExpr decimal(float val)
float
value in decimal base.val
- the valuepublic static JExpr decimal(double val)
double
value in decimal base.val
- the valuepublic static JExpr hex(int val)
int
value in hexadecimal base.val
- the valuepublic static JExpr hex(long val)
long
value in hexadecimal base.val
- the valuepublic static JExpr hex(float val)
float
value in hexadecimal base.val
- the valuepublic static JExpr hex(double val)
double
value in hexadecimal base.val
- the valuepublic static JExpr binary(int val)
int
value in binary base.val
- the valuepublic static JExpr binary(long val)
long
value in binary base.val
- the valuepublic static JExpr str(java.lang.String string)
string
- the stringpublic static JExpr ch(int val)
char
value constant.val
- the valuepublic static JCall call(javax.lang.model.element.ExecutableElement element)
element
- the method to callpublic static JCall call(java.lang.String name)
name
- the name of the method to callpublic static JCall callStatic(java.lang.String type, java.lang.String name)
type
- the type to call againstname
- the name of the method to callpublic static JCall callStatic(JType type, java.lang.String name)
type
- the type to call againstname
- the name of the method to callpublic static JCall callStatic(java.lang.Class<?> type, java.lang.String name)
type
- the type to call againstname
- the name of the method to callpublic static JAssignableExpr $v(java.lang.String name)
name(String)
.name
- the namepublic static JAssignableExpr $v(JParamDeclaration paramDeclaration)
paramDeclaration
- the method parameterpublic static JAssignableExpr $v(JVarDeclaration varDeclaration)
varDeclaration
- the variable declarationpublic static JAssignableExpr name(java.lang.String name)
name
- the namepublic static JAssignableExpr name(JParamDeclaration paramDeclaration)
paramDeclaration
- the method parameterpublic static JAssignableExpr name(JVarDeclaration varDeclaration)
varDeclaration
- the variable declarationpublic static JArrayExpr array()
public static JArrayExpr array(JExpr... members)
members
- the initial members of the arraypublic static JArrayExpr array(java.lang.String... members)
members
- the initial members of the arraypublic static JArrayExpr array(int... members)
members
- the initial members of the arraypublic static JArrayExpr array(long... members)
members
- the initial members of the arraypublic static JLambda lambda()