@Test public void testStatementToJson() { Statement s = Datamodel.makeStatement(ItemIdValue.NULL, Datamodel.makeNoValueSnak(Datamodel.makeWikidataPropertyIdValue("P1")), Collections.emptyList(), Collections.emptyList(), StatementRank.NORMAL, "MyId"); String json = "{\"rank\":\"normal\",\"id\":\"MyId\",\"mainsnak\":{\"property\":\"P1\",\"snaktype\":\"novalue\"},\"type\":\"statement\"}"; JsonComparator.compareJsonStrings(json, JsonSerializer.getJsonString(s)); }
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);  }