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

Method genVar

bind/genjava.go:859–874  ·  view source on GitHub ↗
(o *types.Var)

Source from the content-addressed store, hash-verified

857}
858
859func (g *JavaGen) genVar(o *types.Var) {
860 if t := o.Type(); !g.isSupported(t) {
861 g.Printf("// skipped variable %s with unsupported type: %s\n\n", o.Name(), t)
862 return
863 }
864 jType := g.javaType(o.Type())
865
866 doc := g.docs[o.Name()].Doc()
867 // setter
868 g.javadoc(doc)
869 g.Printf("public static native void set%s(%s v);\n", o.Name(), jType)
870
871 // getter
872 g.javadoc(doc)
873 g.Printf("public static native %s get%s();\n\n", jType, o.Name())
874}
875
876// genCRetClear clears the result value from a JNI call if an exception was
877// raised.

Callers 1

GenJavaMethod · 0.95

Calls 6

javaTypeMethod · 0.95
javadocMethod · 0.95
TypeMethod · 0.80
PrintfMethod · 0.80
DocMethod · 0.80
isSupportedMethod · 0.45

Tested by

no test coverage detected