@Test public void testItemDocumentToJson() { ItemDocument id = Datamodel.makeItemDocument( Datamodel.makeWikidataItemIdValue("Q42"), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), Collections.emptyMap()); String json = "{\"type\":\"item\",\"id\":\"Q42\",\"labels\":{},\"descriptions\":{},\"aliases\":{},\"claims\":{},\"sitelinks\":{}}"; JsonComparator.compareJsonStrings(json, JsonSerializer.getJsonString(id)); }
public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } JsonSerializer(OutputStream outputStream); }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } JsonSerializer(OutputStream outputStream); @Override void open(); @Override void processItemDocument(ItemDocument itemDocument); @Override void processPropertyDocument(PropertyDocument propertyDocument); @Override void processLexemeDocument(LexemeDocument lexemeDocument); @Override void processMediaInfoDocument(MediaInfoDocument mediaInfoDocument); @Override void close(); int getEntityDocumentCount(); static String getJsonString(ItemDocument itemDocument); static String getJsonString(PropertyDocument propertyDocument); static String getJsonString(MediaInfoDocument mediaInfoDocument); static String getJsonString(Statement statement); }
JsonSerializer implements EntityDocumentDumpProcessor { public static String getJsonString(ItemDocument itemDocument) { return jacksonObjectToString(itemDocument); } JsonSerializer(OutputStream outputStream); @Override void open(); @Override void processItemDocument(ItemDocument itemDocument); @Override void processPropertyDocument(PropertyDocument propertyDocument); @Override void processLexemeDocument(LexemeDocument lexemeDocument); @Override void processMediaInfoDocument(MediaInfoDocument mediaInfoDocument); @Override void close(); int getEntityDocumentCount(); static String getJsonString(ItemDocument itemDocument); static String getJsonString(PropertyDocument propertyDocument); static String getJsonString(MediaInfoDocument mediaInfoDocument); static String getJsonString(Statement statement);  }