parameters: (self)
return_statement: return self.SubstituteNativeMethods(template)
docstring: Returns the shared implementation for RegisterNatives.
docstring_summary: Returns the shared implementation for RegisterNatives.
docstring_tokens: Returns the shared implementation for RegisterNatives .
function: def GetRegisterNativesImplString(self):
      """Returns the shared implementation for RegisterNatives."""
      if not self.options.native_exports_optional:
        return ''
  
      template = Template("""\
    const int kMethods${JAVA_CLASS}Size = arraysize(kMethods${JAVA_CLASS});
  
    if (env->RegisterNatives(${JAVA_CLASS}_clazz(env),
                             kMethods${JAVA_CLASS},
                             kMethods${JAVA_CLASS}Size) < 0) {
      jni_generator::HandleRegistrationError(
          env, ${JAVA_CLASS}_clazz(env), __FILE__);
      return false;
    }
  """)
      return self.SubstituteNativeMethods(template)
function_tokens: def GetRegisterNativesImplString ( self ) : if not self . options . native_exports_optional : return '' template = Template ( """\
    const int kMethods${JAVA_CLASS}Size = arraysize(kMethods${JAVA_CLASS});
  
    if (env->RegisterNatives(${JAVA_CLASS}_clazz(env),
                             kMethods${JAVA_CLASS},
                             kMethods${JAVA_CLASS}Size) < 0) {
      jni_generator::HandleRegistrationError(
          env, ${JAVA_CLASS}_clazz(env), __FILE__);
      return false;
    }
  """ ) return self . SubstituteNativeMethods ( template )