blob: ac2d6b3163544957fa81cf04147057a4f0e12dce [file] [log] [blame]
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +05303 *
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.yangutils.datamodel;
18
19import java.util.Stack;
20import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
21
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053022import static org.onosproject.yangutils.datamodel.ResolvableStatus.INTRA_FILE_RESOLVED;
23import static org.onosproject.yangutils.datamodel.ResolvableStatus.LINKED;
24import static org.onosproject.yangutils.datamodel.ResolvableStatus.RESOLVED;
25import static org.onosproject.yangutils.datamodel.ResolvableStatus.UNRESOLVED;
26
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053027/**
Bharat saraswald9822e92016-04-05 15:13:44 +053028 * Represents resolution object which will be resolved by linker.
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053029 *
30 * @param <T> type of resolution entity uses / type
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053031 */
Gaurav Agrawalcfa1c412016-05-03 00:41:48 +053032public class YangResolutionInfo<T> implements LocationInfo {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053033
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053034 /**
35 * Information about the entity that needs to be resolved.
36 */
37 private YangEntityToResolveInfo<T> entityToResolveInfo;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053038
39 // Error Line number.
40 private int lineNumber;
41
42 // Error character position.
43 private int charPosition;
44
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053045 /*
Bharat saraswald9822e92016-04-05 15:13:44 +053046 * Stack for type/uses is maintained for hierarchical references, this is
47 * used during resolution.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053048 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053049 private Stack<YangEntityToResolveInfo<T>> partialResolvedStack;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053050
51 // Module/Sub-module prefix.
52 private String resolutionInfoRootNodePrefix;
53
54 /**
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053055 * It is private to ensure the overloaded method be invoked to create an
56 * object.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053057 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053058 @SuppressWarnings("unused")
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053059 private YangResolutionInfo() {
60
61 }
62
63 /**
64 * Creates a resolution information object with all the inputs.
65 *
Gaurav Agrawalcfa1c412016-05-03 00:41:48 +053066 * @param dataNode current parsable data node
67 * @param holderNode parent YANG node
68 * @param lineNumber error line number
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053069 * @param charPositionInLine error character position in line
70 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053071 public YangResolutionInfo(T dataNode, YangNode holderNode, int lineNumber, int charPositionInLine) {
72 setEntityToResolveInfo(new YangEntityToResolveInfo<T>());
73 getEntityToResolveInfo().setEntityToResolve(dataNode);
74 getEntityToResolveInfo().setHolderOfEntityToResolve(holderNode);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053075 this.setLineNumber(lineNumber);
76 this.setCharPosition(charPositionInLine);
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053077 setPartialResolvedStack(new Stack<YangEntityToResolveInfo<T>>());
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053078 }
79
80 /**
81 * Resolve linking with all the ancestors node for a resolution info.
82 *
83 * @param resolutionInfoNodePrefix module/sub-module prefix
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053084 * @throws DataModelException DataModelException a violation of data model
85 * rules
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053086 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053087 public void resolveLinkingForResolutionInfo(String resolutionInfoNodePrefix)
88 throws DataModelException {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053089
90 this.resolutionInfoRootNodePrefix = resolutionInfoNodePrefix;
91
92 // Current node to resolve, it can be a YANG type or YANG uses.
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053093 T entityToResolve = getEntityToResolveInfo().getEntityToResolve();
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +053094
95 // Check if linking is already done
96 if (entityToResolve instanceof Resolvable) {
97 Resolvable resolvable = (Resolvable) entityToResolve;
Vinod Kumar Sd4deb062016-04-15 18:08:57 +053098 if (resolvable.getResolvableStatus() == RESOLVED) {
99 /**
100 * entity is already resolved, so nothing to do
101 */
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530102 return;
103 }
104 } else {
105 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
106 }
107
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530108 // Push the initial entity to resolve in stack.
109 addInPartialResolvedStack(getEntityToResolveInfo());
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530110
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530111 linkAndResolvePartialResolvedStack();
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530112 }
113
114 /**
115 * Resolves linking with ancestors.
116 *
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530117 * @throws DataModelException a violation of data model rules
118 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530119 private void linkAndResolvePartialResolvedStack()
120 throws DataModelException {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530121
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530122 while (getPartialResolvedStack().size() != 0) {
123
124 // Current node to resolve, it can be a YANG type or YANG uses.
125 T entityToResolve = getCurrentEntityToResolveFromStack();
126 // Check if linking is already done
127 if (entityToResolve instanceof Resolvable) {
128
129 Resolvable resolvable = (Resolvable) entityToResolve;
130 switch (resolvable.getResolvableStatus()) {
131 case RESOLVED: {
132 /*
133 * If the entity is already resolved in the stack, then
134 * pop it and continue with the remaining stack elements
135 * to resolve
136 */
137 getPartialResolvedStack().pop();
138 break;
139 }
140
141 case LINKED: {
142 /*
143 * If the top of the stack is already linked then
144 * resolve the references and pop the entity and
145 * continue with remaining stack elements to resolve
146 */
147 resolveTopOfStack();
148 getPartialResolvedStack().pop();
149 break;
150 }
151
152 case INTRA_FILE_RESOLVED: {
153 /*
154 * TODO: this needs to be deleted, when inter-file
155 * resolution is implmeneted
156 */
157 getPartialResolvedStack().pop();
158 break;
159 }
160
161 case UNRESOLVED: {
162 linkTopOfStackReferenceUpdateStack();
163
164 if (resolvable.getResolvableStatus() == UNRESOLVED) {
165 // If current entity is still not resolved, then linking/resolution has failed.
166 DataModelException dataModelException =
167 new DataModelException("YANG file error: Unable to find base "
168 + "typedef/grouping for given type/uses");
169 dataModelException.setLine(getLineNumber());
170 dataModelException.setCharPosition(getCharPosition());
171 throw dataModelException;
172 }
173 break;
174 }
175 default: {
176 throw new DataModelException("Data Model Exception: Unsupported, linker state");
177 }
178
179 }
180
181 } else {
182 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530183 }
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530184
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530185 }
186
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530187 }
188
189 /**
190 * Resolve the current entity in the stack.
191 */
Vinod Kumar S427d2932016-04-20 13:02:58 +0530192 private void resolveTopOfStack()
193 throws DataModelException {
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530194 ((Resolvable) getCurrentEntityToResolveFromStack()).resolve();
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530195 if (((Resolvable) getCurrentEntityToResolveFromStack()).getResolvableStatus()
196 != INTRA_FILE_RESOLVED) {
197 // Sets the resolution status in inside the type/uses.
198 ((Resolvable) getCurrentEntityToResolveFromStack()).setResolvableStatus(RESOLVED);
199 }
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530200 }
201
202 /**
203 * Resolves linking for a node child and siblings.
204 *
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530205 * @throws DataModelException data model error
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530206 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530207 private void linkTopOfStackReferenceUpdateStack()
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530208 throws DataModelException {
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530209
210 if (!isSelfFileReference()) {
211 /*
212 * TODO: use mojo utilities to load the referred module/sub-module
213 * and get the reference to the corresponding referred entity
214 */
215
216 ((Resolvable) getCurrentEntityToResolveFromStack()).setResolvableStatus(INTRA_FILE_RESOLVED);
217 return;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530218 }
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530219
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530220 /**
221 * Try to resolve the top of the stack and update partial resolved stack
222 * if there is recursive references
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530223 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530224 YangNode potentialAncestorWithReferredNode = getPartialResolvedStack().peek()
225 .getHolderOfEntityToResolve();
226
227 /**
228 * Traverse up in the ancestor tree to check if the referred node is
229 * defined
230 */
231 while (potentialAncestorWithReferredNode != null) {
232
233 /**
234 * Check for the referred node defined in a ancestor scope
235 */
236 YangNode potentialReferredNode = potentialAncestorWithReferredNode.getChild();
237 if (isReferredNodeInSiblingListProcessed(potentialReferredNode)) {
238 return;
239 }
240
241 potentialAncestorWithReferredNode = potentialAncestorWithReferredNode.getParent();
242 }
243 }
244
245 /**
246 * Check if the reference in self file or in external file.
247 *
248 * @return true if self file reference, false otherwise
249 * @throws DataModelException a violation of data model rules
250 */
251 private boolean isSelfFileReference()
252 throws DataModelException {
253 String prefix;
254 if (getCurrentEntityToResolveFromStack() instanceof YangType) {
255 prefix = ((YangType<?>) getCurrentEntityToResolveFromStack()).getPrefix();
256 } else if (getCurrentEntityToResolveFromStack() instanceof YangUses) {
257 prefix = ((YangUses) getCurrentEntityToResolveFromStack()).getPrefix();
258 } else {
259 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
260 }
261
262 if (prefix == null) {
263 return true;
264 }
265 return prefix.contentEquals(resolutionInfoRootNodePrefix);
266
267 }
268
269 /**
270 * Check for the referred node defined in a ancestor scope.
271 *
272 * @param potentialReferredNode potential referred node
273 * @return status of resolution and updating the partial resolved stack with
274 * the any recursive references
275 * @throws DataModelException data model errors
276 */
277 private boolean isReferredNodeInSiblingListProcessed(YangNode potentialReferredNode)
278 throws DataModelException {
279 while (potentialReferredNode != null) {
280
281 // Check if the potential referred node is the actual referred node
282 if (isReferredNode(potentialReferredNode)) {
283
284 // Adds reference link of entity to the node under resolution.
285 addReferredEntityLink(potentialReferredNode);
286
287 /**
288 * resolve the reference and update the partial resolution stack
289 * with any further recursive references
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530290 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530291 addUnresolvedRecursiveReferenceToStack(potentialReferredNode);
292
293 /*
294 * return true, since the reference is linked and any recursive
295 * unresolved references is added to the stack
296 */
297 return true;
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530298 }
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530299
300 potentialReferredNode = potentialReferredNode.getNextSibling();
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530301 }
302 return false;
303 }
304
305 /**
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530306 * Check if the potential referred node is the actual referred node.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530307 *
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530308 * @param potentialReferredNode typedef/grouping node
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530309 * @return true if node is of resolve type otherwise false
310 * @throws DataModelException a violation of data model rules
311 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530312 private boolean isReferredNode(YangNode potentialReferredNode)
313 throws DataModelException {
314 if (getCurrentEntityToResolveFromStack() instanceof YangType) {
315 if (potentialReferredNode instanceof YangTypeDef) {
316 /*
317 * Check if name of node name matches with the entity being
318 * resolved
319 */
320 return isNodeNameSameAsResolutionInfoName(potentialReferredNode);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530321 }
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530322 } else if (getCurrentEntityToResolveFromStack() instanceof YangUses) {
323 if (potentialReferredNode instanceof YangGrouping) {
324 /*
325 * Check if name of node name matches with the entity being
326 * resolved
327 */
328 return isNodeNameSameAsResolutionInfoName(potentialReferredNode);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530329 }
330 } else {
331 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
332 }
333 return false;
334 }
335
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530336 /**
337 * Check if node name is same as name in resolution info, i.e. name of
338 * typedef/grouping is same as name of type/uses.
339 *
340 * @param node typedef/grouping node
341 * @return true if node name is same as name in resolution info, otherwise
342 * false
343 * @throws DataModelException a violation of data model rules
344 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530345
346 private boolean isNodeNameSameAsResolutionInfoName(YangNode node)
347 throws DataModelException {
348 if (getCurrentEntityToResolveFromStack() instanceof YangType) {
349 if (node.getName().contentEquals(
350 ((YangType<?>) getCurrentEntityToResolveFromStack())
351 .getDataTypeName())) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530352 return true;
353 }
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530354 } else if (getCurrentEntityToResolveFromStack() instanceof YangUses) {
355 if (node.getName().contentEquals(
356 ((YangUses) getCurrentEntityToResolveFromStack()).getName())) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530357 return true;
358 }
359 } else {
360 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
361 }
362 return false;
363 }
364
365 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530366 * Adds reference of grouping/typedef in uses/type.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530367 *
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530368 * @param referredNode grouping/typedef node being referred
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530369 * @throws DataModelException a violation of data model rules
370 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530371 private void addReferredEntityLink(YangNode referredNode)
372 throws DataModelException {
373 if (getCurrentEntityToResolveFromStack() instanceof YangType) {
374 YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>)
375 ((YangType<?>) getCurrentEntityToResolveFromStack()).getDataTypeExtendedInfo();
376 derivedInfo.setReferredTypeDef((YangTypeDef) referredNode);
377 } else if (getCurrentEntityToResolveFromStack() instanceof YangUses) {
378 ((YangUses) getCurrentEntityToResolveFromStack())
379 .setRefGroup((YangGrouping) referredNode);
380 } else {
381 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
382 }
383
384 // Sets the resolution status in inside the type/uses.
385 ((Resolvable) getCurrentEntityToResolveFromStack()).setResolvableStatus(LINKED);
386 }
387
388 /**
389 * Checks if type/grouping has further reference to typedef/ unresolved
390 * uses. Add it to the partial resolve stack and return the status of
391 * addition to stack.
392 *
393 * @param referredNode grouping/typedef node
394 * @throws DataModelException a violation of data model rules
395 */
396 private void addUnresolvedRecursiveReferenceToStack(YangNode referredNode)
397 throws DataModelException {
398 if (getCurrentEntityToResolveFromStack() instanceof YangType) {
399 /*
400 * Checks if typedef type is derived
401 */
402 if (((YangTypeDef) referredNode).getTypeDefBaseType().getDataType()
403 == YangDataTypes.DERIVED) {
404
405 YangEntityToResolveInfo<YangType<?>> unResolvedEntityInfo = new YangEntityToResolveInfo<YangType<?>>();
406 unResolvedEntityInfo.setEntityToResolve(((YangTypeDef) referredNode)
407 .getTypeDefBaseType());
408 unResolvedEntityInfo.setHolderOfEntityToResolve(referredNode);
409 addInPartialResolvedStack((YangEntityToResolveInfo<T>) unResolvedEntityInfo);
410 }
411
412 } else if (getCurrentEntityToResolveFromStack() instanceof YangUses) {
413 /*
414 * Search if the grouping has any un resolved uses child, if so
415 * return true, else return false.
416 */
417 addUnResolvedUsesToStack(referredNode);
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530418 } else {
419 throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
420 }
421 }
422
423 /**
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530424 * Return if there is any unresolved uses in grouping.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530425 *
426 * @param node grouping/typedef node
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530427 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530428 private void addUnResolvedUsesToStack(YangNode node) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530429
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530430 /**
431 * Search the grouping node's children for presence of uses node.
432 */
433 YangNode curNode = node.getChild();
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530434 while (curNode != null) {
435 if (curNode instanceof YangUses) {
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530436 ResolvableStatus curResolveStatus = ((Resolvable) curNode).getResolvableStatus();
437 if (curResolveStatus == UNRESOLVED) {
438 /**
439 * The current uses is not resolved, add it to partial
440 * resolved stack
441 */
442 YangEntityToResolveInfo<YangUses> unResolvedEntityInfo = new YangEntityToResolveInfo<YangUses>();
443 unResolvedEntityInfo.setEntityToResolve((YangUses) curNode);
444 unResolvedEntityInfo.setHolderOfEntityToResolve(node);
445 addInPartialResolvedStack((YangEntityToResolveInfo<T>) unResolvedEntityInfo);
446
447 }
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530448 }
449 curNode = curNode.getNextSibling();
450 }
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530451 }
452
453 /**
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530454 * Returns stack of YANG type with partially resolved YANG construct
455 * hierarchy.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530456 *
457 * @return partial resolved YANG construct stack
458 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530459 private Stack<YangEntityToResolveInfo<T>> getPartialResolvedStack() {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530460 return partialResolvedStack;
461 }
462
463 /**
Bharat saraswald9822e92016-04-05 15:13:44 +0530464 * Sets stack of YANG type with partially resolved YANG construct hierarchy.
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530465 *
466 * @param partialResolvedStack partial resolved YANG construct stack
467 */
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530468 private void setPartialResolvedStack(Stack<YangEntityToResolveInfo<T>> partialResolvedStack) {
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530469 this.partialResolvedStack = partialResolvedStack;
470 }
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530471
472 /**
473 * Sets stack of YANG type with partially resolved YANG construct hierarchy.
474 *
475 * @param partialResolvedInfo partial resolved YANG construct stack
476 */
477 private void addInPartialResolvedStack(YangEntityToResolveInfo<T> partialResolvedInfo) {
478 getPartialResolvedStack().push(partialResolvedInfo);
479 }
480
481 /**
482 * Retrieves the next entity in the stack that needs to be resolved. It is
483 * assumed that the caller ensures that the stack is not empty.
484 *
485 * @return next entity in the stack that needs to be resolved
486 */
487 private T getCurrentEntityToResolveFromStack() {
488 return getPartialResolvedStack().peek().getEntityToResolve();
489 }
490
491 /**
492 * Retrieves information about the entity that needs to be resolved.
493 *
494 * @return information about the entity that needs to be resolved
495 */
496 public YangEntityToResolveInfo<T> getEntityToResolveInfo() {
497 return entityToResolveInfo;
498 }
499
500 /**
501 * Sets information about the entity that needs to be resolved.
502 *
503 * @param entityToResolveInfo information about the entity that needs to be
Gaurav Agrawalcfa1c412016-05-03 00:41:48 +0530504 * resolved
Vinod Kumar Sd4deb062016-04-15 18:08:57 +0530505 */
506 public void setEntityToResolveInfo(YangEntityToResolveInfo<T> entityToResolveInfo) {
507 this.entityToResolveInfo = entityToResolveInfo;
508 }
Gaurav Agrawalcfa1c412016-05-03 00:41:48 +0530509
510 @Override
511 public int getLineNumber() {
512 return lineNumber;
513 }
514
515 @Override
516 public int getCharPosition() {
517 return charPosition;
518 }
519
520 @Override
521 public void setLineNumber(int lineNumber) {
522 this.lineNumber = lineNumber;
523 }
524
525 @Override
526 public void setCharPosition(int charPositionInLine) {
527 this.charPosition = charPositionInLine;
528 }
Gaurav Agrawald9d6cc82016-03-29 02:17:23 +0530529}