blob: a50684712ba90cd03c1096d37034fbde26775b10 [file] [log] [blame]
Vinod Kumar S19f39c72016-02-09 20:12:31 +05301/*
2 * Copyright 2016 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.datamodel;
17
18import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
19import org.onosproject.yangutils.parser.Parsable;
20import org.onosproject.yangutils.parser.ParsableDataType;
21
22/*
23 * Reference:RFC 6020.
24 * The "include" statement is used to make content from a submodule
25 * available to that submodule's parent module, or to another submodule
26 * of that parent module. The argument is an identifier that is the
27 * name of the submodule to include.
28 * The includes's Substatements
29 *
30 * +---------------+---------+-------------+------------------+
31 * | substatement | section | cardinality |data model mapping|
32 * +---------------+---------+-------------+------------------+
33 * | revision-date | 7.1.5.1 | 0..1 | string |
34 * +---------------+---------+-------------+------------------+
35 */
36/**
37 * Maintains the information about the included sub-modules.
38 *
39 */
40public class YangInclude implements Parsable {
41
42 /**
43 * Name of the sub-module that is being included.
44 */
45 private String subModuleName;
46
47 /**
48 * The include's "revision-date" statement is used to specify the exact
49 * version of the submodule to import.
50 */
51 private String revision;
52
53 /**
54 * Default constructor.
55 */
56 public YangInclude() {
57 }
58
59 /**
60 * Get the name of included sub-module.
61 *
62 * @return the sub-module name
63 */
64 public String getSubModuleName() {
65 return subModuleName;
66 }
67
68 /**
69 * Set the name of included sub-modules.
70 *
71 * @param subModuleName the sub-module name to set
72 */
73 public void setSubModuleName(String subModuleName) {
74 this.subModuleName = subModuleName;
75 }
76
77 /**
78 * Get the revision.
79 *
80 * @return the revision
81 */
82 public String getRevision() {
83 return revision;
84 }
85
86 /**
87 * Set the revision.
88 *
89 * @param revision the revision to set
90 */
91 public void setRevision(String revision) {
92 this.revision = revision;
93 }
94
95 /**
96 * Returns the type of parsed data.
97 *
98 * @return returns INCLUDE_DATA
99 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530100 @Override
Vinod Kumar S19f39c72016-02-09 20:12:31 +0530101 public ParsableDataType getParsableDataType() {
102 return ParsableDataType.INCLUDE_DATA;
103 }
104
105 /**
106 * Validate the data on entering the corresponding parse tree node.
107 *
108 * @throws DataModelException a violation of data model rules
109 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530110 @Override
Vinod Kumar S19f39c72016-02-09 20:12:31 +0530111 public void validateDataOnEntry() throws DataModelException {
112 // TODO auto-generated method stub, to be implemented by parser
113
114 }
115
116 /**
117 * Validate the data on exiting the corresponding parse tree node.
118 *
119 * @throws DataModelException a violation of data model rules
120 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +0530121 @Override
Vinod Kumar S19f39c72016-02-09 20:12:31 +0530122 public void validateDataOnExit() throws DataModelException {
123 // TODO auto-generated method stub, to be implemented by parser
124
125 }
126
127}