blob: 7fb293df1505284bb2331df7f62806eef00a90b2 [file] [log] [blame]
Vinod Kumar S17711e52016-02-09 20:02:43 +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 "revision" statement specifies the editorial revision history of
25 * the module, including the initial revision. A series of revision
26 * statements detail the changes in the module's definition. The
27 * argument is a date string in the format "YYYY-MM-DD", followed by a
28 * block of sub-statements that holds detailed revision information. A
29 * module SHOULD have at least one initial "revision" statement. For
30 * every published editorial change, a new one SHOULD be added in front
31 * of the revisions sequence, so that all revisions are in reverse
32 * chronological order.
33 * The revision's sub-statement
34 *
35 * +--------------+---------+-------------+------------------+
36 * | substatement | section | cardinality |data model mapping|
37 * +--------------+---------+-------------+------------------+
38 * | description | 7.19.3 | 0..1 |string |
39 * | reference | 7.19.4 | 0..1 |sring |
40 * +--------------+---------+-------------+------------------+
41 */
42/**
43 * Maintains the information about the revision.
44 */
45public class YangRevision implements YangDesc, YangReference, Parsable {
46
47 /**
48 * Revision date. Date string in the format "YYYY-MM-DD"
49 */
50 private String revDate;
51
52 /**
53 * Description of revision.
54 */
55 private String description;
56
57 /**
58 * Textual reference for revision.
59 */
60 private String reference;
61
62 /**
63 * Default constructor.
64 */
65 public YangRevision() {
66 }
67
68 /**
69 * Get the revision date.
70 *
71 * @return the revision date
72 */
73 public String getRevDate() {
74 return revDate;
75 }
76
77 /**
78 * Set the revision date.
79 *
80 * @param revDate the revision date to set
81 */
82 public void setRevDate(String revDate) {
83 this.revDate = revDate;
84 }
85
86 /**
87 * Get the description.
88 *
89 * @return the description.
90 */
91 public String getDescription() {
92 return description;
93 }
94
95 /**
96 * Set the description.
97 *
98 * @param description set the description.
99 */
100 public void setDescription(String description) {
101 this.description = description;
102 }
103
104 /**
105 * Get the textual reference.
106 *
107 * @return the reference.
108 */
109 public String getReference() {
110 return reference;
111 }
112
113 /**
114 * Set the textual reference.
115 *
116 * @param reference the reference to set.
117 */
118 public void setReference(String reference) {
119 this.reference = reference;
120 }
121
122 /**
123 * Returns the type of the parsed data.
124 *
125 * @return returns REVISION_DATA.
126 */
127 public ParsableDataType getParsableDataType() {
128 return ParsableDataType.REVISION_DATA;
129 }
130
131 /**
132 * Validate the data on entering the corresponding parse tree node.
133 *
134 * @throws DataModelException a violation of data model rules.
135 */
136 public void validateDataOnEntry() throws DataModelException {
137 // TODO auto-generated method stub, to be implemented by parser
138
139 }
140
141 /**
142 * Validate the data on exiting the corresponding parse tree node.
143 *
144 * @throws DataModelException a violation of data model rules.
145 */
146 public void validateDataOnExit() throws DataModelException {
147 // TODO auto-generated method stub, to be implemented by parser
148
149 }
150}