DataJsonNode { public List<String> getAttributes(){ ArrayList<String> result = new ArrayList<>(); Iterator<Map.Entry<String, JsonNode>> field = jsonNode.fields(); while (field.hasNext()) { Map.Entry<String, JsonNode> element = field.next(); if (element.getValue().isObject()){ result.add(element.getKey()); } if (element.getValue().isArray()){ result.add(element.getKey()); } } return result; } DataJsonNode(ObjectNode jsonNode); void removeAttribute(String name); String getDataClassName(); boolean match(String dataClassNameFullQualified); void renameAttribute(String previousAttributeName, String newAttributeName); void renameClass(Class<? extends FactoryBase<?,?>> newDataClass); DataJsonNode getChild(String attributeName); DataJsonNode getChild(String attributeName, int index); JsonNode getAttributeValue(String attribute); void setAttributeValue(String attribute, JsonNode jsonNode); V getAttributeValue(String attributeName, Class<V> valueClass, SimpleObjectMapper simpleObjectMapper); V getArrayAttributeValue(String attributeName, Class<V> valueClass, SimpleObjectMapper simpleObjectMapper, int index); String getAttributeIdValue(String attributeName); boolean isData(); List<DataJsonNode> collectChildrenFromRoot(); String getId(); D asData(Class<D> valueClass, SimpleObjectMapper simpleObjectMapper); List<String> getAttributes(); Map<String,DataJsonNode> collectChildrenMapFromRoot(); Map<String,DataJsonNode> collectChildrenMapFromRootCached(); void applyRemovedAttribute(DataStorageMetadataDictionary dataStorageMetadataDictionary); void applyRetypedAttribute(DataStorageMetadataDictionary dataStorageMetadataDictionary); void applyRemovedClasses(DataStorageMetadataDictionary dataStorageMetadataDictionary); void fixIdsDeepFromRoot(Map<String, DataJsonNode> idToChild); JsonNode getJsonNode();  }
@Test public void test_getAttributes() { ExampleDataA root = new ExampleDataA(); root.referenceAttribute.set(null); root.internal().finalise(); JsonNode jsonNode = ObjectMapperBuilder.build().writeValueAsTree(root); DataJsonNode dataJsonNode = new DataJsonNode((ObjectNode) jsonNode); Assertions.assertEquals(3,dataJsonNode.getAttributes().size()); }