X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sparkybe-onap-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fsparky%2Fviewandinspect%2Fservices%2FBaseVisualizationContext.java;h=5dd5aca20901ecab493a0d74b134b9793a96a260;hb=010ec08bb7207a2956217e13d3e39b68f5609bd3;hp=21f7fdd95d828fb0d7a2a41c82585bfb99e4b17b;hpb=f42670da77dabfb638c6b180ac7133ec869ecc69;p=aai%2Fsparky-be.git diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java index 21f7fdd..5dd5aca 100644 --- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/viewandinspect/services/BaseVisualizationContext.java @@ -538,38 +538,15 @@ public class BaseVisualizationContext implements VisualizationContext { JsonNode nodeValue = field.getValue(); - if (nodeValue != null && nodeValue.isValueNode()) { - - if (oxmEntityLookup.getEntityDescriptors().get(fieldName) == null) { - - /* - * entity property name is not an entity, thus we can add this property name and value - * to our property set - */ - - ain.addProperty(fieldName, nodeValue.asText()); - - } - - } else { - - if (nodeValue.isArray()) { - - if (oxmEntityLookup.getEntityDescriptors().get(fieldName) == null) { - - /* - * entity property name is not an entity, thus we can add this property name and value - * to our property set - */ - - ain.addProperty(field.getKey(), nodeValue.toString()); - - } - + if(nodeValue!=null) { + if (nodeValue.isValueNode()) { + String key = fieldName; + handleNodeValue(ain, fieldName, key, nodeValue.asText()); + } else if (nodeValue.isArray()) { + String key = field.getKey(); + handleNodeValue(ain, fieldName, key, nodeValue.toString()); } else { - - ain.addComplexGroup(nodeValue); - + ain.addComplexGroup(nodeValue); } } @@ -628,6 +605,19 @@ public class BaseVisualizationContext implements VisualizationContext { } + private void handleNodeValue(ActiveInventoryNode ain, String fieldName, String key, String value) { + if (oxmEntityLookup.getEntityDescriptors().get(fieldName) == null) { + + /* + * entity property name is not an entity, thus we can add this property name and value + * to our property set + */ + + ain.addProperty(key, value); + + } + } + /** * Perform self link resolve. * @@ -826,7 +816,6 @@ public class BaseVisualizationContext implements VisualizationContext { /** * Process current node states. * - * @param rootNodeDiscovered the root node discovered */ private void processCurrentNodeStates(QueryParams queryParams) { /*