Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | 0f7908b | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 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 | package org.onosproject.yangutils.datamodel; |
| 17 | |
| 18 | import java.util.LinkedList; |
| 19 | import java.util.List; |
| 20 | |
| 21 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
| 22 | import org.onosproject.yangutils.parser.Parsable; |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 23 | import org.onosproject.yangutils.utils.YangConstructType; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 24 | |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 25 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil; |
| 26 | |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 27 | /*- |
| 28 | * Reference RFC 6020. |
| 29 | * |
| 30 | * The "augment" statement allows a module or submodule to add to the |
| 31 | * schema tree defined in an external module, or the current module and |
| 32 | * its submodules, and to add to the nodes from a grouping in a "uses" |
| 33 | * statement. The argument is a string that identifies a node in the |
| 34 | * schema tree. This node is called the augment's target node. The |
| 35 | * target node MUST be either a container, list, choice, case, input, |
| 36 | * output, or notification node. It is augmented with the nodes defined |
| 37 | * in the sub-statements that follow the "augment" statement. |
| 38 | * |
| 39 | * The argument string is a schema node identifier. |
| 40 | * If the "augment" statement is on the top level in a module or |
| 41 | * submodule, the absolute form of a schema node identifier |
| 42 | * MUST be used. If the "augment" statement is a sub-statement to the |
| 43 | * "uses" statement, the descendant form MUST be used. |
| 44 | * |
| 45 | * If the target node is a container, list, case, input, output, or |
| 46 | * notification node, the "container", "leaf", "list", "leaf-list", |
| 47 | * "uses", and "choice" statements can be used within the "augment" |
| 48 | * statement. |
| 49 | * |
| 50 | * If the target node is a choice node, the "case" statement, or a case |
| 51 | * shorthand statement can be used within the "augment" statement. |
| 52 | * |
| 53 | * If the target node is in another module, then nodes added by the |
| 54 | * augmentation MUST NOT be mandatory nodes. |
| 55 | * |
| 56 | * The "augment" statement MUST NOT add multiple nodes with the same |
| 57 | * name from the same module to the target node. |
| 58 | * The augment's sub-statements |
| 59 | * |
| 60 | * +--------------+---------+-------------+------------------+ |
| 61 | * | substatement | section | cardinality |data model mapping| |
| 62 | * +--------------+---------+-------------+------------------+ |
| 63 | * | anyxml | 7.10 | 0..n |-not supported | |
| 64 | * | case | 7.9.2 | 0..n |-child nodes | |
| 65 | * | choice | 7.9 | 0..n |-child nodes | |
| 66 | * | container | 7.5 | 0..n |-child nodes | |
| 67 | * | description | 7.19.3 | 0..1 |-string | |
| 68 | * | if-feature | 7.18.2 | 0..n |-TODO | |
| 69 | * | leaf | 7.6 | 0..n |-YangLeaf | |
| 70 | * | leaf-list | 7.7 | 0..n |-YangLeafList | |
| 71 | * | list | 7.8 | 0..n |-child nodes | |
| 72 | * | reference | 7.19.4 | 0..1 |-String | |
| 73 | * | status | 7.19.2 | 0..1 |-YangStatus | |
| 74 | * | uses | 7.12 | 0..n |-child nodes | |
| 75 | * | when | 7.19.5 | 0..1 |-TODO | |
| 76 | * +--------------+---------+-------------+------------------+ |
| 77 | */ |
| 78 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 79 | * Representation of data model node to maintain information defined in YANG augment. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 80 | */ |
Vinod Kumar S | 9f26ae5 | 2016-03-23 15:30:27 +0530 | [diff] [blame] | 81 | public class YangAugment extends YangNode |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 82 | implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 83 | |
| 84 | /** |
| 85 | * Augment target node. |
| 86 | */ |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 87 | private String name; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 88 | |
| 89 | /** |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 90 | * Description of augment. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 91 | */ |
| 92 | private String description; |
| 93 | |
| 94 | /** |
| 95 | * List of leaves. |
| 96 | */ |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 97 | private List<YangLeaf> listOfLeaf; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 98 | |
| 99 | /** |
| 100 | * List of leaf-lists. |
| 101 | */ |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 102 | private List<YangLeafList> listOfLeafList; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 103 | |
| 104 | /** |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 105 | * List of node identifiers. |
| 106 | */ |
| 107 | private List<YangNodeIdentifier> targetNode; |
| 108 | |
| 109 | /** |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 110 | * Reference of the YANG augment. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 111 | */ |
| 112 | private String reference; |
| 113 | |
| 114 | /** |
| 115 | * Status of the node. |
| 116 | */ |
| 117 | private YangStatusType status; |
| 118 | |
| 119 | /** |
| 120 | * Create a YANG augment node. |
| 121 | */ |
| 122 | public YangAugment() { |
| 123 | super(YangNodeType.AUGMENT_NODE); |
| 124 | } |
| 125 | |
| 126 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 127 | * Returns the augmented node. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 128 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 129 | * @return the augmented node |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 130 | */ |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 131 | public List<YangNodeIdentifier> getTargetNode() { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 132 | return targetNode; |
| 133 | } |
| 134 | |
| 135 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 136 | * Sets the augmented node. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 137 | * |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 138 | * @param nodeIdentifiers the augmented node |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 139 | */ |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 140 | public void setTargetNode(List<YangNodeIdentifier> nodeIdentifiers) { |
| 141 | this.targetNode = nodeIdentifiers; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 145 | * Returns the description. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 146 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 147 | * @return the description |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 148 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 149 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 150 | public String getDescription() { |
| 151 | return description; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Set the description. |
| 156 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 157 | * @param description set the description |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 158 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 159 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 160 | public void setDescription(String description) { |
| 161 | this.description = description; |
| 162 | } |
| 163 | |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 164 | @Override |
| 165 | public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException { |
| 166 | // Detect colliding child. |
| 167 | detectCollidingChildUtil(identifierName, dataType, this); |
| 168 | } |
| 169 | |
| 170 | @Override |
| 171 | public void detectSelfCollision(String identifierName, YangConstructType dataType) throws DataModelException { |
| 172 | if (this.getName().equals(identifierName)) { |
| 173 | throw new DataModelException("YANG file error: Duplicate input identifier detected, same as input \"" |
| 174 | + this.getName() + "\""); |
| 175 | } |
| 176 | } |
| 177 | |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 178 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 179 | * Returns the list of leaves. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 180 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 181 | * @return the list of leaves |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 182 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 183 | @Override |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 184 | public List<YangLeaf> getListOfLeaf() { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 185 | return listOfLeaf; |
| 186 | } |
| 187 | |
| 188 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 189 | * Sets the list of leaves. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 190 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 191 | * @param leafsList the list of leaf to set |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 192 | */ |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 193 | private void setListOfLeaf(List<YangLeaf> leafsList) { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 194 | listOfLeaf = leafsList; |
| 195 | } |
| 196 | |
| 197 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 198 | * Adds a leaf. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 199 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 200 | * @param leaf the leaf to be added |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 201 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 202 | @Override |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 203 | public void addLeaf(YangLeaf leaf) { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 204 | if (getListOfLeaf() == null) { |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 205 | setListOfLeaf(new LinkedList<YangLeaf>()); |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | getListOfLeaf().add(leaf); |
| 209 | } |
| 210 | |
| 211 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 212 | * Returns the list of leaf-list. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 213 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 214 | * @return the list of leaf-list |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 215 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 216 | @Override |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 217 | public List<YangLeafList> getListOfLeafList() { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 218 | return listOfLeafList; |
| 219 | } |
| 220 | |
| 221 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 222 | * Sets the list of leaf-list. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 223 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 224 | * @param listOfLeafList the list of leaf-list to set |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 225 | */ |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 226 | private void setListOfLeafList(List<YangLeafList> listOfLeafList) { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 227 | this.listOfLeafList = listOfLeafList; |
| 228 | } |
| 229 | |
| 230 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 231 | * Adds a leaf-list. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 232 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 233 | * @param leafList the leaf-list to be added |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 234 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 235 | @Override |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 236 | public void addLeafList(YangLeafList leafList) { |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 237 | if (getListOfLeafList() == null) { |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 238 | setListOfLeafList(new LinkedList<YangLeafList>()); |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | getListOfLeafList().add(leafList); |
| 242 | } |
| 243 | |
| 244 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 245 | * Returns the textual reference. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 246 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 247 | * @return the reference |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 248 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 249 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 250 | public String getReference() { |
| 251 | return reference; |
| 252 | } |
| 253 | |
| 254 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 255 | * Sets the textual reference. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 256 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 257 | * @param reference the reference to set |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 258 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 259 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 260 | public void setReference(String reference) { |
| 261 | this.reference = reference; |
| 262 | } |
| 263 | |
| 264 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 265 | * Returns the status. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 266 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 267 | * @return the status |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 268 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 269 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 270 | public YangStatusType getStatus() { |
| 271 | return status; |
| 272 | } |
| 273 | |
| 274 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 275 | * Sets the status. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 276 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 277 | * @param status the status to set |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 278 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 279 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 280 | public void setStatus(YangStatusType status) { |
| 281 | this.status = status; |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * Returns the type of the data as belongs-to. |
| 286 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 287 | * @return returns AUGMENT_DATA |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 288 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 289 | @Override |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 290 | public YangConstructType getYangConstructType() { |
| 291 | return YangConstructType.AUGMENT_DATA; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 292 | } |
| 293 | |
| 294 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 295 | * Validates the data on entering the corresponding parse tree node. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 296 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 297 | * @throws DataModelException a violation of data model rules |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 298 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 299 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 300 | public void validateDataOnEntry() throws DataModelException { |
| 301 | // TODO auto-generated method stub, to be implemented by parser |
| 302 | } |
| 303 | |
| 304 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 305 | * Validates the data on exiting the corresponding parse tree node. |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 306 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 307 | * @throws DataModelException a violation of data model rules |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 308 | */ |
Bharat saraswal | 9745996 | 2016-02-20 21:57:16 +0530 | [diff] [blame] | 309 | @Override |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 310 | public void validateDataOnExit() throws DataModelException { |
| 311 | // TODO auto-generated method stub, to be implemented by parser |
| 312 | } |
| 313 | |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 314 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 315 | * Returns the target nodes name where the augmentation is being done. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 316 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 317 | * @return target nodes name where the augmentation is being done |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 318 | */ |
| 319 | @Override |
| 320 | public String getName() { |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 321 | return name; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 322 | } |
| 323 | |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 324 | /** |
Bharat saraswal | 63f26fb | 2016-04-05 15:13:44 +0530 | [diff] [blame^] | 325 | * Sets the target nodes name where the augmentation is being done. |
Vinod Kumar S | c26bf19 | 2016-02-23 22:36:57 +0530 | [diff] [blame] | 326 | * |
Gaurav Agrawal | db828bd | 2016-02-27 03:57:50 +0530 | [diff] [blame] | 327 | * @param name target nodes name where the augmentation is being done |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 328 | */ |
| 329 | @Override |
| 330 | public void setName(String name) { |
Vidyashree Rama | e2bd9ba | 2016-03-29 14:37:02 +0530 | [diff] [blame] | 331 | this.name = name; |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 332 | } |
| 333 | |
Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 334 | } |