parameters: (param)
return_statement: return (prefix + 'L' +
              JniParams.RemapClassName(JniParams._package + '/' + param) + ';')
docstring: Converts a java param into a JNI signature type.
docstring_summary: Converts a java param into a JNI signature type.
docstring_tokens: Converts a java param into a JNI signature type .
function: def JavaToJni(param):
      """Converts a java param into a JNI signature type."""
      pod_param_map = {
          'int': 'I',
          'boolean': 'Z',
          'char': 'C',
          'short': 'S',
          'long': 'J',
          'double': 'D',
          'float': 'F',
          'byte': 'B',
          'void': 'V',
      }
      object_param_list = [
          'Ljava/lang/Boolean',
          'Ljava/lang/Integer',
          'Ljava/lang/Long',
          'Ljava/lang/Object',
          'Ljava/lang/String',
          'Ljava/lang/Class',
      ]
      prefix = ''
      # Array?
      while param[-2:] == '[]':
        prefix += '['
        param = param[:-2]
      # Generic?
      if '<' in param:
        param = param[:param.index('<')]
      if param in pod_param_map:
        return prefix + pod_param_map[param]
      if '/' in param:
        # Coming from javap, use the fully qualified param directly.
        return prefix + 'L' + JniParams.RemapClassName(param) + ';'
      for qualified_name in (object_param_list +
                             [JniParams._fully_qualified_class] +
                             JniParams._inner_classes):
        if (qualified_name.endswith('/' + param) or
            qualified_name.endswith('$' + param.replace('.', '$')) or
            qualified_name == 'L' + param):
          return prefix + JniParams.RemapClassName(qualified_name) + ';'
  
      # Is it from an import? (e.g. referecing Class from import pkg.Class;
      # note that referencing an inner class Inner from import pkg.Class.Inner
      # is not supported).
      for qualified_name in JniParams._imports:
        if qualified_name.endswith('/' + param):
          # Ensure it's not an inner class.
          components = qualified_name.split('/')
          if len(components) > 2 and components[-2][0].isupper():
            raise SyntaxError('Inner class (%s) can not be imported '
                              'and used by JNI (%s). Please import the outer '
                              'class and use Outer.Inner instead.' %
                              (qualified_name, param))
          return prefix + JniParams.RemapClassName(qualified_name) + ';'
  
      # Is it an inner class from an outer class import? (e.g. referencing
      # Class.Inner from import pkg.Class).
      if '.' in param:
        components = param.split('.')
        outer = '/'.join(components[:-1])
        inner = components[-1]
        for qualified_name in JniParams._imports:
          if qualified_name.endswith('/' + outer):
            return (prefix + JniParams.RemapClassName(qualified_name) +
                    '$' + inner + ';')
  
      # Type not found, falling back to same package as this class.
      return (prefix + 'L' +
              JniParams.RemapClassName(JniParams._package + '/' + param) + ';')
function_tokens: def JavaToJni ( param ) : pod_param_map = { 'int' : 'I' , 'boolean' : 'Z' , 'char' : 'C' , 'short' : 'S' , 'long' : 'J' , 'double' : 'D' , 'float' : 'F' , 'byte' : 'B' , 'void' : 'V' , } object_param_list = [ 'Ljava/lang/Boolean' , 'Ljava/lang/Integer' , 'Ljava/lang/Long' , 'Ljava/lang/Object' , 'Ljava/lang/String' , 'Ljava/lang/Class' , ] prefix = '' # Array? while param [ - 2 : ] == '[]' : prefix += '[' param = param [ : - 2 ] # Generic? if '<' in param : param = param [ : param . index ( '<' ) ] if param in pod_param_map : return prefix + pod_param_map [ param ] if '/' in param : # Coming from javap, use the fully qualified param directly. return prefix + 'L' + JniParams . RemapClassName ( param ) + ';' for qualified_name in ( object_param_list + [ JniParams . _fully_qualified_class ] + JniParams . _inner_classes ) : if ( qualified_name . endswith ( '/' + param ) or qualified_name . endswith ( '$' + param . replace ( '.' , '$' ) ) or qualified_name == 'L' + param ) : return prefix + JniParams . RemapClassName ( qualified_name ) + ';' # Is it from an import? (e.g. referecing Class from import pkg.Class; # note that referencing an inner class Inner from import pkg.Class.Inner # is not supported). for qualified_name in JniParams . _imports : if qualified_name . endswith ( '/' + param ) : # Ensure it's not an inner class. components = qualified_name . split ( '/' ) if len ( components ) > 2 and components [ - 2 ] [ 0 ] . isupper ( ) : raise SyntaxError ( 'Inner class (%s) can not be imported ' 'and used by JNI (%s). Please import the outer ' 'class and use Outer.Inner instead.' % ( qualified_name , param ) ) return prefix + JniParams . RemapClassName ( qualified_name ) + ';' # Is it an inner class from an outer class import? (e.g. referencing # Class.Inner from import pkg.Class). if '.' in param : components = param . split ( '.' ) outer = '/' . join ( components [ : - 1 ] ) inner = components [ - 1 ] for qualified_name in JniParams . _imports : if qualified_name . endswith ( '/' + outer ) : return ( prefix + JniParams . RemapClassName ( qualified_name ) + '$' + inner + ';' ) # Type not found, falling back to same package as this class. return ( prefix + 'L' + JniParams . RemapClassName ( JniParams . _package + '/' + param ) + ';' )