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

Method genFuncArgs

bind/genjava.go:460–477  ·  view source on GitHub ↗

genFuncArgs generated Java function arguments declaration for the function f. If the supplied overridden java function is supplied, genFuncArgs omits the implicit this argument.

(f *types.Func, jm *java.Func, hasThis bool)

Source from the content-addressed store, hash-verified

458// If the supplied overridden java function is supplied, genFuncArgs omits the implicit
459// this argument.
460func (g *JavaGen) genFuncArgs(f *types.Func, jm *java.Func, hasThis bool) {
461 sig := f.Type().(*types.Signature)
462 params := sig.Params()
463 first := 0
464 if hasThis {
465 // Skip the implicit this argument to the Go method
466 first = 1
467 }
468 for i := first; i < params.Len(); i++ {
469 if i > first {
470 g.Printf(", ")
471 }
472 v := params.At(i)
473 name := g.paramName(params, i)
474 jt := g.javaType(v.Type())
475 g.Printf("%s %s", jt, name)
476 }
477}
478
479func (g *JavaGen) genObjectMethods(n string, fields []*types.Var, isStringer bool) {
480 g.Printf("@Override public boolean equals(Object o) {\n")

Callers 2

genConstructorMethod · 0.95
genFuncSignatureMethod · 0.95

Calls 5

paramNameMethod · 0.95
javaTypeMethod · 0.95
TypeMethod · 0.80
PrintfMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected