| Modifier and Type | Class and Description |
|---|---|
| protected static class | CMethodBindingEmitter.
Class that emits a generic comment for CMethodBindingEmitters; the comment includes the C signature of the native method that is being bound by the emitter java method. |
| Modifier and Type | Field and Description |
|---|---|
| protected static final String | |
| protected static final String | |
| protected static final String | |
| protected MethodBinding | |
| private final String | className
Name of the class in which the corresponding Java method resides. |
| protected static final CommentEmitter | |
| protected boolean | |
| protected boolean | |
| private boolean | |
| private final boolean | isJavaMethodStatic
Whether or not the Java-side of the Java<->C JNI binding for this emitter's MethodBinding is static. |
| private final boolean | isOverloadedBinding
Whether or not the Java<->C JNI binding for this emitter's MethodBinding is overloaded. |
| protected final Logging. | |
| protected MachineDataInfo | |
| private final String | packageName
Name of the package in which the corresponding Java method resides. |
| private MessageFormat | returnValueCapacityExpression
Capacity of the return value in the event that it is encapsulated in a java.nio.Buffer. |
| private MessageFormat | returnValueLengthExpression
Length of the returned array. |
| protected static final String | |
| private List | temporaryCVariableAssignments
Optional List of Strings containing assignments to temporary C variables to make after the call is completed. |
| private List | temporaryCVariableDeclarations
Optional List of Strings containing temporary C variables to declare. |
| Access | Constructor and Description |
|---|---|
| public | CMethodBindingEmitter(final MethodBinding binding, final PrintWriter output, final String javaPackageName, final String javaClassName, final boolean isOverloadedBinding, final boolean isJavaMethodStatic, final boolean forImplementingMethodCall, final boolean forIndirectBufferAndArrayImplementation, final MachineDataInfo machDesc, final JavaConfiguration configuration)
Constructs an emitter for the specified binding, and sets a default comment emitter that will emit the signature of the C function that is being bound. |
| Modifier and Type | Method and Description |
|---|---|
| protected String[] | |
| protected String | |
| protected String | |
| protected static String | |
| protected int | emitArguments(final PrintWriter writer)
Implements abstract com. |
| protected void | |
| protected void | |
| protected int | emitBodyPassCArguments(final PrintWriter writer)
Returns the number of arguments passed so calling code knows whether to print a comma |
| protected void | |
| protected void | emitBodyUserVariableAssignments(final PrintWriter writer)
Emits the user-defined C variable assignments from the TemporaryCVariableAssignments directive in the .cfg file. |
| protected void | emitBodyUserVariableDeclarations(final PrintWriter writer)
Emits the user-defined C variable declarations from the TemporaryCVariableDeclarations directive in the .cfg file. |
| protected void | |
| protected void | emitBodyVariablePostCallCleanup(final PrintWriter writer)
Code to clean up any variables that were declared in emitBodyVariableDeclarations(), AFTER calling the actual C function. |
| protected void | emitBodyVariablePreCallSetup(final PrintWriter writer)
Code to init the variables that were declared in emitBodyVariableDeclarations(), PRIOR TO calling the actual C function. |
| private void | emitCalloc(final PrintWriter writer, final String targetVarName, final String elementTypeString, final String numElementsExpression, final String mallocFailureErrorString)
|
| private void | emitGetDirectBufferAddress(final PrintWriter writer, final String sourceVarName, final String receivingVarTypeString, final String receivingVarName, final boolean receivingIsPtrPtr, final String byteOffsetVarName, final boolean emitElseClause)
|
| private void | emitGetStringChars(final PrintWriter writer, final String sourceVarName, final String receivingVarName, final boolean isUTF8, final boolean emitElseClause)
|
| private void | emitMalloc(final PrintWriter writer, final String targetVarName, final String elementTypeString, final boolean elementTypeIsConst, final String numElementsExpression, final String mallocFailureErrorString)
|
| protected void | |
| private void | |
| private void | emitPointerConversion(final PrintWriter writer, final MethodBinding binding, final JavaType type, final Type cType, final String incomingArgumentName, final String cVariableName, String byteOffsetVarName)
|
| private boolean | emitPointerDeclaration(final PrintWriter writer, final JavaType javaType, final Type cType, final String cVariableName, final String javaArgumentName)
|
| private void | emitReturnDirectBufferAddress(final PrintWriter writer, final String sourceVarName, final String receivingVarTypeString, final String receivingVarName, final boolean receivingIsPtrPtr, final String byteOffsetVarName)
|
| protected void | emitReturnType(final PrintWriter writer)
Implements abstract com. |
| public final boolean | forIndirectBufferAndArrayImplementation()
Is this CMethodBindingEmitter implementing the case of an indirect buffer or array being passed down to C code? |
| public final MethodBinding | |
| public FunctionSymbol | |
| public String | |
| protected String | |
| public String | |
| public final boolean | getIsJavaMethodStatic()
Is the Java side of the Java<->C JNI binding for this emitter's MethodBinding a static method?. |
| public final boolean | getIsOverloadedBinding()
Is the Java<->C JNI binding for this emitter's MethodBinding one of several overloaded methods with the same name? |
| public String | |
| public String | |
| public final MachineDataInfo | |
| public String | |
| public final MessageFormat | getReturnValueCapacityExpression()
Get the expression for the capacity of the returned java.nio.Buffer. |
| public final MessageFormat | |
| public final List | getTemporaryCVariableAssignments()
Returns the List of Strings containing assignments for temporary C variables which are made after the underlying function call. |
| public final List | getTemporaryCVariableDeclarations()
Returns the List of Strings containing declarations for temporary C variables to be assigned to after the underlying function call. |
| protected String | |
| protected String | |
| protected boolean | isUTF8Type(Type type)
Checks a type to see whether it is for a UTF-8 pointer type (i.e., "const char *", "const char **"). |
| protected boolean | |
| protected String | |
| protected void | |
| protected String | |
| protected void | setIsCStructFunctionPointer(final boolean v)
If method originates from a struct, see |
| public final void | setReturnValueCapacityExpression(final MessageFormat
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. expression)If this function returns a void* encapsulated in a java.nio.Buffer (or compound type wrapper), sets the expression for the capacity of the returned Buffer. |
| public final void | setReturnValueLengthExpression(final MessageFormat
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. expression)If this function returns an array, sets the expression for the length of the returned array. |
| public final void | setTemporaryCVariableAssignments(final List<String> arg)
Sets up a List of Strings containing assignments for temporary C variables which are made after the underlying function call. |
| public final void | setTemporaryCVariableDeclarations(final List<String> arg)
Sets up a List of Strings containing declarations for temporary C variables to be assigned to after the underlying function call. |
| arrayIdx | back to summary |
|---|---|
| protected static final String arrayIdx | |
| arrayRes | back to summary |
|---|---|
| protected static final String arrayRes | |
| arrayResLength | back to summary |
|---|---|
| protected static final String arrayResLength | |
| binding | back to summary |
|---|---|
| protected MethodBinding binding | |
| className | back to summary |
|---|---|
| private final String className Name of the class in which the corresponding Java method resides. | |
| defaultCommentEmitter | back to summary |
|---|---|
| protected static final CommentEmitter defaultCommentEmitter | |
| forImplementingMethodCall | back to summary |
|---|---|
| protected boolean forImplementingMethodCall | |
| forIndirectBufferAndArrayImplementation | back to summary |
|---|---|
| protected boolean forIndirectBufferAndArrayImplementation | |
| isCStructFunctionPointer | back to summary |
|---|---|
| private boolean isCStructFunctionPointer | |
| isJavaMethodStatic | back to summary |
|---|---|
| private final boolean isJavaMethodStatic Whether or not the Java-side of the Java<->C JNI binding for this emitter's MethodBinding is static. | |
| isOverloadedBinding | back to summary |
|---|---|
| private final boolean isOverloadedBinding Whether or not the Java<->C JNI binding for this emitter's MethodBinding is overloaded. | |
| LOG | back to summary |
|---|---|
| protected final Logging. | |
| machDesc | back to summary |
|---|---|
| protected MachineDataInfo machDesc | |
| packageName | back to summary |
|---|---|
| private final String packageName Name of the package in which the corresponding Java method resides. | |
| returnValueCapacityExpression | back to summary |
|---|---|
| private MessageFormat returnValueCapacityExpression Capacity of the return value in the event that it is encapsulated in a java.nio.Buffer. Is ignored if binding.getJavaReturnType().isNIOBuffer() == false; | |
| returnValueLengthExpression | back to summary |
|---|---|
| private MessageFormat returnValueLengthExpression Length of the returned array. Is ignored if binding.getJavaReturnType().isArray() is false. | |
| STRING_CHARS_PREFIX | back to summary |
|---|---|
| protected static final String STRING_CHARS_PREFIX | |
| temporaryCVariableAssignments | back to summary |
|---|---|
| private List<String> temporaryCVariableAssignments Optional List of Strings containing assignments to temporary C variables to make after the call is completed. | |
| temporaryCVariableDeclarations | back to summary |
|---|---|
| private List<String> temporaryCVariableDeclarations Optional List of Strings containing temporary C variables to declare. | |
| CMethodBindingEmitter | back to summary |
|---|---|
| public CMethodBindingEmitter(final MethodBinding binding, final PrintWriter output, final String javaPackageName, final String javaClassName, final boolean isOverloadedBinding, final boolean isJavaMethodStatic, final boolean forImplementingMethodCall, final boolean forIndirectBufferAndArrayImplementation, final MachineDataInfo machDesc, final JavaConfiguration configuration) Constructs an emitter for the specified binding, and sets a default comment emitter that will emit the signature of the C function that is being bound. | |
| argumentNameArray | back to summary |
|---|---|
| protected String[] argumentNameArray() | |
| byteOffsetArgName | back to summary |
|---|---|
| protected String byteOffsetArgName(final int i) | |
| byteOffsetArrayArgName | back to summary |
|---|---|
| protected String byteOffsetArrayArgName(final int i) | |
| cThisArgumentName | back to summary |
|---|---|
| protected static String cThisArgumentName() | |
| emitArguments | back to summary |
|---|---|
| protected int emitArguments(final PrintWriter writer) Implements abstract com. Doc from com. Returns the number of arguments emitted.
| |
| emitBody | back to summary |
|---|---|
| protected void emitBody(final PrintWriter writer) Implements abstract com.
| |
| emitBodyCallCFunction | back to summary |
|---|---|
| protected void emitBodyCallCFunction(final PrintWriter writer) | |
| emitBodyPassCArguments | back to summary |
|---|---|
| protected int emitBodyPassCArguments(final PrintWriter writer) Returns the number of arguments passed so calling code knows whether to print a comma | |
| emitBodyReturnResult | back to summary |
|---|---|
| protected void emitBodyReturnResult(final PrintWriter writer) | |
| emitBodyUserVariableAssignments | back to summary |
|---|---|
| protected void emitBodyUserVariableAssignments(final PrintWriter writer) Emits the user-defined C variable assignments from the TemporaryCVariableAssignments directive in the .cfg file. | |
| emitBodyUserVariableDeclarations | back to summary |
|---|---|
| protected void emitBodyUserVariableDeclarations(final PrintWriter writer) Emits the user-defined C variable declarations from the TemporaryCVariableDeclarations directive in the .cfg file. | |
| emitBodyVariableDeclarations | back to summary |
|---|---|
| protected void emitBodyVariableDeclarations(final PrintWriter writer) | |
| emitBodyVariablePostCallCleanup | back to summary |
|---|---|
| protected void emitBodyVariablePostCallCleanup(final PrintWriter writer) Code to clean up any variables that were declared in emitBodyVariableDeclarations(), AFTER calling the actual C function. | |
| emitBodyVariablePreCallSetup | back to summary |
|---|---|
| protected void emitBodyVariablePreCallSetup(final PrintWriter writer) Code to init the variables that were declared in emitBodyVariableDeclarations(), PRIOR TO calling the actual C function. | |
| emitCalloc | back to summary |
|---|---|
| private void emitCalloc(final PrintWriter writer, final String targetVarName, final String elementTypeString, final String numElementsExpression, final String mallocFailureErrorString) | |
| emitGetDirectBufferAddress | back to summary |
|---|---|
| private void emitGetDirectBufferAddress(final PrintWriter writer, final String sourceVarName, final String receivingVarTypeString, final String receivingVarName, final boolean receivingIsPtrPtr, final String byteOffsetVarName, final boolean emitElseClause) | |
| emitGetStringChars | back to summary |
|---|---|
| private void emitGetStringChars(final PrintWriter writer, final String sourceVarName, final String receivingVarName, final boolean isUTF8, final boolean emitElseClause) | |
| emitMalloc | back to summary |
|---|---|
| private void emitMalloc(final PrintWriter writer, final String targetVarName, final String elementTypeString, final boolean elementTypeIsConst, final String numElementsExpression, final String mallocFailureErrorString) | |
| emitName | back to summary |
|---|---|
| protected void emitName(final PrintWriter writer) Implements abstract com.
| |
| emitOutOfMemoryCheck | back to summary |
|---|---|
| private void emitOutOfMemoryCheck(final PrintWriter writer, final String varName, final String errorMessage) | |
| emitPointerConversion | back to summary |
|---|---|
| private void emitPointerConversion(final PrintWriter writer, final MethodBinding binding, final JavaType type, final Type cType, final String incomingArgumentName, final String cVariableName, String byteOffsetVarName) | |
| emitPointerDeclaration | back to summary |
|---|---|
| private boolean emitPointerDeclaration(final PrintWriter writer, final JavaType javaType, final Type cType, final String cVariableName, final String javaArgumentName) | |
| emitReturnDirectBufferAddress | back to summary |
|---|---|
| private void emitReturnDirectBufferAddress(final PrintWriter writer, final String sourceVarName, final String receivingVarTypeString, final String receivingVarName, final boolean receivingIsPtrPtr, final String byteOffsetVarName) | |
| emitReturnType | back to summary |
|---|---|
| protected void emitReturnType(final PrintWriter writer) Implements abstract com.
| |
| forIndirectBufferAndArrayImplementation | back to summary |
|---|---|
| public final boolean forIndirectBufferAndArrayImplementation() Is this CMethodBindingEmitter implementing the case of an indirect buffer or array being passed down to C code? | |
| getBinding | back to summary |
|---|---|
| public final MethodBinding getBinding() | |
| getCSymbol | back to summary |
|---|---|
| public FunctionSymbol getCSymbol() Implements abstract com.
| |
| getImplName | back to summary |
|---|---|
| public String getImplName() Implements abstract com.
| |
| getImplSuffix | back to summary |
|---|---|
| protected String getImplSuffix() | |
| getInterfaceName | back to summary |
|---|---|
| public String getInterfaceName() Implements abstract com.
| |
| getIsJavaMethodStatic | back to summary |
|---|---|
| public final boolean getIsJavaMethodStatic() Is the Java side of the Java<->C JNI binding for this emitter's MethodBinding a static method?. | |
| getIsOverloadedBinding | back to summary |
|---|---|
| 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 | back to summary |
|---|---|
| public String getJavaClassName() Get the name of the package in which the corresponding Java method resides. | |
| getJavaPackageName | back to summary |
|---|---|
| public String getJavaPackageName() Get the name of the class in which the corresponding Java method resides. | |
| getMachineDataInfo | back to summary |
|---|---|
| public final MachineDataInfo getMachineDataInfo() Used for certain internal type size computations | |
| getNativeName | back to summary |
|---|---|
| public String getNativeName() Implements abstract com.
| |
| getReturnValueCapacityExpression | back to summary |
|---|---|
| public final MessageFormat getReturnValueCapacityExpression() Get the expression for the capacity of the returned java.nio.Buffer. | |
| getReturnValueLengthExpression | back to summary |
|---|---|
| public final MessageFormat getReturnValueLengthExpression() Get the expression for the length of the returned array | |
| getTemporaryCVariableAssignments | back to summary |
|---|---|
| public final List 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 | back to summary |
|---|---|
| public final List Returns the List of Strings containing declarations for temporary C variables to be assigned to after the underlying function call. | |
| isNIOArgName | back to summary |
|---|---|
| protected String isNIOArgName(final int i) | |
| isNIOArgName | back to summary |
|---|---|
| protected String isNIOArgName(final String s) | |
| isUTF8Type | back to summary |
|---|---|
| protected boolean isUTF8Type(Type type) Checks a type to see whether it is for a UTF-8 pointer type (i.e., "const char *", "const char **"). False implies that this type is for a Unicode pointer type ("jchar *", "jchar **"). | |
| javaArgTypeNeedsDataCopy | back to summary |
|---|---|
| protected boolean javaArgTypeNeedsDataCopy(final JavaType javaArgType) | |
| jniMangle | back to summary |
|---|---|
| protected String jniMangle(final MethodBinding binding) | |
| jniMangle | back to summary |
|---|---|
| protected void jniMangle(final Class<?> c, final StringBuilder res, final boolean syntheticArgument) | |
| pointerConversionArgumentName | back to summary |
|---|---|
| protected String pointerConversionArgumentName(final String argName) | |
| setIsCStructFunctionPointer | back to summary |
|---|---|
| protected void setIsCStructFunctionPointer(final boolean v) If method originates from a struct, see | |
| setReturnValueCapacityExpression | back to summary |
|---|---|
| public final void setReturnValueCapacityExpression(final MessageFormat expression) If this function returns a void* encapsulated in a java.nio.Buffer (or compound type wrapper), sets the expression for the capacity of the returned Buffer.
| |
| setReturnValueLengthExpression | back to summary |
|---|---|
| public final void setReturnValueLengthExpression(final MessageFormat expression) If this function returns an array, sets the expression for the length of the returned array.
| |
| setTemporaryCVariableAssignments | back to summary |
|---|---|
| public final void setTemporaryCVariableAssignments(final List<String> 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 | back to summary |
|---|---|
| public final void setTemporaryCVariableDeclarations(final List<String> 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. | |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | emit(final FunctionEmitter emitter, final PrintWriter writer)
Implements com. |
| protected void | |
| protected void |
| DefaultCommentEmitter | back to summary |
|---|---|
| protected DefaultCommentEmitter() | |
| emit | back to summary |
|---|---|
| public void emit(final FunctionEmitter emitter, final PrintWriter writer) Implements com. Doc from com. Emit the body of a comment for the specified function; do NOT emit the open (e.g., comment "/*") or close (e.g., "*\/") characters.
| |
| emitBeginning | back to summary |
|---|---|
| protected void emitBeginning(final CMethodBindingEmitter emitter, final PrintWriter writer) | |
| emitEnding | back to summary |
|---|---|
| protected void emitEnding(final CMethodBindingEmitter emitter, final PrintWriter writer) | |