parameters: (self)
return_statement: return template.substitute(values)
docstring: Returns the code for RegisterNatives.
docstring_summary: Returns the code for RegisterNatives.
docstring_tokens: Returns the code for RegisterNatives .
function: def GetRegisterNativesString(self):
      """Returns the code for RegisterNatives."""
      template = Template("""\
  ${REGISTER_NATIVES_SIGNATURE} {
  ${EARLY_EXIT}
  ${CLASSES}
  ${NATIVES}
  ${CALLED_BY_NATIVES}
    return true;
  }
  """)
      signature = 'static bool RegisterNativesImpl(JNIEnv* env'
      if self.init_native:
        signature += ', jclass clazz)'
      else:
        signature += ')'
  
      early_exit = ''
      if self.options.native_exports_optional:
        early_exit = """\
    if (base::android::IsManualJniRegistrationDisabled()) return true;
  """
  
      natives = self.GetRegisterNativesImplString()
      called_by_natives = self.GetRegisterCalledByNativesImplString()
      values = {'REGISTER_NATIVES_SIGNATURE': signature,
                'EARLY_EXIT': early_exit,
                'CLASSES': self.GetFindClasses(),
                'NATIVES': natives,
                'CALLED_BY_NATIVES': called_by_natives,
               }
      return template.substitute(values)
function_tokens: def GetRegisterNativesString ( self ) : template = Template ( """\
  ${REGISTER_NATIVES_SIGNATURE} {
  ${EARLY_EXIT}
  ${CLASSES}
  ${NATIVES}
  ${CALLED_BY_NATIVES}
    return true;
  }
  """ ) signature = 'static bool RegisterNativesImpl(JNIEnv* env' if self . init_native : signature += ', jclass clazz)' else : signature += ')' early_exit = '' if self . options . native_exports_optional : early_exit = """\
    if (base::android::IsManualJniRegistrationDisabled()) return true;
  """ natives = self . GetRegisterNativesImplString ( ) called_by_natives = self . GetRegisterCalledByNativesImplString ( ) values = { 'REGISTER_NATIVES_SIGNATURE' : signature , 'EARLY_EXIT' : early_exit , 'CLASSES' : self . GetFindClasses ( ) , 'NATIVES' : natives , 'CALLED_BY_NATIVES' : called_by_natives , } return template . substitute ( values )