public class JavaStructSource
extends java.lang.Object
JavaStructSource
implements the Java interface
for SIDL structs and conversion routines that translate among the
Java representation and Babel's IOR. This class generates the Java files
and the C JNI files. It is assumed that all symbols necessary to generate
Java code are available in the symbol table.Modifier and Type | Field and Description |
---|---|
protected Struct |
d_struct |
static int |
MODE_IN |
static int |
MODE_INOUT |
static int |
MODE_OUT |
static int |
MODE_RET |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsRarrayField(Struct s)
Returns true if the given struct contains a raw array field.
|
static void |
convertIORToJava(LanguageWriterForC writer,
Type type,
java.lang.String ior_result,
java.lang.String java_result,
int mode,
boolean is_client,
Context context)
Method
convertIORToJava converts between IOR objects
and Java objects. |
static void |
convertJavaToIOR(LanguageWriterForC writer,
Type type,
java.lang.String dst_name,
java.lang.String src_name,
int mode,
boolean is_client,
Context context)
Method
convertJavaToIOR converts between Java objects
and IOR arguments. |
void |
generateProxyClass(Context d_context,
LanguageWriterForJava d_writer)
Generate Java code for SIDL struct support
|
void |
generateUtilityHeader(Context d_context)
Generate a header file with prototypse for utility functions used
for struct support.
|
void |
generateUtilitySource(Context d_context)
Generate a set of C utility functions that convert from Babel's IOR to
native Java objects and vice versa.
|
static java.lang.String |
getCleanupFunctionName(SymbolID id)
Retrieves the name of the utility function that releases allocated
memory for variable sized raw arrays
|
static java.lang.String |
getI2JFunctionName(SymbolID id)
Retrieves the name of the utility function used to convert from IOR
to Java objects
|
static java.lang.String |
getI2JHolderFunctionName(SymbolID id)
Retrieves the name of the utility function used to convert from IOR
to Java holder objects
|
static java.lang.String |
getIORDeserializerName(SymbolID id)
Retrieves the name of the utility function used to deserialize IOR structs
|
static java.lang.String |
getIORSerializerName(SymbolID id)
Retrieves the name of the utility function used to serialize IOR structs
|
static java.lang.String |
getJ2IFunctionName(SymbolID id)
Retrieves the name of the utility function used to convert from Java
objects to IOR
|
static java.lang.String |
getJ2IHolderFunctionName(SymbolID id)
Retrieves the name of the utility function used to convert from Java
holder objects to IOR
|
static boolean |
requiresCleanup(Struct s)
Returns true if the given struct contains a raw array field or a nested
struct that might require cleanup
|
protected Struct d_struct
public static final int MODE_IN
public static final int MODE_INOUT
public static final int MODE_OUT
public static final int MODE_RET
public static java.lang.String getJ2IFunctionName(SymbolID id)
public static java.lang.String getJ2IHolderFunctionName(SymbolID id)
public static java.lang.String getI2JFunctionName(SymbolID id)
public static java.lang.String getCleanupFunctionName(SymbolID id)
public static java.lang.String getI2JHolderFunctionName(SymbolID id)
public static java.lang.String getIORSerializerName(SymbolID id)
public static java.lang.String getIORDeserializerName(SymbolID id)
public void generateProxyClass(Context d_context, LanguageWriterForJava d_writer) throws CodeGenerationException
CodeGenerationException
public void generateUtilityHeader(Context d_context) throws CodeGenerationException
CodeGenerationException
public static boolean containsRarrayField(Struct s)
public static boolean requiresCleanup(Struct s)
public static void convertJavaToIOR(LanguageWriterForC writer, Type type, java.lang.String dst_name, java.lang.String src_name, int mode, boolean is_client, Context context) throws CodeGenerationException
convertJavaToIOR
converts between Java objects
and IOR arguments. Conversion routines are output to the language writer.
This routine retrieves the conversion string from the appropriate hash
table and then substitutes the appropriate variable names in the conversion
string. This function is currently exclusively used to convert struct fields.CodeGenerationException
public static void convertIORToJava(LanguageWriterForC writer, Type type, java.lang.String ior_result, java.lang.String java_result, int mode, boolean is_client, Context context) throws CodeGenerationException
convertIORToJava
converts between IOR objects
and Java objects. Conversion routines are output
to the language writer. This routine retrieves the conversion string
from the hash table and then substitutes the appropriate variable names
in the conversion string. This function is currently exclusively used
to convert struct fields.CodeGenerationException
public void generateUtilitySource(Context d_context) throws CodeGenerationException
CodeGenerationException