AT&T 1712 and 1802 release code
[so.git] / bpmn / MSOCoreBPMN / src / main / java / org / openecomp / mso / bpmn / core / domain / JsonWrapper.java
index dc87304..5cd078d 100644 (file)
@@ -1,3 +1,23 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
 package org.openecomp.mso.bpmn.core.domain;\r
 \r
 import java.io.IOException;\r
@@ -17,7 +37,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;\r
 \r
 import org.openecomp.mso.logger.MsoLogger;\r
-//import org.codehaus.jackson.map.SerializationConfig.Feature;\r
+//import com.fasterxml.jackson.map.SerializationFeature;\r
 \r
 \r
 /**\r
@@ -64,24 +84,18 @@ public abstract class JsonWrapper implements Serializable  {
        public JSONObject toJsonObject(){\r
 \r
         ObjectMapper mapper = new ObjectMapper();\r
-       // mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);\r
+       // mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);\r
         //mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);\r
 \r
         mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);\r
-       // mapper.enable(org.codehaus.jackson.map.DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);\r
+       // mapper.enable(com.fasterxml.jackson.map.DeserializationFeature.UNWRAP_ROOT_VALUE);\r
         JSONObject json = new JSONObject();\r
          try {\r
                        json = new JSONObject(mapper.writeValueAsString(this));\r
-               } catch (JsonGenerationException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JsonMappingException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JSONException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (IOException e) {\r
+               } catch (JSONException | IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r
-         return json; \r
+        return json;\r
        }\r
        \r
        public String listToJson(List list) {\r
@@ -91,10 +105,6 @@ public abstract class JsonWrapper implements Serializable  {
                String jsonString = "";\r
                try {\r
                        jsonString = mapper.writeValueAsString(list);\r
-               } catch (JsonGenerationException e) {\r
-                       LOGGER.debug("Exception :",e);\r
-               } catch (JsonMappingException e) {\r
-                       LOGGER.debug("Exception :",e);\r
                } catch (IOException e) {\r
                        LOGGER.debug("Exception :",e);\r
                }\r
@@ -122,6 +132,7 @@ public abstract class JsonWrapper implements Serializable  {
        /**\r
         * Returns a string representation of this object.\r
         */\r
+        @Override\r
        public String toString() {\r
                return this.toJsonString();\r
        }\r