2  * ============LICENSE_START=======================================================
 
   4  * ================================================================================
 
   5  * Copyright (C) 2018 Huawei Technologies Co., Ltd. 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.ccsdk.sli.plugins.yangserializers.pnserializer;
 
  23 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 
  26  * Representation of leaf node in properties data tree.
 
  28 public class LeafNode extends PropertiesNode implements LeafListHolderChild, DataNodeChild {
 
  31     private Namespace valueNs;
 
  34      * Creates an instance of leaf node.
 
  36      * @param name name of the leaf node
 
  37      * @param namespace namespace of the leaf node
 
  38      * @param uri uri of the leaf node
 
  39      * @param parent parent of the leaf node
 
  40      * @param appInfo application info
 
  41      * @param nodeType node type
 
  42      * @param value value of the leaf
 
  44     public LeafNode(String name, Namespace namespace,
 
  45                     String uri, PropertiesNode parent,
 
  46                     Object appInfo, NodeType nodeType,
 
  48         super(name, namespace, uri, parent, appInfo, nodeType);
 
  53      * Returns value of the leaf.
 
  55      * @return value of the leaf
 
  57     public String value() {
 
  62      * Sets value of the leaf.
 
  64      * @param value value of the leaf
 
  66     public void value(String value) {
 
  71      * Returns value namespace.
 
  73      * @return value namespace
 
  75     public Namespace valueNs() {
 
  80      * Sets value namespace.
 
  82      * @param valueNs value namespace
 
  84     public void valueNs(Namespace valueNs) {
 
  85         this.valueNs = valueNs;
 
  89     public PropertiesNode addChild(String name, Namespace namespace,
 
  91                                    Object appInfo) throws SvcLogicException {
 
  92         throw new SvcLogicException("Leaf cannot hold child nodes");
 
  96     public PropertiesNode addChild(String name, Namespace namespace,
 
  97                                    NodeType type, String value,
 
  99                                    Object appInfo) throws SvcLogicException {
 
 100         throw new SvcLogicException("Leaf cannot hold child nodes");
 
 104     public PropertiesNode addChild(String index, String name,
 
 107                                    Object appInfo) throws SvcLogicException {
 
 108         throw new SvcLogicException("Leaf cannot hold child nodes");
 
 112     public PropertiesNode addChild(String index, String name,
 
 114                                    NodeType type, String value,
 
 116                                    Object appInfo) throws SvcLogicException {
 
 117         throw new SvcLogicException("Leaf cannot hold child nodes");