Package com.jogamp.gluegen
Class JavaMethodBindingEmitter
java.lang.Object
com.jogamp.gluegen.FunctionEmitter
com.jogamp.gluegen.JavaMethodBindingEmitter
- Direct Known Subclasses:
ProcAddressJavaMethodBindingEmitter
An emitter that emits only the interface for a Java<->C JNI binding.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classClass 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 classNested classes/interfaces inherited from class com.jogamp.gluegen.FunctionEmitter
FunctionEmitter.EmissionModifier -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FunctionEmitter.EmissionModifierprotected final MethodBindingprotected final CommentEmitterprotected final CommentEmitterstatic final FunctionEmitter.EmissionModifierstatic final FunctionEmitter.EmissionModifierstatic final FunctionEmitter.EmissionModifierstatic final FunctionEmitter.EmissionModifierstatic final FunctionEmitter.EmissionModifierstatic final FunctionEmitter.EmissionModifierprotected final booleanprotected final booleanFields inherited from class com.jogamp.gluegen.FunctionEmitter
cfg, STATIC -
Constructor Summary
ConstructorsConstructorDescriptionJavaMethodBindingEmitter(MethodBinding binding, PrintWriter output, String runtimeExceptionType, String unsupportedExceptionType, boolean emitBody, boolean tagNativeBinding, boolean eraseBufferAndArrayTypes, boolean useNIOOnly, boolean useNIODirectOnly, boolean forDirectBufferImplementation, boolean forIndirectBufferAndArrayImplementation, boolean isUnimplemented, boolean isInterface, boolean isNativeMethod, boolean isPrivateNativeMethod, JavaConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]protected StringbyteOffsetArgName(int i) protected static Stringprotected StringbyteOffsetArrayArgName(int i) protected intemitArguments(PrintWriter writer) Returns the number of arguments emitted.protected voidemitArrayLengthAndNIOBufferChecks(MethodBinding binding, PrintWriter writer) protected voidemitBody(PrintWriter writer) protected voidemitCall(MethodBinding binding, PrintWriter writer) protected intemitCallArguments(MethodBinding binding, PrintWriter writer) protected voidemitCallResultReturn(MethodBinding binding, PrintWriter writer) protected voidemitCompoundArrayCopies(MethodBinding binding, PrintWriter writer) protected voidemitName(PrintWriter writer) protected voidemitPostCallCleanup(MethodBinding binding, PrintWriter writer) protected voidemitPreCallSetup(MethodBinding binding, PrintWriter writer) protected voidemitPrologueOrEpilogue(List<String> code, PrintWriter writer) protected voidemitReturnType(PrintWriter writer) protected voidemitReturnVariableSetupAndCall(MethodBinding binding, PrintWriter writer) protected StringerasedTypeString(JavaType type, boolean skipBuffers) protected StringgetArgumentName(int i) protected Stringfinal MethodBindingprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected StringgetReturnTypeString(boolean skipArray) The type of exception (must subclassjava.lang.RuntimeException) raised if runtime checks fail in the generated code.booleanbooleanbooleanprotected StringisNIOArgName(int i) protected Stringbooleanstatic Stringprotected StringoffsetArgName(int i) voidsetEmitBody(boolean emitBody) Accessor for subclasses.voidsetEpilogue(List<String> epilogue) Sets the manually-generated epilogue code for this emitter.voidsetEraseBufferAndArrayTypes(boolean erase) Accessor for subclasses.voidsetForDirectBufferImplementation(boolean direct) Accessor for subclasses.voidsetForIndirectBufferAndArrayImplementation(boolean indirect) Accessor for subclasses.voidsetPrivateNativeMethod(boolean v) Accessor for subclasses.voidsetPrologue(List<String> prologue) Sets the manually-generated prologue code for this emitter.voidIf 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.protected voidsetReturnedArrayLengthExpression(String expr, boolean onlyForComments) booleanIndicates whether this emitter will print only a signature, or whether it will emit Java code for the body of the method as well.Methods inherited from class com.jogamp.gluegen.FunctionEmitter
addModifier, addModifiers, clearModifiers, emit, emit, emitDocComment, emitModifiers, emitSignature, getCommentEmitter, getDefaultOutput, getModifiers, hasModifier, isInterface, removeModifier, setCommentEmitter, toString
-
Field Details
-
PUBLIC
-
PROTECTED
-
PRIVATE
-
ABSTRACT
-
FINAL
-
NATIVE
-
SYNCHRONIZED
-
defaultJavaCommentEmitter
-
defaultInterfaceCommentEmitter
-
tagNativeBinding
protected final boolean tagNativeBinding -
useNIODirectOnly
protected final boolean useNIODirectOnly -
binding
-
prologue
-
epilogue
-
-
Constructor Details
-
JavaMethodBindingEmitter
public JavaMethodBindingEmitter(MethodBinding binding, PrintWriter output, String runtimeExceptionType, String unsupportedExceptionType, boolean emitBody, boolean tagNativeBinding, boolean eraseBufferAndArrayTypes, boolean useNIOOnly, boolean useNIODirectOnly, boolean forDirectBufferImplementation, boolean forIndirectBufferAndArrayImplementation, boolean isUnimplemented, boolean isInterface, boolean isNativeMethod, boolean isPrivateNativeMethod, JavaConfiguration configuration) -
JavaMethodBindingEmitter
-
-
Method Details
-
getBinding
-
isNativeMethod
public boolean isNativeMethod() -
isPrivateNativeMethod
public boolean isPrivateNativeMethod() -
isForDirectBufferImplementation
public boolean isForDirectBufferImplementation() -
isForIndirectBufferAndArrayImplementation
public boolean isForIndirectBufferAndArrayImplementation() -
getInterfaceName
- Specified by:
getInterfaceNamein classFunctionEmitter
-
getImplName
- Specified by:
getImplNamein classFunctionEmitter
-
getNativeName
- Specified by:
getNativeNamein classFunctionEmitter
-
getCSymbol
- Specified by:
getCSymbolin classFunctionEmitter
-
getArgumentName
-
getRuntimeExceptionType
The type of exception (must subclassjava.lang.RuntimeException) raised if runtime checks fail in the generated code. -
getUnsupportedExceptionType
-
setReturnedArrayLengthExpression
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. -
setReturnedArrayLengthExpression
-
getReturnedArrayLengthExpression
-
getReturnedArrayLengthComment
-
setPrologue
Sets the manually-generated prologue code for this emitter. -
setEpilogue
Sets the manually-generated epilogue code for this emitter. -
signatureOnly
public boolean signatureOnly()Indicates whether this emitter will print only a signature, or whether it will emit Java code for the body of the method as well. -
setEmitBody
public void setEmitBody(boolean emitBody) Accessor for subclasses. -
setEraseBufferAndArrayTypes
public void setEraseBufferAndArrayTypes(boolean erase) Accessor for subclasses. -
setPrivateNativeMethod
public void setPrivateNativeMethod(boolean v) Accessor for subclasses. -
setForDirectBufferImplementation
public void setForDirectBufferImplementation(boolean direct) Accessor for subclasses. -
setForIndirectBufferAndArrayImplementation
public void setForIndirectBufferAndArrayImplementation(boolean indirect) Accessor for subclasses. -
emitReturnType
- Specified by:
emitReturnTypein classFunctionEmitter
-
erasedTypeString
-
getReturnTypeString
-
emitName
- Specified by:
emitNamein classFunctionEmitter
-
emitArguments
Description copied from class:FunctionEmitterReturns the number of arguments emitted.- Specified by:
emitArgumentsin classFunctionEmitter
-
getNativeImplMethodName
-
byteOffsetArgName
-
byteOffsetArgName
-
isNIOArgName
-
isNIOArgName
-
byteOffsetArrayArgName
-
offsetArgName
-
emitBody
- Specified by:
emitBodyin classFunctionEmitter
-
emitPrologueOrEpilogue
-
emitPreCallSetup
-
emitArrayLengthAndNIOBufferChecks
-
emitCompoundArrayCopies
-
emitCall
-
emitReturnVariableSetupAndCall
-
emitCallArguments
-
emitPostCallCleanup
-
emitCallResultReturn
-
argumentNameArray
-
javaThisArgumentName
-
getCommentStartString
- Overrides:
getCommentStartStringin classFunctionEmitter
-
getCommentEndString
- Overrides:
getCommentEndStringin classFunctionEmitter
-
getBaseIndentString
- Overrides:
getBaseIndentStringin classFunctionEmitter
-