Emits the C-side component of the Java<->C JNI binding.
cThisArgumentName
protected static String cThisArgumentName()
emitBodyCallCFunction
protected void emitBodyCallCFunction(PrintWriter writer)
emitBodyReturnResult
protected void emitBodyReturnResult(PrintWriter writer)
emitBodyUserVariableAssignments
protected void emitBodyUserVariableAssignments(PrintWriter writer)
Emits the user-defined C variable assignments from the
TemporaryCVariableAssignments directive in the .cfg file.
emitBodyUserVariableDeclarations
protected void emitBodyUserVariableDeclarations(PrintWriter writer)
Emits the user-defined C variable declarations from the
TemporaryCVariableDeclarations directive in the .cfg file.
emitBodyVariableDeclarations
protected void emitBodyVariableDeclarations(PrintWriter writer)
emitBodyVariablePostCallCleanup
protected void emitBodyVariablePostCallCleanup(PrintWriter writer,
boolean emittingPrimitiveArrayCritical)
Code to clean up any variables that were declared in
emitBodyVariableDeclarations(), AFTER calling the actual C function.
emitBodyVariablePreCallSetup
protected void emitBodyVariablePreCallSetup(PrintWriter writer,
boolean emittingPrimitiveArrayCritical)
Code to init the variables that were declared in
emitBodyVariableDeclarations(), PRIOR TO calling the actual C
function.
getIsJavaMethodStatic
public final boolean getIsJavaMethodStatic()
Is the Java side of the Java<->C JNI binding for this emitter's
MethodBinding a static method?.
getIsOverloadedBinding
public final boolean getIsOverloadedBinding()
Is the Java<->C JNI binding for this emitter's MethodBinding one of
several overloaded methods with the same name?
getJavaClassName
public String getJavaClassName()
Get the name of the package in which the corresponding Java method
resides.
getJavaPackageName
public String getJavaPackageName()
Get the name of the class in which the corresponding Java method
resides.
getReturnValueCapacityExpression
public final MessageFormat getReturnValueCapacityExpression()
Get the expression for the capacity of the returned java.nio.Buffer.
getReturnValueLengthExpression
public final MessageFormat getReturnValueLengthExpression()
Get the expression for the length of the returned array
getTemporaryCVariableAssignments
public final List getTemporaryCVariableAssignments()
Returns the List of Strings containing assignments for temporary
C variables which are made after the underlying function call. A
null argument indicates that no manual assignments are to be
made.
getTemporaryCVariableDeclarations
public final List getTemporaryCVariableDeclarations()
Returns the List of Strings containing declarations for temporary
C variables to be assigned to after the underlying function call.
isNIOBufferClass
protected static boolean isNIOBufferClass(Class c)
javaArgTypeNeedsDataCopy
protected boolean javaArgTypeNeedsDataCopy(JavaType javaArgType)
jniMangle
protected void jniMangle(Class c,
StringBuffer res)
jniMangle
protected String jniMangle(String name)
pointerConversionArgumentName
protected String pointerConversionArgumentName(int i)
setReturnValueCapacityExpression
public final void setReturnValueCapacityExpression(MessageFormat expression)
If this function returns a void* encapsulated in a
java.nio.Buffer, sets the expression for the capacity of the
returned Buffer.
expression
- a MessageFormat which, when applied to an array
of type String[] that contains each of the arguments names of the
Java-side binding, returns an expression that will (when compiled
by a C compiler) evaluate to an integer-valued expression. The
value of this expression is the capacity of the java.nio.Buffer
returned from this method.
setReturnValueLengthExpression
public final void setReturnValueLengthExpression(MessageFormat expression)
If this function returns an array, sets the expression for the
length of the returned array.
expression
- a MessageFormat which, when applied to an array
of type String[] that contains each of the arguments names of the
Java-side binding, returns an expression that will (when compiled
by a C compiler) evaluate to an integer-valued expression. The
value of this expression is the length of the array returned from
this method.
setTemporaryCVariableAssignments
public final void setTemporaryCVariableAssignments(List arg)
Sets up a List of Strings containing assignments for temporary C
variables which are made after the underlying function call. A
null argument indicates that no manual assignments are to be made.
setTemporaryCVariableDeclarations
public final void setTemporaryCVariableDeclarations(List arg)
Sets up a List of Strings containing declarations for temporary C
variables to be assigned to after the underlying function call. A
null argument indicates that no manual declarations are to be made.