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=========================================================
20 package org.onap.aai.util.genxsd;
23 import java.util.TreeSet;
25 public class DeleteFootnoteSet {
26 protected Set<String> footnotes = new TreeSet<>();
27 protected String targetNode = "<NodeType>";
28 public DeleteFootnoteSet(String targetNode) {
30 this.targetNode = targetNode == null ? "" : targetNode;
33 public void add(String s ) {
36 fullnote = s+" IF this "+targetNode.toUpperCase()+" node is deleted, this FROM node is DELETED also";
37 } else if("(2)".equals(s)) {
38 fullnote = s+" IF this "+targetNode.toUpperCase()+" node is deleted, this TO node is DELETED also";
39 } else if("(3)".equals(s)) {
40 fullnote = s+" IF this FROM node is deleted, this "+targetNode.toUpperCase()+" is DELETED also";
41 } else if("(4)".equals(s)) {
42 fullnote = s+" IF this TO node is deleted, this "+targetNode.toUpperCase()+" is DELETED also";
43 } else if(s.contains(targetNode.toUpperCase())) {
48 footnotes.add(fullnote);
51 public String toString() {
52 StringBuilder sb = new StringBuilder();
53 if(footnotes.size() > 0) sb.append("\n -");
54 sb.append(String.join("\n -", footnotes)+"\n");