Example #1
0
 public JobContext deserialize(
     JsonElement jejson, Type typeOfT, JsonDeserializationContext context)
     throws JsonParseException {
   try {
     JsonObject json = jejson.getAsJsonObject();
     String context_class = json.get("classname").getAsString();
     JobContext result = AppManager.instanceClassForName(context_class, JobContext.class);
     result.contextFromJson(json.getAsJsonObject("content"));
     result.neededstorages =
         AppManager.getGson().fromJson(json.get("neededstorages"), type_String_AL);
     result.hookednames = AppManager.getGson().fromJson(json.get("hookednames"), type_String_AL);
     return result;
   } catch (Exception e) {
     Loggers.Manager.error("Can't deserialize json source:\t" + jejson.toString(), e);
     throw new JsonParseException("Invalid context class: " + jejson.toString(), e);
   }
 }