janani b | 23ccc31 | 2016-07-14 19:35:22 +0530 | [diff] [blame^] | 1 | /* |
| 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 | package org.onosproject.yangutils.datamodel; |
| 17 | |
| 18 | import java.io.Serializable; |
| 19 | |
| 20 | /** |
| 21 | * Represents implementation of information about entity being resolved. |
| 22 | * |
| 23 | * @param <T> type of entity being resolved, uses / grouping |
| 24 | */ |
| 25 | public class YangEntityToResolveInfoImpl<T> implements YangEntityToResolveInfo<T>, Serializable, LocationInfo { |
| 26 | |
| 27 | private static final long serialVersionUID = 806201659L; |
| 28 | |
| 29 | /** |
| 30 | * Parsable node for which resolution is to be performed. |
| 31 | */ |
| 32 | private T entityToResolve; |
| 33 | |
| 34 | /** |
| 35 | * Holder of the YANG construct for which resolution has to be carried out. |
| 36 | */ |
| 37 | private YangNode holderOfEntityToResolve; |
| 38 | |
| 39 | /** |
| 40 | * Error line number. |
| 41 | */ |
| 42 | private transient int lineNumber; |
| 43 | |
| 44 | /** |
| 45 | * Error character position in number. |
| 46 | */ |
| 47 | private transient int charPositionInLine; |
| 48 | |
| 49 | @Override |
| 50 | public T getEntityToResolve() { |
| 51 | return entityToResolve; |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public void setEntityToResolve(T entityToResolve) { |
| 56 | this.entityToResolve = entityToResolve; |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public YangNode getHolderOfEntityToResolve() { |
| 61 | return holderOfEntityToResolve; |
| 62 | } |
| 63 | |
| 64 | @Override |
| 65 | public void setHolderOfEntityToResolve(YangNode holderOfEntityToResolve) { |
| 66 | this.holderOfEntityToResolve = holderOfEntityToResolve; |
| 67 | } |
| 68 | |
| 69 | @Override |
| 70 | public int getLineNumber() { |
| 71 | return lineNumber; |
| 72 | } |
| 73 | |
| 74 | @Override |
| 75 | public int getCharPosition() { |
| 76 | return charPositionInLine; |
| 77 | } |
| 78 | |
| 79 | @Override |
| 80 | public void setLineNumber(int lineNumber) { |
| 81 | this.lineNumber = lineNumber; |
| 82 | } |
| 83 | |
| 84 | @Override |
| 85 | public void setCharPosition(int charPositionInLine) { |
| 86 | this.charPositionInLine = charPositionInLine; |
| 87 | } |
| 88 | } |