MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / simpleSerializeToMap

Method simpleSerializeToMap

src/main/java/fieldbox/io/EDN.java:243–263  ·  view source on GitHub ↗
(Tag tag, Class c)

Source from the content-addressed store, hash-verified

241
242
243 public us.bpsm.edn.printer.Printer.Fn<?> simpleSerializeToMap(Tag tag, Class c) {
244 return (o, writer) -> {
245 try {
246 Map<Object, Object> mm = new LinkedHashMap<>();
247
248 Field[] f = c.getFields();
249
250 for (Field ff : f) {
251 if (Modifier.isTransient(ff.getModifiers())) continue;
252 ff.setAccessible(true);
253 mm.put(Keyword.newKeyword(ff.getName()), ff.get(o));
254 }
255
256 writer.printValue(tag)
257 .printValue(mm);
258
259 } catch (IllegalAccessException e) {
260 e.printStackTrace();
261 }
262 };
263 }
264
265 public us.bpsm.edn.printer.Printer.Fn<?> simpleSerializeToMapWithClass(Tag tag) {
266 return (o, writer) -> {

Callers 1

EDNMethod · 0.95

Calls 3

getMethod · 0.65
putMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected