summaryrefslogtreecommitdiffstats
path: root/tools/model-generator/src/main
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-02-07 17:56:44 +0000
committerliamfallon <liam.fallon@est.tech>2022-02-08 18:39:03 +0000
commit59b90519eda3b95b0cfc49b6349a591c7d0c78e2 (patch)
tree810e07f7d5cf270582264c40245372f597c713a2 /tools/model-generator/src/main
parentdef44b294fa00bb5470e977eef9a05e5087035f0 (diff)
Remove JAXB and XML, use GSON for JSON
This review converst apex-pdp to use GSON for JSON handling. In order to preserve backward compatibility with the JAXB format of JSON, custom handling of maps was required. Therefore, the policy-common StandardCoder could not be used. There are a lot of small changes, removing annotations from concepts and tweaking of test data. However, this cleans up the code base so it is worth doing. Issue-ID: POLICY-1820 Change-Id: I213fa64f6d7f3f1df8d10f111d9fbedbe80f9fe0 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'tools/model-generator/src/main')
-rw-r--r--tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java3
-rw-r--r--tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java4
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java
index bd5b83518..d43e7cdbb 100644
--- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java
+++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2cli/Model2Cli.java
@@ -4,6 +4,7 @@
* Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2022 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -117,7 +118,7 @@ public class Model2Cli {
final CodeGeneratorCliEditor codeGen = new CodeGeneratorCliEditor();
final ApexModelFactory factory = new ApexModelFactory();
- final ApexModel model = factory.createApexModel(new Properties(), true);
+ final ApexModel model = factory.createApexModel(new Properties());
final ApexApiResult result = model.loadFromFile(modelFile);
if (result.isNok()) {
diff --git a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java
index ad0f3b613..d9daee5ca 100644
--- a/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java
+++ b/tools/model-generator/src/main/java/org/onap/policy/apex/tools/model/generator/model2event/Model2JsonEventSchema.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2021 Nordix Foundation.
+ * Modifications Copyright (C) 2021,2022 Nordix Foundation.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -190,7 +190,7 @@ public class Model2JsonEventSchema {
final ST stEvents = stg.getInstanceOf("events");
final ApexModelFactory factory = new ApexModelFactory();
- final ApexModel model = factory.createApexModel(new Properties(), true);
+ final ApexModel model = factory.createApexModel(new Properties());
final ApexApiResult result = model.loadFromFile(modelFile);
if (result.isNok()) {