blob: e7b786e66997bff3f976dba259de2825474c1b6a [file] [log] [blame]
Shankara-Huaweid5823ab2016-11-22 10:14:52 +05301/*
2 * Copyright 2016-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yms.app.ych.defaultcodecs.xml;
18
19import org.dom4j.Element;
20import org.onosproject.yms.ydt.YdtContext;
21
22import java.util.Stack;
23
24/**
25 * Represents a single instance leaf node handler in YCH.
26 */
27public class XmlCodecSingleInstanceLeafHandler extends XmlCodecHandler {
28
29 @Override
30 public void setXmlValue(YdtContext ydtContext,
31 Stack<Element> elementStack) {
sonu guptaeff184b2016-11-24 12:43:49 +053032
33 if (ydtContext.getValue() != null) {
34 elementStack.peek().setText(ydtContext.getValue());
35 }
Shankara-Huaweid5823ab2016-11-22 10:14:52 +053036 }
37}