bind: generate Java constructors for every exported struct

A recent CL added Java constructors to generated classes that extends
or implements other Java classes and interfaces. Constructors for a
struct S are Go functions on the form

func NewS...(...) *S

If no such constructors exists, a default empty constructor is
generated.

Expand that to cover every exported Go struct.

Fixes golang/go#17086

Change-Id: I910aba13d5884c3f67c946c62a8ac4a3db8e2ea7
Reviewed-on: https://go-review.googlesource.com/29710
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Elias Naur
2016-10-05 07:47:24 +00:00
parent 89b8360218
commit 3f7b83ffd4
13 changed files with 123 additions and 38 deletions
+8
View File
@@ -19,6 +19,10 @@ public final class S implements Seq.Proxy {
S(Seq.Ref ref) { this.ref = ref; }
public S() { this.ref = __New(); }
private static native Seq.Ref __New();
public final native double getX();
public final native void setX(double v);
@@ -79,6 +83,10 @@ public final class S2 implements Seq.Proxy, I {
S2(Seq.Ref ref) { this.ref = ref; }
public S2() { this.ref = __New(); }
private static native Seq.Ref __New();
public native void m();
public native String string();
@Override public boolean equals(Object o) {