Package deltix.util.jcg
Interface JContext
-
- All Known Implementing Classes:
CSharpSrcGenContext
,JavaSrcGenContext
,JContextImpl
public interface JContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description JAnnotation
annotation(JTypeImpl clazz, java.lang.Object... args)
JAnnotation
annotation(java.lang.Class<?> clazz, java.lang.Object... args)
JArrayInitializer
arrayInitializer(JType type)
JArrayInitializer
arrayInitializer(java.lang.Class<?> type)
JExpr
arrayLength(JExpr array)
JType
arrayTypeOf(JType type)
JType
arrayTypeOf(java.lang.Class<?> cls)
JStatement
assertStmt(JExpr passCond, JExpr message)
JType
asType(java.lang.Class<?> cls)
JExpr
binExpr(JExpr left, java.lang.String op, JExpr right)
JExpr
booleanLiteral(boolean value)
JStatement
breakStmt()
JStatement
breakStmt(java.lang.String label)
JExpr
call(java.lang.String method, JExpr... args)
JExpr
charLiteral(char value)
JExpr
classLiteral(JClass value)
JExpr
classLiteral(java.lang.Class<?> value)
JCompoundStatement
compStmt()
JExpr
condExpr(JExpr cond, JExpr pos, JExpr neg)
JExpr
conjunction(JExpr... args)
JStatement
continueStmt()
JExpr
disjunction(JExpr... args)
JExpr
doubleLiteral(double value)
JExpr
enumLiteral(java.lang.Enum<?> value)
JExpr
enumLiteral(java.lang.Object value)
JExpr
falseLiteral()
JExpr
floatLiteral(float value)
JStatement
forStmt(JExpr init, JExpr condition, JExpr update, JStatement body)
default JStatement
ifStmt(JExpr left, JExpr right, JExpr bothTrue, JExpr leftTrue, JExpr rightTrue, JExpr bothFalse)
JStatement
ifStmt(JExpr left, JExpr right, JStatement bothTrue, JStatement leftTrue, JStatement rightTrue, JStatement bothFalse)
JStatement
ifStmt(JExpr cond, JStatement then)
JStatement
ifStmt(JExpr cond1, JStatement then1, JExpr cond2, JExpr then2, JStatement els)
JStatement
ifStmt(JExpr cond, JStatement then, JStatement els)
JExpr
instanceOf(JExpr expr, JType toType)
JExpr
instanceOf(JExpr expr, java.lang.Class<?> toClass)
JExpr
intLiteral(int value)
JExpr
localVarRef(java.lang.String fieldName)
JExpr
longLiteral(long value)
JExpr
newArrayExpr(java.lang.Class<?> cls, JExpr... elements)
JClass
newClass(int modifiers, java.lang.String packageName, java.lang.String simpleName, JClass parent)
JClass
newClass(int modifiers, java.lang.String packageName, java.lang.String simpleName, java.lang.Class<?> parent)
JExpr
newExpr(JType type, JExpr... args)
JExpr
newExpr(java.lang.Class<?> cls, JExpr... args)
JExpr
newGenericExpr(java.lang.Class<?> cls, JExpr... args)
JExpr
nullLiteral()
JStatement
returnStmt()
JExpr
staticCall(java.lang.Class<?> cls, java.lang.String method, JExpr... args)
JExpr
staticCall(java.lang.Class<?> cls, java.lang.String method, java.lang.Class<?> typeArgument, JExpr... args)
JExpr
staticVarRef(JClass cls, java.lang.String fieldName)
JExpr
staticVarRef(java.lang.Class<?> cls, java.lang.String fieldName)
JExpr
staticVarRef(java.lang.String cls, java.lang.String fieldName)
JExpr
stringLiteral(java.lang.String value)
JExpr
sum(JExpr... es)
JExpr
supplierWithNew(java.lang.Class<?> cls, JExpr... args)
JExpr
thisLiteral()
JExpr
trueLiteral()
JTryStatement
tryStmt()
JExpr
typeof(JClass type)
JExpr
typeof(java.lang.Class<?> type)
-
-
-
Method Detail
-
compStmt
JCompoundStatement compStmt()
-
newClass
JClass newClass(int modifiers, java.lang.String packageName, java.lang.String simpleName, JClass parent)
-
newClass
JClass newClass(int modifiers, java.lang.String packageName, java.lang.String simpleName, java.lang.Class<?> parent)
-
asType
JType asType(java.lang.Class<?> cls)
-
arrayTypeOf
JType arrayTypeOf(java.lang.Class<?> cls)
-
staticVarRef
JExpr staticVarRef(java.lang.Class<?> cls, java.lang.String fieldName)
-
staticVarRef
JExpr staticVarRef(java.lang.String cls, java.lang.String fieldName)
-
localVarRef
JExpr localVarRef(java.lang.String fieldName)
-
ifStmt
JStatement ifStmt(JExpr cond, JStatement then, JStatement els)
-
ifStmt
JStatement ifStmt(JExpr cond1, JStatement then1, JExpr cond2, JExpr then2, JStatement els)
-
ifStmt
JStatement ifStmt(JExpr left, JExpr right, JStatement bothTrue, JStatement leftTrue, JStatement rightTrue, JStatement bothFalse)
-
ifStmt
default JStatement ifStmt(JExpr left, JExpr right, JExpr bothTrue, JExpr leftTrue, JExpr rightTrue, JExpr bothFalse)
-
ifStmt
JStatement ifStmt(JExpr cond, JStatement then)
-
returnStmt
JStatement returnStmt()
-
breakStmt
JStatement breakStmt()
-
breakStmt
JStatement breakStmt(java.lang.String label)
-
continueStmt
JStatement continueStmt()
-
staticCall
JExpr staticCall(java.lang.Class<?> cls, java.lang.String method, java.lang.Class<?> typeArgument, JExpr... args)
-
nullLiteral
JExpr nullLiteral()
-
thisLiteral
JExpr thisLiteral()
-
booleanLiteral
JExpr booleanLiteral(boolean value)
-
trueLiteral
JExpr trueLiteral()
-
falseLiteral
JExpr falseLiteral()
-
charLiteral
JExpr charLiteral(char value)
-
floatLiteral
JExpr floatLiteral(float value)
-
doubleLiteral
JExpr doubleLiteral(double value)
-
intLiteral
JExpr intLiteral(int value)
-
longLiteral
JExpr longLiteral(long value)
-
stringLiteral
JExpr stringLiteral(java.lang.String value)
-
classLiteral
JExpr classLiteral(java.lang.Class<?> value)
-
enumLiteral
JExpr enumLiteral(java.lang.Enum<?> value)
-
enumLiteral
JExpr enumLiteral(java.lang.Object value)
-
tryStmt
JTryStatement tryStmt()
-
assertStmt
JStatement assertStmt(JExpr passCond, JExpr message)
-
arrayInitializer
JArrayInitializer arrayInitializer(java.lang.Class<?> type)
-
arrayInitializer
JArrayInitializer arrayInitializer(JType type)
-
typeof
JExpr typeof(java.lang.Class<?> type)
-
forStmt
JStatement forStmt(JExpr init, JExpr condition, JExpr update, JStatement body)
-
annotation
JAnnotation annotation(java.lang.Class<?> clazz, java.lang.Object... args)
- Parameters:
clazz
- - the class of Annotationargs
- - Elements of the Annotation. Even elements are the keys. Odd elements are the values. One element if only value() parameter exists.- Returns:
- JAnnotation's instance
Example:
Annotationpublic @interface TODO {
will be created as
String author ();
String date ();
int currentRevision ();
String value ();
}
JContext.annotation (TODO.class, "author", "Author Name", "date", "2010-01-01", "currentRevision", 1, "value", "SOME VALUE")
Annotationpublic @interface MappedTo {
will be created as
String value ();
}
JContext.annotation ("TE$$T")
-
annotation
JAnnotation annotation(JTypeImpl clazz, java.lang.Object... args)
-
-