net.java.games.gluegen

Class JavaMethodBindingEmitter

Known Direct Subclasses:
JavaMethodBindingImplEmitter

public class JavaMethodBindingEmitter
extends FunctionEmitter

An emitter that emits only the interface for a Java<->C JNI binding.

Nested Class Summary

protected static class
JavaMethodBindingEmitter.DefaultCommentEmitter
Class that emits a generic comment for JavaMethodBindingEmitters; the comment includes the C signature of the native method that is being bound by the emitter java method.
protected static class
JavaMethodBindingEmitter.InterfaceCommentEmitter

Nested classes/interfaces inherited from class net.java.games.gluegen.FunctionEmitter

FunctionEmitter.EmissionModifier

Field Summary

static FunctionEmitter.EmissionModifier
ABSTRACT
static FunctionEmitter.EmissionModifier
FINAL
static FunctionEmitter.EmissionModifier
NATIVE
static FunctionEmitter.EmissionModifier
PRIVATE
static FunctionEmitter.EmissionModifier
PROTECTED
static FunctionEmitter.EmissionModifier
PUBLIC
static FunctionEmitter.EmissionModifier
SYNCHRONIZED
protected static CommentEmitter
defaultInterfaceCommentEmitter
protected static CommentEmitter
defaultJavaCommentEmitter

Fields inherited from class net.java.games.gluegen.FunctionEmitter

STATIC

Constructor Summary

JavaMethodBindingEmitter(JavaMethodBindingEmitter arg)
JavaMethodBindingEmitter(MethodBinding binding, PrintWriter output, String runtimeExceptionType)
JavaMethodBindingEmitter(MethodBinding binding, PrintWriter output, String runtimeExceptionType, boolean forImplementingMethodCall)

Method Summary

protected int
emitArguments(PrintWriter writer)
protected void
emitBody(PrintWriter writer)
protected void
emitName(PrintWriter writer)
protected void
emitReturnType(PrintWriter writer)
protected String
getBaseIndentString()
MethodBinding
getBinding()
protected String
getCommentStartString()
protected String
getImplMethodName()
String
getName()
protected String
getReturnTypeString(boolean skipArray)
protected String
getReturnedArrayLengthExpression()
String
getRuntimeExceptionType()
The type of exception (must subclass java.lang.RuntimeException) raised if runtime checks fail in the generated code.
boolean
isForImplementingMethodCall()
protected static String
javaThisArgumentName()
void
setReturnedArrayLengthExpression(String expr)
If the underlying function returns an array (currently only arrays of compound types are supported) as opposed to a pointer to an object, this method should be called to provide a MessageFormat string containing an expression that computes the number of elements of the returned array.

Methods inherited from class net.java.games.gluegen.FunctionEmitter

addModifier, addModifiers, clearModifiers, emit, emit, emitArguments, emitBody, emitDocComment, emitModifiers, emitName, emitReturnType, emitSignature, getBaseIndentString, getCommentEmitter, getCommentEndString, getCommentStartString, getDefaultOutput, getModifiers, getName, hasModifier, removeModifier, setCommentEmitter, toString

Field Details

ABSTRACT

public static final FunctionEmitter.EmissionModifier ABSTRACT

FINAL

public static final FunctionEmitter.EmissionModifier FINAL

NATIVE

public static final FunctionEmitter.EmissionModifier NATIVE

PRIVATE

public static final FunctionEmitter.EmissionModifier PRIVATE

PROTECTED

public static final FunctionEmitter.EmissionModifier PROTECTED

PUBLIC

public static final FunctionEmitter.EmissionModifier PUBLIC

SYNCHRONIZED

public static final FunctionEmitter.EmissionModifier SYNCHRONIZED

defaultInterfaceCommentEmitter

protected static final CommentEmitter defaultInterfaceCommentEmitter

defaultJavaCommentEmitter

protected static final CommentEmitter defaultJavaCommentEmitter

Constructor Details

JavaMethodBindingEmitter

public JavaMethodBindingEmitter(JavaMethodBindingEmitter arg)

JavaMethodBindingEmitter

public JavaMethodBindingEmitter(MethodBinding binding,
                                PrintWriter output,
                                String runtimeExceptionType)

JavaMethodBindingEmitter

public JavaMethodBindingEmitter(MethodBinding binding,
                                PrintWriter output,
                                String runtimeExceptionType,
                                boolean forImplementingMethodCall)

Method Details

emitArguments

protected int emitArguments(PrintWriter writer)
Overrides:
emitArguments in interface FunctionEmitter

emitBody

protected void emitBody(PrintWriter writer)
Overrides:
emitBody in interface FunctionEmitter

emitName

protected void emitName(PrintWriter writer)
Overrides:
emitName in interface FunctionEmitter

emitReturnType

protected void emitReturnType(PrintWriter writer)
Overrides:
emitReturnType in interface FunctionEmitter

getBaseIndentString

protected String getBaseIndentString()
Overrides:
getBaseIndentString in interface FunctionEmitter

getBinding

public final MethodBinding getBinding()

getCommentStartString

protected String getCommentStartString()
Overrides:
getCommentStartString in interface FunctionEmitter

getImplMethodName

protected String getImplMethodName()

getName

public String getName()
Overrides:
getName in interface FunctionEmitter

getReturnTypeString

protected String getReturnTypeString(boolean skipArray)

getReturnedArrayLengthExpression

protected String getReturnedArrayLengthExpression()

getRuntimeExceptionType

public String getRuntimeExceptionType()
The type of exception (must subclass java.lang.RuntimeException) raised if runtime checks fail in the generated code.

isForImplementingMethodCall

public boolean isForImplementingMethodCall()

javaThisArgumentName

protected static String javaThisArgumentName()

setReturnedArrayLengthExpression

public void setReturnedArrayLengthExpression(String expr)
If the underlying function returns an array (currently only arrays of compound types are supported) as opposed to a pointer to an object, this method should be called to provide a MessageFormat string containing an expression that computes the number of elements of the returned array. The parameters to the MessageFormat expression are the names of the incoming Java arguments.