- out_java_struct.write(consts.hu_struct_file_prefix)
- out_java_struct.write("public class " + struct_name.replace("LDK","") + " extends CommonBase")
- if struct_name.startswith("LDKLocked"):
- out_java_struct.write(" implements AutoCloseable")
- out_java_struct.write(" {\n")
- out_java_struct.write("\t" + struct_name.replace("LDK", "") + "(Object _dummy, long ptr) { super(ptr); }\n")
- if struct_name.startswith("LDKLocked"):
- out_java_struct.write("\t@Override public void close() {\n")
- else:
- out_java_struct.write("\t@Override @SuppressWarnings(\"deprecation\")\n")
- out_java_struct.write("\tprotected void finalize() throws Throwable {\n")
- out_java_struct.write("\t\tsuper.finalize();\n")
- out_java_struct.write("\t\tif (ptr != 0) { bindings." + struct_name.replace("LDK","") + "_free(ptr); }\n")
- out_java_struct.write("\t}\n\n")
+ out_opaque_struct_human = consts.map_opaque_struct(struct_name)
+ out_java_struct.write(out_opaque_struct_human)