summaryrefslogtreecommitdiff
path: root/ddl/out/java/LambdaCube/TypeInfo/JSON.java
diff options
context:
space:
mode:
Diffstat (limited to 'ddl/out/java/LambdaCube/TypeInfo/JSON.java')
-rw-r--r--ddl/out/java/LambdaCube/TypeInfo/JSON.java109
1 files changed, 93 insertions, 16 deletions
diff --git a/ddl/out/java/LambdaCube/TypeInfo/JSON.java b/ddl/out/java/LambdaCube/TypeInfo/JSON.java
index e13fa63..458656c 100644
--- a/ddl/out/java/LambdaCube/TypeInfo/JSON.java
+++ b/ddl/out/java/LambdaCube/TypeInfo/JSON.java
@@ -1,5 +1,5 @@
1// generated file, do not modify! 1// generated file, do not modify!
2// 2016-09-15T19:44:48.120020034Z 2// 2016-11-10T15:07:11.972496000000Z
3 3
4package LambdaCube.TypeInfo; 4package LambdaCube.TypeInfo;
5 5
@@ -17,23 +17,26 @@ public class JSON {
17 public enum Type { 17 public enum Type {
18 Int, 18 Int,
19 String, 19 String,
20 Array_Range, 20 Array_ErrorInfo,
21 Array_TypeInfo, 21 Array_TypeInfo,
22 Array_WarningInfo,
22 CompileResult, 23 CompileResult,
24 ErrorInfo,
23 Pipeline, 25 Pipeline,
24 Range, 26 Range,
25 TypeInfo 27 TypeInfo,
28 WarningInfo
26 } 29 }
27 30
28 public static Object fromJSON(Type type, Object rawObj) throws JSONException, Exception { 31 public static Object fromJSON(Type type, Object rawObj) throws JSONException, Exception {
29 switch (type) { 32 switch (type) {
30 case Int: return ((Number)rawObj).intValue(); 33 case Int: return ((Number)rawObj).intValue();
31 case String: return (String)rawObj; 34 case String: return (String)rawObj;
32 case Array_Range: { 35 case Array_ErrorInfo: {
33 JSONArray obj = (JSONArray)rawObj; 36 JSONArray obj = (JSONArray)rawObj;
34 ArrayList<Range> v = new ArrayList<Range> (); 37 ArrayList<ErrorInfo> v = new ArrayList<ErrorInfo> ();
35 for (int i = 0; i < obj.length(); i++) { 38 for (int i = 0; i < obj.length(); i++) {
36 v.add((Range)fromJSON (Type.Range, obj.get(i))); 39 v.add((ErrorInfo)fromJSON (Type.ErrorInfo, obj.get(i)));
37 } 40 }
38 return v; 41 return v;
39 } 42 }
@@ -45,6 +48,14 @@ public class JSON {
45 } 48 }
46 return v; 49 return v;
47 } 50 }
51 case Array_WarningInfo: {
52 JSONArray obj = (JSONArray)rawObj;
53 ArrayList<WarningInfo> v = new ArrayList<WarningInfo> ();
54 for (int i = 0; i < obj.length(); i++) {
55 v.add((WarningInfo)fromJSON (Type.WarningInfo, obj.get(i)));
56 }
57 return v;
58 }
48 59
49 case Range: { 60 case Range: {
50 JSONObject obj = (JSONObject)rawObj; 61 JSONObject obj = (JSONObject)rawObj;
@@ -74,15 +85,41 @@ public class JSON {
74 default: throw new Exception("unknown constructor: " + tag); 85 default: throw new Exception("unknown constructor: " + tag);
75 } 86 }
76 } 87 }
88 case WarningInfo: {
89 JSONObject obj = (JSONObject)rawObj;
90 String tag = obj.getString("tag");
91 switch (tag) {
92 case "WarningInfo": {
93 WarningInfo.WarningInfo_ tv = new WarningInfo().new WarningInfo_();
94 tv.wRange = (Range)fromJSON(Type.Range,obj.get("wRange"));
95 tv.wText = (String)fromJSON(Type.String,obj.get("wText"));
96 return tv;
97 }
98 default: throw new Exception("unknown constructor: " + tag);
99 }
100 }
101 case ErrorInfo: {
102 JSONObject obj = (JSONObject)rawObj;
103 String tag = obj.getString("tag");
104 switch (tag) {
105 case "ErrorInfo": {
106 ErrorInfo.ErrorInfo_ tv = new ErrorInfo().new ErrorInfo_();
107 tv.eRange = (Range)fromJSON(Type.Range,obj.get("eRange"));
108 tv.eText = (String)fromJSON(Type.String,obj.get("eText"));
109 return tv;
110 }
111 default: throw new Exception("unknown constructor: " + tag);
112 }
113 }
77 case CompileResult: { 114 case CompileResult: {
78 JSONObject obj = (JSONObject)rawObj; 115 JSONObject obj = (JSONObject)rawObj;
79 String tag = obj.getString("tag"); 116 String tag = obj.getString("tag");
80 switch (tag) { 117 switch (tag) {
81 case "CompileError": { 118 case "CompileError": {
82 CompileResult.CompileError_ tv = new CompileResult().new CompileError_(); 119 CompileResult.CompileError_ tv = new CompileResult().new CompileError_();
83 tv._0 = (ArrayList<Range>)fromJSON(Type.Array_Range,obj.get("arg0")); 120 tv._0 = (ArrayList<TypeInfo>)fromJSON(Type.Array_TypeInfo,obj.get("arg0"));
84 tv._1 = (String)fromJSON(Type.String,obj.get("arg1")); 121 tv._1 = (ArrayList<WarningInfo>)fromJSON(Type.Array_WarningInfo,obj.get("arg1"));
85 tv._2 = (ArrayList<TypeInfo>)fromJSON(Type.Array_TypeInfo,obj.get("arg2")); 122 tv._2 = (ArrayList<ErrorInfo>)fromJSON(Type.Array_ErrorInfo,obj.get("arg2"));
86 return tv; 123 return tv;
87 } 124 }
88 case "Compiled": { 125 case "Compiled": {
@@ -91,6 +128,7 @@ public class JSON {
91 tv._1 = (String)fromJSON(Type.String,obj.get("arg1")); 128 tv._1 = (String)fromJSON(Type.String,obj.get("arg1"));
92 tv._2 = (Pipeline)fromJSON(Type.Pipeline,obj.get("arg2")); 129 tv._2 = (Pipeline)fromJSON(Type.Pipeline,obj.get("arg2"));
93 tv._3 = (ArrayList<TypeInfo>)fromJSON(Type.Array_TypeInfo,obj.get("arg3")); 130 tv._3 = (ArrayList<TypeInfo>)fromJSON(Type.Array_TypeInfo,obj.get("arg3"));
131 tv._4 = (ArrayList<WarningInfo>)fromJSON(Type.Array_WarningInfo,obj.get("arg4"));
94 return tv; 132 return tv;
95 } 133 }
96 default: throw new Exception("unknown constructor: " + tag); 134 default: throw new Exception("unknown constructor: " + tag);
@@ -134,6 +172,36 @@ public class JSON {
134 } 172 }
135 return obj; 173 return obj;
136 } 174 }
175 case WarningInfo: {
176 WarningInfo v = (WarningInfo)rawObj;
177 JSONObject obj = new JSONObject();
178 switch (v.tag) {
179 case WarningInfo:
180 obj.put("tag", "WarningInfo");
181 {
182 WarningInfo.WarningInfo_ tv = (WarningInfo.WarningInfo_)v;
183 obj.put("wRange", toJSON(Type.Range,tv.wRange));
184 obj.put("wText", toJSON(Type.String,tv.wText));
185 }
186 break;
187 }
188 return obj;
189 }
190 case ErrorInfo: {
191 ErrorInfo v = (ErrorInfo)rawObj;
192 JSONObject obj = new JSONObject();
193 switch (v.tag) {
194 case ErrorInfo:
195 obj.put("tag", "ErrorInfo");
196 {
197 ErrorInfo.ErrorInfo_ tv = (ErrorInfo.ErrorInfo_)v;
198 obj.put("eRange", toJSON(Type.Range,tv.eRange));
199 obj.put("eText", toJSON(Type.String,tv.eText));
200 }
201 break;
202 }
203 return obj;
204 }
137 case CompileResult: { 205 case CompileResult: {
138 CompileResult v = (CompileResult)rawObj; 206 CompileResult v = (CompileResult)rawObj;
139 JSONObject obj = new JSONObject(); 207 JSONObject obj = new JSONObject();
@@ -142,9 +210,9 @@ public class JSON {
142 obj.put("tag", "CompileError"); 210 obj.put("tag", "CompileError");
143 { 211 {
144 CompileResult.CompileError_ tv = (CompileResult.CompileError_)v; 212 CompileResult.CompileError_ tv = (CompileResult.CompileError_)v;
145 obj.put("arg0", toJSON(Type.Array_Range,tv._0)); 213 obj.put("arg0", toJSON(Type.Array_TypeInfo,tv._0));
146 obj.put("arg1", toJSON(Type.String,tv._1)); 214 obj.put("arg1", toJSON(Type.Array_WarningInfo,tv._1));
147 obj.put("arg2", toJSON(Type.Array_TypeInfo,tv._2)); 215 obj.put("arg2", toJSON(Type.Array_ErrorInfo,tv._2));
148 } 216 }
149 break; 217 break;
150 case Compiled: 218 case Compiled:
@@ -155,6 +223,7 @@ public class JSON {
155 obj.put("arg1", toJSON(Type.String,tv._1)); 223 obj.put("arg1", toJSON(Type.String,tv._1));
156 obj.put("arg2", toJSON(Type.Pipeline,tv._2)); 224 obj.put("arg2", toJSON(Type.Pipeline,tv._2));
157 obj.put("arg3", toJSON(Type.Array_TypeInfo,tv._3)); 225 obj.put("arg3", toJSON(Type.Array_TypeInfo,tv._3));
226 obj.put("arg4", toJSON(Type.Array_WarningInfo,tv._4));
158 } 227 }
159 break; 228 break;
160 } 229 }
@@ -163,11 +232,11 @@ public class JSON {
163 232
164 case Int: { return rawObj; } 233 case Int: { return rawObj; }
165 case String: { return rawObj; } 234 case String: { return rawObj; }
166 case Array_Range: { 235 case Array_ErrorInfo: {
167 ArrayList<Range> v = (ArrayList<Range>)rawObj; 236 ArrayList<ErrorInfo> v = (ArrayList<ErrorInfo>)rawObj;
168 JSONArray obj = new JSONArray(); 237 JSONArray obj = new JSONArray();
169 for(Range i : v) { 238 for(ErrorInfo i : v) {
170 obj.put(toJSON(Type.Range,i)); 239 obj.put(toJSON(Type.ErrorInfo,i));
171 } 240 }
172 return obj; 241 return obj;
173 } 242 }
@@ -179,6 +248,14 @@ public class JSON {
179 } 248 }
180 return obj; 249 return obj;
181 } 250 }
251 case Array_WarningInfo: {
252 ArrayList<WarningInfo> v = (ArrayList<WarningInfo>)rawObj;
253 JSONArray obj = new JSONArray();
254 for(WarningInfo i : v) {
255 obj.put(toJSON(Type.WarningInfo,i));
256 }
257 return obj;
258 }
182 } 259 }
183 throw new Exception("unknown type"); 260 throw new Exception("unknown type");
184 } 261 }