2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.aai.schemagen.genxsd;
24 import java.util.TreeSet;
26 public class DeleteFootnoteSet {
27 protected Set<String> footnotes = new TreeSet<>();
28 protected String targetNode = "<NodeType>";
30 public DeleteFootnoteSet(String targetNode) {
32 this.targetNode = targetNode == null ? "" : targetNode;
35 public void add(String s) {
36 String fullnote = null;
37 if ("(1)".equals(s)) {
38 fullnote = s + " IF this " + targetNode.toUpperCase()
39 + " node is deleted, this FROM node is DELETED also";
40 } else if ("(2)".equals(s)) {
41 fullnote = s + " IF this " + targetNode.toUpperCase()
42 + " node is deleted, this TO node is DELETED also";
43 } else if ("(3)".equals(s)) {
44 fullnote = s + " IF this FROM node is deleted, this " + targetNode.toUpperCase()
46 } else if ("(4)".equals(s)) {
47 fullnote = s + " IF this TO node is deleted, this " + targetNode.toUpperCase()
49 } else if (s.contains(targetNode.toUpperCase())) {
54 footnotes.add(fullnote);
57 public String toString() {
58 StringBuilder sb = new StringBuilder();
59 if (footnotes.size() > 0)
61 sb.append(String.join("\n -", footnotes) + "\n");