- out_java_struct.write("\t\t")
- if ret_info.java_ty != "void":
- out_java_struct.write(ret_info.java_ty + " ret = ")
- out_java_struct.write("bindings." + re_match.group(2) + "(")
- for idx, info in enumerate(arg_names):
- if idx != 0:
- out_java_struct.write(", ")
- if idx == 0 and takes_self:
- out_java_struct.write("this.ptr")
- elif info.arg_name in default_constructor_args:
- out_java_struct.write("bindings." + info.java_hu_ty + "_new(")
- for explode_idx, explode_arg in enumerate(default_constructor_args[info.arg_name]):
- if explode_idx != 0:
- out_java_struct.write(", ")
- expl_arg_name = info.arg_name + "_" + explode_arg.arg_name
- if explode_arg.from_hu_conv is not None:
- out_java_struct.write(explode_arg.from_hu_conv[0].replace(explode_arg.arg_name, expl_arg_name))
- else:
- out_java_struct.write(expl_arg_name)
- out_java_struct.write(")")
- elif info.from_hu_conv is not None:
- out_java_struct.write(info.from_hu_conv[0])
- else:
- out_java_struct.write(info.arg_name)
- out_java_struct.write(");\n")
- if ret_info.to_hu_conv is not None:
- if not takes_self:
- out_java_struct.write("\t\t" + ret_info.to_hu_conv.replace("\n", "\n\t\t").replace("this", ret_info.to_hu_conv_name) + "\n")
- else:
- out_java_struct.write("\t\t" + ret_info.to_hu_conv.replace("\n", "\n\t\t") + "\n")
-
- for idx, info in enumerate(arg_names):
- if idx == 0 and takes_self:
- pass
- elif info.arg_name in default_constructor_args:
- for explode_arg in default_constructor_args[info.arg_name]:
- expl_arg_name = info.arg_name + "_" + explode_arg.arg_name
- if explode_arg.from_hu_conv is not None and ret_info.to_hu_conv_name:
- out_java_struct.write("\t\t" + explode_arg.from_hu_conv[1].replace(explode_arg.arg_name, expl_arg_name).replace("this", ret_info.to_hu_conv_name) + ";\n")
- elif info.from_hu_conv is not None and info.from_hu_conv[1] != "":
- if not takes_self and ret_info.to_hu_conv_name is not None:
- out_java_struct.write("\t\t" + info.from_hu_conv[1].replace("this", ret_info.to_hu_conv_name) + ";\n")
- else:
- out_java_struct.write("\t\t" + info.from_hu_conv[1] + ";\n")