JsonObject (AbstractCodeStylePropertyMapper src) { JsonObject o = new JsonObject(); for (String name : src.enumProperties()) { CodeStylePropertyAccessor accessor = src.getAccessor(name); if (accessor != null) { Object externalized = accessor.get(); if (externalized instanceof String) { o.addProperty(name, (String)externalized); } else if (externalized instanceof Integer) { o.addProperty(name, (Integer)externalized); } else if (externalized instanceof Boolean) { o.addProperty(name, (Boolean)externalized); } else if (externalized instanceof List) { final JsonArray array = new JsonArray(); for (Object element : (List)externalized) { if (element instanceof String) { array.add((String)element); } else if (element instanceof Integer) { array.add((Integer)element); } } o.add(name, array); } } } return o; }