@@ -0,0 +1,1852 @@
+package org.openlca.jsonld.input;%0A%0Aimport com.google.gson.JsonObject;%0Aimport org.openlca.core.model.FlowResult;%0Aimport org.openlca.core.model.ImpactResult;%0Aimport org.openlca.core.model.ModelType;%0Aimport org.openlca.core.model.Result;%0Aimport org.openlca.jsonld.Json;%0Aimport org.openlca.util.Strings;%0A%0Aclass ResultImport extends BaseImport%3CResult%3E %7B%0A%0A%09private ResultImport(String refId, JsonImport conf) %7B%0A%09%09super(ModelType.RESULT, refId, conf);%0A%09%7D%0A%0A%09static Result run(String refId, JsonImport conf) %7B%0A%09%09return new ResultImport(refId, conf).run();%0A%09%7D%0A%0A%09@Override%0A%09Result map(JsonObject json, long id) %7B%0A%09%09if (json == null)%0A%09%09%09return null;%0A%09%09var result = new Result();%0A%09%09In.mapAtts(json, result, id, conf);%0A%09%09result.urn = Json.getString(json, %22urn%22);%0A%09%09var methodId = Json.getRefId(json, %22impactMethod%22);%0A%09%09if (Strings.notEmpty(methodId)) %7B%0A%09%09%09result.impactMethod = ImpactMethodImport.run(refId, conf);%0A%09%09%7D%0A%09%09readImpactResults(json, result);%0A%0A%09%09return result;%0A%0A%09%7D%0A%0A%09private void readImpactResults(JsonObject json, Result result) %7B%0A%09%09var array = Json.getArray(json, %22impactResults%22);%0A%09%09if (array == null)%0A%09%09%09return;%0A%09%09for (var e : array) %7B%0A%09%09%09if (!e.isJsonObject())%0A%09%09%09%09continue;%0A%09%09%09var obj = e.getAsJsonObject();%0A%09%09%09var r = new ImpactResult();%0A%09%09%09var impactId = Json.getRefId(obj, %22indicator%22);%0A%09%09%09if (Strings.notEmpty(impactId)) %7B%0A%09%09%09%09r.indicator = ImpactCategoryImport.run(impactId, conf);%0A%09%09%09%7D%0A%09%09%09r.amount = Json.getDouble(obj, %22amount%22, 0);%0A%09%09%09r.description = Json.getString(obj, %22description%22);%0A%09%09%09result.impactResults.add(r);%0A%09%09%7D%0A%09%7D%0A%0A%09private void readFlowResults(JsonObject json, Result result) %7B%0A%09%09var array = Json.getArray(json, %22flowResults%22);%0A%09%09if (array == null)%0A%09%09%09return;%0A%09%09for (var e : array) %7B%0A%09%09%09if (!e.isJsonObject())%0A%09%09%09%09continue;%0A%09%09%09var obj = e.getAsJsonObject();%0A%09%09%09var r = new FlowResult();%0A%09%09%09result.flowResults.add(r);%0A%0A%0A%09%09%7D%0A%09%7D%0A%7D%0A

prepare the ResultImport