@@ -0,0 +1,3343 @@
+package it.unibz.inf.kaos.logextractor.exp;%0A%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0A%0Aimport com.fasterxml.jackson.annotation.JsonAutoDetect;%0Aimport com.fasterxml.jackson.annotation.JsonInclude;%0Aimport com.fasterxml.jackson.annotation.PropertyAccessor;%0Aimport com.fasterxml.jackson.core.JsonGenerationException;%0Aimport com.fasterxml.jackson.databind.DeserializationFeature;%0Aimport com.fasterxml.jackson.databind.JsonMappingException;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0A%0Apublic class JSONIO %7B%0A%0A%09%0A%09//read annotation queries files%0A%09public static %3CT%3ET importJSON(File annotationFile, Class%3CT%3E cls)%7B%0A%09%09%09%09%0A        //initialize JSON-Object mapper%0A%09%09ObjectMapper mapper = new ObjectMapper();%0A        mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);%0A        //use all fields%0A        mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);%0A        //only include not null & non empty fields%0A        mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);%0A        //store type of classess also%0A        mapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.NON_FINAL, %22@class%22);%0A        //ignore unknown properties%0A        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);%0A        mapper.configure(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS, false);%0A        mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false);%0A%09%09%0A%09%09T q = null;%0A%09%09try %7B%0A%0A%09%09%09q = mapper.readValue(new FileInputStream(annotationFile), cls); //read JSON from URL%0A%09%09%09%0A%09%09%7D catch (IOException e1) %7B%0A%09%09%09e1.printStackTrace();%0A%09%09%7D%0A%0A%09%09return q;%0A%09%7D%09%0A%09%0A%09//read annotation queries files%0A%09public static %3CT%3ET importJSON(String annotationFilePath, Class%3CT%3E cls)%7B%0A%09%09%0A%09%09return importJSON(new File(annotationFilePath), cls);%0A%09%7D%09%0A%09%0A%09//export annotation queries files%0A%09public static void exportJSON(File annotationFile, Object annotationQueries) throws JsonGenerationException, JsonMappingException, IOException%7B%0A%09%09%0A%09%09System.out.println(%0A%09%09%09%09%22Exporting a %22+ annotationQueries.getClass().getCanonicalName()+ %0A%09%09%09%09%22 to %5Cn%5Cn %5C%22%22+annotationFile+%22%5C%22%22);%0A%09%09%0A        //initialize JSON-Object mapper%0A%09%09ObjectMapper mapper = new ObjectMapper();%0A        mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);%0A        //use all fields%0A        mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);%0A        //only include not null & non empty fields%0A        mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);%0A        //store type of classess also%0A        mapper.enableDefaultTypingAsProperty(ObjectMapper.DefaultTyping.NON_FINAL, %22@class%22);%0A        //ignore unknown properties%0A        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);%0A        mapper.configure(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS, false);%0A        mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false);%0A%09%09%0A%09%09mapper.writerWithDefaultPrettyPrinter().writeValue(annotationFile, annotationQueries);%0A%09%7D%0A%09%0A%09//export annotation queries files%0A%09public static void exportJSON(String annotationFilePath, Object annotationQueries) throws JsonGenerationException, JsonMappingException, IOException%7B%0A%09%09%0A%09%09exportJSON(new File(annotationFilePath), annotationQueries);%0A%09%7D%0A%09%0A%0A%7D%0A

add io for exp