X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=bpmn%2FMSOCoreBPMN%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fmso%2Fbpmn%2Fcore%2Fdomain%2FJsonWrapper.java;h=5cd078d69c45894ac6c324505ddb10f3c89bb643;hb=fc8f9218943f2ffca31b8e718db66d4639ab001d;hp=ce66e060895132357fd350c5720bbddf2d42d9a6;hpb=50e2a74626a2f216e705c72ddb3a7e7e827756f1;p=so.git diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java index ce66e06089..5cd078d69c 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/openecomp/mso/bpmn/core/domain/JsonWrapper.java @@ -37,7 +37,7 @@ import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.openecomp.mso.logger.MsoLogger; -//import org.codehaus.jackson.map.SerializationConfig.Feature; +//import com.fasterxml.jackson.map.SerializationFeature; /** @@ -84,24 +84,18 @@ public abstract class JsonWrapper implements Serializable { public JSONObject toJsonObject(){ ObjectMapper mapper = new ObjectMapper(); - // mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true); + // mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); //mapper.enable(SerializationFeature.WRAP_ROOT_VALUE); mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); - // mapper.enable(org.codehaus.jackson.map.DeserializationConfig.Feature.UNWRAP_ROOT_VALUE); + // mapper.enable(com.fasterxml.jackson.map.DeserializationFeature.UNWRAP_ROOT_VALUE); JSONObject json = new JSONObject(); try { json = new JSONObject(mapper.writeValueAsString(this)); - } catch (JsonGenerationException e) { - LOGGER.debug("Exception :",e); - } catch (JsonMappingException e) { - LOGGER.debug("Exception :",e); - } catch (JSONException e) { - LOGGER.debug("Exception :",e); - } catch (IOException e) { + } catch (JSONException | IOException e) { LOGGER.debug("Exception :",e); } - return json; + return json; } public String listToJson(List list) { @@ -111,10 +105,6 @@ public abstract class JsonWrapper implements Serializable { String jsonString = ""; try { jsonString = mapper.writeValueAsString(list); - } catch (JsonGenerationException e) { - LOGGER.debug("Exception :",e); - } catch (JsonMappingException e) { - LOGGER.debug("Exception :",e); } catch (IOException e) { LOGGER.debug("Exception :",e); } @@ -142,6 +132,7 @@ public abstract class JsonWrapper implements Serializable { /** * Returns a string representation of this object. */ + @Override public String toString() { return this.toJsonString(); }