JSON:
{ "data": { "formId": "118b3767-9c3b-4b1e-970b-bf5b940d4f7d", "userInput": { "otherA": "super manA", "industry": [ "K. Other Occupations" ], "educationLevel": [ "C. Tertiary or Above" ] } } }
Word
<<[TestFunc.test(data.userInput)]>>
Java program
ReportingEngine.getKnownTypes().add(TestFunc.class);
ReportingEngine.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
ReportingEngine.setUseReflectionOptimization(false);
public class TestFunc{
public static void test(Object arr)
{
ObjectMapper mapper = new ObjectMapper();
SimpleModule module = new SimpleModule();
module.addSerializer(DBNull.class, new DBNullSerializer());
mapper.registerModule(module);
// Convert the input object to a JSON string
String jsonString = mapper.writeValueAsString(arr);
System.out.println("jsonString ="+jsonString );
}
}
The printed output is:
Print.zip (487 ĺ—节)
The following was lost:
‌"industry"‌:[“K. Other Occupations”], ‌"educationLevel"‌:[“C. Tertiary or Above”]