2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
7 * Modifications Copyright © 2018 IBM
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.ccsdk.sli.plugins.yangserializers.pnserializer;
25 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
28 * Representation of leaf node in properties data tree.
30 public class LeafNode extends PropertiesNode implements LeafListHolderChild, DataNodeChild {
33 private Namespace valueNs;
34 private static final String svcLogicException = "Leaf cannot hold child nodes";
37 * Creates an instance of leaf node.
39 * @param name name of the leaf node
40 * @param namespace namespace of the leaf node
41 * @param uri uri of the leaf node
42 * @param parent parent of the leaf node
43 * @param appInfo application info
44 * @param nodeType node type
45 * @param value value of the leaf
47 public LeafNode(String name, Namespace namespace,
48 String uri, PropertiesNode parent,
49 Object appInfo, NodeType nodeType,
51 super(name, namespace, uri, parent, appInfo, nodeType);
56 * Returns value of the leaf.
58 * @return value of the leaf
60 public String value() {
65 * Sets value of the leaf.
67 * @param value value of the leaf
69 public void value(String value) {
74 * Returns value namespace.
76 * @return value namespace
78 public Namespace valueNs() {
83 * Sets value namespace.
85 * @param valueNs value namespace
87 public void valueNs(Namespace valueNs) {
88 this.valueNs = valueNs;
92 public PropertiesNode addChild(String name, Namespace namespace,
94 Object appInfo) throws SvcLogicException {
95 throw new SvcLogicException(svcLogicException);
99 public PropertiesNode addChild(String name, Namespace namespace,
100 NodeType type, String value,
102 Object appInfo) throws SvcLogicException {
103 throw new SvcLogicException(svcLogicException);
107 public PropertiesNode addChild(String index, String name,
110 Object appInfo) throws SvcLogicException {
111 throw new SvcLogicException(svcLogicException);
115 public PropertiesNode addChild(String index, String name,
117 NodeType type, String value,
119 Object appInfo) throws SvcLogicException {
120 throw new SvcLogicException("Leaf cannot hold child nodes");