Package deltix.util.jcg.scg
Class CSharpSrcGenContext
- java.lang.Object
-
- deltix.util.jcg.scg.JContextImpl
-
- deltix.util.jcg.scg.CSharpSrcGenContext
-
- All Implemented Interfaces:
JContext
public class CSharpSrcGenContext extends JContextImpl
Generates C# source code.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CSharpSrcGenContext.AssertMode
-
Constructor Summary
Constructors Constructor Description CSharpSrcGenContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JAnnotation
annotation(JTypeImpl clazz, java.lang.Object... args)
JAnnotation
annotation(java.lang.Class<?> clazz, java.lang.Object... args)
JStatement
assertStmt(JExpr passCond, JExpr message)
JExpr
classLiteral(JClass value)
JExpr
classLiteral(java.lang.Class<?> value)
JExpr
enumLiteral(java.lang.Object value)
CSharpSrcGenContext.AssertMode
getAssertMode()
JExpr
instanceOf(JExpr arg, JType toType)
JExpr
instanceOf(JExpr arg, java.lang.Class<?> toClass)
protected void
printModifiers(int mods, SourceCodePrinter out)
protected void
printType(java.lang.String type, SourceCodePrinter out)
protected void
printType(java.lang.String type, java.lang.String[] typeArgs, SourceCodePrinter out)
void
setAssertMode(CSharpSrcGenContext.AssertMode assertHandling)
JExpr
staticCall(java.lang.Class<?> cls, java.lang.String method, java.lang.Class<?> typeArgument, JExpr... args)
java.lang.String
translateType(java.lang.String type)
JExpr
typeof(JClass type)
JExpr
typeof(java.lang.Class<?> type)
-
Methods inherited from class deltix.util.jcg.scg.JContextImpl
arrayInitializer, arrayInitializer, arrayLength, arrayTypeOf, arrayTypeOf, asType, binExpr, booleanLiteral, breakStmt, breakStmt, call, charLiteral, cn, cn, cn, cn, compStmt, condExpr, conjunction, continueStmt, disjunction, doubleLiteral, enumLiteral, falseLiteral, floatLiteral, forStmt, ifStmt, ifStmt, ifStmt, ifStmt, intLiteral, localVarRef, longLiteral, newArrayExpr, newClass, newClass, newExpr, newExpr, newGenericExpr, nullLiteral, returnStmt, staticCall, staticVarRef, staticVarRef, staticVarRef, stringLiteral, sum, supplierWithNew, thisLiteral, trueLiteral, tryStmt
-
-
-
-
Method Detail
-
getAssertMode
public CSharpSrcGenContext.AssertMode getAssertMode()
-
setAssertMode
public void setAssertMode(CSharpSrcGenContext.AssertMode assertHandling)
-
assertStmt
public JStatement assertStmt(JExpr passCond, JExpr message)
-
classLiteral
public JExpr classLiteral(java.lang.Class<?> value)
-
typeof
public JExpr typeof(java.lang.Class<?> type)
-
staticCall
public JExpr staticCall(java.lang.Class<?> cls, java.lang.String method, java.lang.Class<?> typeArgument, JExpr... args)
-
enumLiteral
public JExpr enumLiteral(java.lang.Object value)
-
annotation
public 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
public JAnnotation annotation(JTypeImpl clazz, java.lang.Object... args)
-
translateType
public java.lang.String translateType(java.lang.String type)
-
printModifiers
protected void printModifiers(int mods, SourceCodePrinter out) throws java.io.IOException
- Specified by:
printModifiers
in classJContextImpl
- Throws:
java.io.IOException
-
printType
protected void printType(java.lang.String type, SourceCodePrinter out) throws java.io.IOException
- Specified by:
printType
in classJContextImpl
- Throws:
java.io.IOException
-
printType
protected void printType(java.lang.String type, java.lang.String[] typeArgs, SourceCodePrinter out) throws java.io.IOException
- Specified by:
printType
in classJContextImpl
- Throws:
java.io.IOException
-
-