blob: 8c9628c41965a53daf1315ba01f1e21a7f3cff4f [file] [log] [blame]
Vinod Kumar S48848f72016-02-25 15:52:16 +05301/*Copyright 2016.year Open Networking Laboratory
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.*/
14package org.onosproject.yangutils.datamodel;
15
16import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
17import org.onosproject.yangutils.parser.Parsable;
Gaurav Agrawaldb828bd2016-02-27 03:57:50 +053018import org.onosproject.yangutils.utils.YangConstructType;
Vinod Kumar S48848f72016-02-25 15:52:16 +053019
20/*-
21 * The typedef Statement
22 *
23 * The "typedef" statement defines a new type that may be used locally
24 * in the module, in modules or submodules which include it, and by
25 * other modules that import from it. The new type is called the
26 * "derived type", and the type from which it was derived is called
27 * the "base type". All derived types can be traced back to a YANG
28 * built-in type.
29 *
30 * The "typedef" statement's argument is an identifier that is the name
31 * of the type to be defined, and MUST be followed by a block of
32 * sub-statements that holds detailed typedef information.
33 *
34 * The name of the type MUST NOT be one of the YANG built-in types. If
35 * the typedef is defined at the top level of a YANG module or
36 * submodule, the name of the type to be defined MUST be unique within
37 * the module.
38 */
39/**
40 * Derived type information.
41 */
42public class YangDerivedType implements Parsable {
43
44 /**
45 * All derived types can be traced back to a YANG built-in type.
46 */
47 private YangDataTypes effectiveYangBuiltInType;
48
49 /**
50 * Base type from which the current type is derived.
51 */
52 private YangType<?> baseType;
53
54 /**
55 * Default constructor.
56 */
57 public YangDerivedType() {
58 }
59
60 /**
61 * Get the effective YANG built-in type of the derived data type.
62 *
Gaurav Agrawaldb828bd2016-02-27 03:57:50 +053063 * @return effective YANG built-in type of the derived data type
Vinod Kumar S48848f72016-02-25 15:52:16 +053064 */
65 public YangDataTypes getEffectiveYangBuiltInType() {
66 return effectiveYangBuiltInType;
67 }
68
69 /**
70 * Set the effective YANG built-in type of the derived data type.
71 *
Gaurav Agrawaldb828bd2016-02-27 03:57:50 +053072 * @param builtInType effective YANG built-in type of the derived data type
Vinod Kumar S48848f72016-02-25 15:52:16 +053073 */
74 public void setEffectiveYangBuiltInType(YangDataTypes builtInType) {
75 effectiveYangBuiltInType = builtInType;
76 }
77
78 /**
79 * Get the base type information.
80 *
Gaurav Agrawaldb828bd2016-02-27 03:57:50 +053081 * @return base type information
Vinod Kumar S48848f72016-02-25 15:52:16 +053082 */
83 public YangType<?> getBaseType() {
84 return baseType;
85 }
86
87 /**
88 * Get the base type information.
89 *
Gaurav Agrawaldb828bd2016-02-27 03:57:50 +053090 * @param baseType base type information
Vinod Kumar S48848f72016-02-25 15:52:16 +053091 */
92 public void setBaseType(YangType<?> baseType) {
93 this.baseType = baseType;
94 }
95
96 /**
97 * Get the parsable type.
98 */
99 @Override
Gaurav Agrawaldb828bd2016-02-27 03:57:50 +0530100 public YangConstructType getYangConstructType() {
101 return YangConstructType.DERIVED;
Vinod Kumar S48848f72016-02-25 15:52:16 +0530102 }
103
104 /**
105 * TODO.
106 */
107 @Override
108 public void validateDataOnEntry() throws DataModelException {
109 // TODO Auto-generated method stub
110
111 }
112
113 /**
114 * TODO.
115 */
116 @Override
117 public void validateDataOnExit() throws DataModelException {
118 // TODO Auto-generated method stub
119
120 }
121
122}