def json_add_name():
data = open("Demo.java").readlines()
outfile = open("DemoFormat.java", "w")
flag = 0
for line in data:
if line.strip().find("}") != -1:
flag = 0
if flag == 1:
if line.strip() != "":
temp = line.strip().split(";")[0].split(" ")[-1]
outfile.write(" @ApiModel(value = \"" + temp
+ "\", example = \"" + temp + "\")" + "\n")
outfile.write(" @JsonParse(\"" + temp + "\")" + "\n")
if line.strip().find("{") != -1:
flag = 1
outfile.write(line)
outfile.close()