MCPcopy Create free account
hub / github.com/golang/mobile / GenH

Method GenH

bind/genjava.go:1314–1342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1312}
1313
1314func (g *JavaGen) GenH() error {
1315 pkgPath := ""
1316 if g.Pkg != nil {
1317 pkgPath = g.Pkg.Path()
1318 }
1319 g.Printf(hPreamble, g.gobindOpts(), pkgPath, g.className())
1320 for _, iface := range g.interfaces {
1321 g.Printf("extern jclass proxy_class_%s_%s;\n", g.pkgPrefix, iface.obj.Name())
1322 g.Printf("extern jmethodID proxy_class_%s_%s_cons;\n", g.pkgPrefix, iface.obj.Name())
1323 g.Printf("\n")
1324 for _, m := range iface.summary.callable {
1325 if !g.isSigSupported(m.Type()) {
1326 g.Printf("// skipped method %s.%s with unsupported parameter or return types\n\n", iface.obj.Name(), m.Name())
1327 continue
1328 }
1329 g.genInterfaceMethodSignature(m, iface.obj.Name(), true, g.paramName)
1330 g.Printf("\n")
1331 }
1332 }
1333 for _, s := range g.structs {
1334 g.Printf("extern jclass proxy_class_%s_%s;\n", g.pkgPrefix, s.obj.Name())
1335 g.Printf("extern jmethodID proxy_class_%s_%s_cons;\n", g.pkgPrefix, s.obj.Name())
1336 }
1337 g.Printf("#endif\n")
1338 if len(g.err) > 0 {
1339 return g.err
1340 }
1341 return nil
1342}
1343
1344func (g *JavaGen) jniCallType(t types.Type) string {
1345 switch t := types.Unalias(t).(type) {

Callers 2

TestGenJavaFunction · 0.95
TestCustomPrefixFunction · 0.95

Calls 7

gobindOptsMethod · 0.95
classNameMethod · 0.95
PathMethod · 0.80
PrintfMethod · 0.80
isSigSupportedMethod · 0.80
TypeMethod · 0.80

Tested by 2

TestGenJavaFunction · 0.76
TestCustomPrefixFunction · 0.76