@Test void testComment() { CompilationUnit cu = parse("\npublic class X{ \n String serialized = serialize(cu, false); CompilationUnit deserialized = (CompilationUnit) deserializer.deserializeObject(Json.createReader(new StringReader(serialized))); ClassOrInterfaceDeclaration classXDeclaration = deserialized.getClassByName("X").get(); assertTrue(classXDeclaration.getComment().isPresent()); Comment comment = classXDeclaration.getComment().get(); assertEquals("com.github.javaparser.ast.comments.BlockComment", comment.getClass().getName()); assertEquals(" block comment ", comment.getContent()); MethodDeclaration methodDeclaration = classXDeclaration.getMethods().get(0); assertTrue(methodDeclaration.getComment().isPresent()); assertEquals("com.github.javaparser.ast.comments.LineComment", methodDeclaration.getComment().get().getClass().getName()); assertEquals(" line comment", methodDeclaration.getComment().get().getContent()); }
public Node deserializeObject(JsonReader reader) { Log.info("Deserializing JSON to Node."); JsonObject jsonObject = reader.readObject(); return deserializeObject(jsonObject); }
JavaParserJsonDeserializer { public Node deserializeObject(JsonReader reader) { Log.info("Deserializing JSON to Node."); JsonObject jsonObject = reader.readObject(); return deserializeObject(jsonObject); } }
JavaParserJsonDeserializer { public Node deserializeObject(JsonReader reader) { Log.info("Deserializing JSON to Node."); JsonObject jsonObject = reader.readObject(); return deserializeObject(jsonObject); }  }
JavaParserJsonDeserializer { public Node deserializeObject(JsonReader reader) { Log.info("Deserializing JSON to Node."); JsonObject jsonObject = reader.readObject(); return deserializeObject(jsonObject); }  Node deserializeObject(JsonReader reader); }
JavaParserJsonDeserializer { public Node deserializeObject(JsonReader reader) { Log.info("Deserializing JSON to Node."); JsonObject jsonObject = reader.readObject(); return deserializeObject(jsonObject); }  Node deserializeObject(JsonReader reader);  }