@Test public void testJson() { Expr left1 = new BinaryOperator(OpType.Plus, new LiteralValue("1", LiteralType.Unsigned_Integer), new LiteralValue("2", LiteralType.Unsigned_Integer)); Expr right1 = new BinaryOperator(OpType.Multiply, new LiteralValue("2", LiteralType.Unsigned_Integer), new LiteralValue("3", LiteralType.Unsigned_Integer)); Expr origin = new BinaryOperator(OpType.Plus, left1, right1); String json = origin.toJson(); Expr fromJson = JsonHelper.fromJson(json, Expr.class); assertEquals(origin, fromJson); }
public String toJson() { return JsonHelper.toJson(this); }
Expr implements JsonSerializable, Cloneable { public String toJson() { return JsonHelper.toJson(this); } }
Expr implements JsonSerializable, Cloneable { public String toJson() { return JsonHelper.toJson(this); } Expr(OpType opType); }
Expr implements JsonSerializable, Cloneable { public String toJson() { return JsonHelper.toJson(this); } Expr(OpType opType); OpType getType(); @Override abstract int hashCode(); @Override boolean equals(Object obj); @Override Object clone(); @Override String toString(); String toJson(); void accept(ExprVisitor visitor); }
Expr implements JsonSerializable, Cloneable { public String toJson() { return JsonHelper.toJson(this); } Expr(OpType opType); OpType getType(); @Override abstract int hashCode(); @Override boolean equals(Object obj); @Override Object clone(); @Override String toString(); String toJson(); void accept(ExprVisitor visitor);  }