| 857 | } |
| 858 | |
| 859 | func (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. |