blob: c79d86b20e7e60ae22751843f850c17239556db7 [file] [log] [blame]
Vinod Kumar S79a374b2016-04-30 21:09:15 +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 */
16package org.onosproject.yangutils.translator.tojava.javamodel;
17
Shankara-Huaweib7564772016-08-02 18:13:13 +053018import org.onosproject.yangutils.datamodel.javadatamodel.YangJavaLeafList;
Shankara-Huaweib7564772016-08-02 18:13:13 +053019import org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator;
Bharat saraswal2da23bf2016-08-25 15:28:39 +053020import org.onosproject.yangutils.utils.io.YangToJavaNamingConflictUtil;
Vinod Kumar S79a374b2016-04-30 21:09:15 +053021
Shankara-Huaweib7564772016-08-02 18:13:13 +053022import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfoTranslator.updateLeavesJavaQualifiedInfo;
Gaurav Agrawalbfce9342016-06-15 13:58:01 +053023import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCamelCase;
Vinod Kumar S79a374b2016-04-30 21:09:15 +053024
25/**
26 * Represents java information corresponding to the YANG leaf-list.
27 */
Shankara-Huaweib7564772016-08-02 18:13:13 +053028public class YangJavaLeafListTranslator
29 extends YangJavaLeafList
Vinod Kumar S79a374b2016-04-30 21:09:15 +053030 implements JavaLeafInfoContainer {
Bharat saraswalc2d3be12016-06-16 00:29:12 +053031
32 private static final long serialVersionUID = 806201638L;
33
Bharat saraswalc2d3be12016-06-16 00:29:12 +053034 private transient YangToJavaNamingConflictUtil conflictResolveConfig;
Vinod Kumar S79a374b2016-04-30 21:09:15 +053035
36 /**
37 * Returns a new YANG leaf object with java qualified access details.
38 */
Shankara-Huaweib7564772016-08-02 18:13:13 +053039 public YangJavaLeafListTranslator() {
Vinod Kumar S79a374b2016-04-30 21:09:15 +053040 super();
Shankara-Huaweib7564772016-08-02 18:13:13 +053041 setJavaQualifiedInfo(new JavaQualifiedTypeInfoTranslator());
Vinod Kumar S79a374b2016-04-30 21:09:15 +053042 }
43
44 @Override
45 public String getJavaName(YangToJavaNamingConflictUtil conflictResolveConfig) {
46 return getCamelCase(getName(), conflictResolveConfig);
47 }
48
49 @Override
50 public boolean isLeafList() {
51 return true;
52 }
53
54 @Override
55 public void updateJavaQualifiedInfo() {
56 updateLeavesJavaQualifiedInfo(this);
57 }
58
Bharat saraswal715d3fc2016-05-17 19:59:16 +053059 /**
60 * Returns java naming conflict resolve configurations.
61 *
62 * @return java naming conflict resolve configurations
63 */
64 @Override
65 public YangToJavaNamingConflictUtil getConflictResolveConfig() {
66 return conflictResolveConfig;
67 }
68
69 /**
70 * Sets java naming conflict resolve configurations.
71 *
72 * @param conflictResolveConfig java naming conflict resolve configurations
73 */
74 @Override
75 public void setConflictResolveConfig(YangToJavaNamingConflictUtil conflictResolveConfig) {
76 this.conflictResolveConfig = conflictResolveConfig;
77 }
Vinod Kumar S79a374b2016-04-30 21:09:15 +053078}