Class JavaMethodBindingEmitter

    • Constructor Detail

      • 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)
    • Method Detail

      • isNativeMethod

        public boolean isNativeMethod()
      • isPrivateNativeMethod

        public boolean isPrivateNativeMethod()
      • isForDirectBufferImplementation

        public boolean isForDirectBufferImplementation()
      • isForIndirectBufferAndArrayImplementation

        public boolean isForIndirectBufferAndArrayImplementation()
      • getArgumentName

        protected String getArgumentName​(int i)
      • getRuntimeExceptionType

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

        public String getUnsupportedExceptionType()
      • 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.
      • setReturnedArrayLengthExpression

        protected void setReturnedArrayLengthExpression​(String expr,
                                                        boolean onlyForComments)
      • getReturnedArrayLengthExpression

        protected String getReturnedArrayLengthExpression()
      • getReturnedArrayLengthComment

        protected String getReturnedArrayLengthComment()
      • setPrologue

        public void setPrologue​(List<String> prologue)
        Sets the manually-generated prologue code for this emitter.
      • setEpilogue

        public void setEpilogue​(List<String> epilogue)
        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.
      • erasedTypeString

        protected String erasedTypeString​(JavaType type,
                                          boolean skipBuffers)
      • getReturnTypeString

        protected String getReturnTypeString​(boolean skipArray)
      • getNativeImplMethodName

        protected String getNativeImplMethodName()
      • byteOffsetArgName

        protected String byteOffsetArgName​(int i)
      • byteOffsetArgName

        protected static String byteOffsetArgName​(String s)
      • isNIOArgName

        protected String isNIOArgName​(int i)
      • isNIOArgName

        protected String isNIOArgName​(String s)
      • byteOffsetArrayArgName

        protected String byteOffsetArrayArgName​(int i)
      • offsetArgName

        protected String offsetArgName​(int i)
      • emitPrologueOrEpilogue

        protected void emitPrologueOrEpilogue​(List<String> code,
                                              PrintWriter writer)
      • emitArrayLengthAndNIOBufferChecks

        protected void emitArrayLengthAndNIOBufferChecks​(MethodBinding binding,
                                                         PrintWriter writer)
      • emitReturnVariableSetupAndCall

        protected void emitReturnVariableSetupAndCall​(MethodBinding binding,
                                                      PrintWriter writer)
      • argumentNameArray

        protected String[] argumentNameArray()
      • javaThisArgumentName

        public static String javaThisArgumentName()