22
33import com .relogiclabs .json .schema .internal .antlr .JsonParser ;
44import com .relogiclabs .json .schema .internal .antlr .JsonParserBaseVisitor ;
5+ import com .relogiclabs .json .schema .internal .builder .JArrayBuilder ;
6+ import com .relogiclabs .json .schema .internal .builder .JBooleanBuilder ;
7+ import com .relogiclabs .json .schema .internal .builder .JDoubleBuilder ;
8+ import com .relogiclabs .json .schema .internal .builder .JFloatBuilder ;
9+ import com .relogiclabs .json .schema .internal .builder .JIntegerBuilder ;
10+ import com .relogiclabs .json .schema .internal .builder .JNullBuilder ;
11+ import com .relogiclabs .json .schema .internal .builder .JObjectBuilder ;
12+ import com .relogiclabs .json .schema .internal .builder .JPropertyBuilder ;
13+ import com .relogiclabs .json .schema .internal .builder .JRootBuilder ;
14+ import com .relogiclabs .json .schema .internal .builder .JStringBuilder ;
515import com .relogiclabs .json .schema .tree .Context ;
616import com .relogiclabs .json .schema .tree .RuntimeContext ;
7- import com .relogiclabs .json .schema .types .JArray ;
8- import com .relogiclabs .json .schema .types .JBoolean ;
9- import com .relogiclabs .json .schema .types .JDouble ;
10- import com .relogiclabs .json .schema .types .JFloat ;
11- import com .relogiclabs .json .schema .types .JInteger ;
12- import com .relogiclabs .json .schema .types .JNode ;
13- import com .relogiclabs .json .schema .types .JNull ;
14- import com .relogiclabs .json .schema .types .JObject ;
15- import com .relogiclabs .json .schema .types .JProperty ;
16- import com .relogiclabs .json .schema .types .JRoot ;
17- import com .relogiclabs .json .schema .types .JString ;
17+ import com .relogiclabs .json .schema .type .JNode ;
18+ import com .relogiclabs .json .schema .type .JProperty ;
1819
1920import java .util .HashMap ;
2021import java .util .Map ;
@@ -35,7 +36,7 @@ public JsonTreeVisitor(RuntimeContext runtime) {
3536
3637 @ Override
3738 public JNode visitJson (JsonParser .JsonContext ctx ) {
38- return new JRoot . Builder ()
39+ return new JRootBuilder ()
3940 .relations (relations )
4041 .context (new Context (ctx , runtime ))
4142 .value (visit (ctx .value ()))
@@ -52,7 +53,7 @@ public JNode visitValue(JsonParser.ValueContext ctx) {
5253
5354 @ Override
5455 public JNode visitObject (JsonParser .ObjectContext ctx ) {
55- return new JObject . Builder ()
56+ return new JObjectBuilder ()
5657 .relations (relations )
5758 .context (new Context (ctx , runtime ))
5859 .properties (checkForDuplicate (ctx .property ().stream ()
@@ -62,7 +63,7 @@ public JNode visitObject(JsonParser.ObjectContext ctx) {
6263
6364 @ Override
6465 public JNode visitProperty (JsonParser .PropertyContext ctx ) {
65- return new JProperty . Builder ()
66+ return new JPropertyBuilder ()
6667 .relations (relations )
6768 .context (new Context (ctx , runtime ))
6869 .key (unquote (ctx .STRING ().getText ()))
@@ -72,7 +73,7 @@ public JNode visitProperty(JsonParser.PropertyContext ctx) {
7273
7374 @ Override
7475 public JNode visitArray (JsonParser .ArrayContext ctx ) {
75- return new JArray . Builder ()
76+ return new JArrayBuilder ()
7677 .relations (relations )
7778 .context (new Context (ctx , runtime ))
7879 .elements (ctx .value ().stream ().map (this ::visit ).toList ())
@@ -81,23 +82,23 @@ public JNode visitArray(JsonParser.ArrayContext ctx) {
8182
8283 @ Override
8384 public JNode visitPrimitiveTrue (JsonParser .PrimitiveTrueContext ctx ) {
84- return new JBoolean . Builder ()
85+ return new JBooleanBuilder ()
8586 .relations (relations )
8687 .context (new Context (ctx , runtime ))
8788 .value (true ).build ();
8889 }
8990
9091 @ Override
9192 public JNode visitPrimitiveFalse (JsonParser .PrimitiveFalseContext ctx ) {
92- return new JBoolean . Builder ()
93+ return new JBooleanBuilder ()
9394 .relations (relations )
9495 .context (new Context (ctx , runtime ))
9596 .value (false ).build ();
9697 }
9798
9899 @ Override
99100 public JNode visitPrimitiveString (JsonParser .PrimitiveStringContext ctx ) {
100- return new JString . Builder ()
101+ return new JStringBuilder ()
101102 .relations (relations )
102103 .context (new Context (ctx , runtime ))
103104 .value (toEncoded (ctx .STRING ().getText ()))
@@ -106,7 +107,7 @@ public JNode visitPrimitiveString(JsonParser.PrimitiveStringContext ctx) {
106107
107108 @ Override
108109 public JNode visitPrimitiveInteger (JsonParser .PrimitiveIntegerContext ctx ) {
109- return new JInteger . Builder ()
110+ return new JIntegerBuilder ()
110111 .relations (relations )
111112 .context (new Context (ctx , runtime ))
112113 .value (Long .valueOf (ctx .INTEGER ().getText ()))
@@ -115,7 +116,7 @@ public JNode visitPrimitiveInteger(JsonParser.PrimitiveIntegerContext ctx) {
115116
116117 @ Override
117118 public JNode visitPrimitiveFloat (JsonParser .PrimitiveFloatContext ctx ) {
118- return new JFloat . Builder ()
119+ return new JFloatBuilder ()
119120 .relations (relations )
120121 .context (new Context (ctx , runtime ))
121122 .value (Double .valueOf (ctx .FLOAT ().getText ()))
@@ -124,7 +125,7 @@ public JNode visitPrimitiveFloat(JsonParser.PrimitiveFloatContext ctx) {
124125
125126 @ Override
126127 public JNode visitPrimitiveDouble (JsonParser .PrimitiveDoubleContext ctx ) {
127- return new JDouble . Builder ()
128+ return new JDoubleBuilder ()
128129 .relations (relations )
129130 .context (new Context (ctx , runtime ))
130131 .value (Double .valueOf (ctx .DOUBLE ().getText ()))
@@ -133,7 +134,7 @@ public JNode visitPrimitiveDouble(JsonParser.PrimitiveDoubleContext ctx) {
133134
134135 @ Override
135136 public JNode visitPrimitiveNull (JsonParser .PrimitiveNullContext ctx ) {
136- return new JNull . Builder ()
137+ return new JNullBuilder ()
137138 .relations (relations )
138139 .context (new Context (ctx , runtime ))
139140 .build ();
0 commit comments