Committed by
Gerrit Code Review
[ONOS-4711] Move YANG data types to data types to remove dependency
Change-Id: I2297fc1fa69c7609765fc970d5614447db8e9f88
Showing
58 changed files
with
311 additions
and
176 deletions
... | @@ -13,11 +13,20 @@ | ... | @@ -13,11 +13,20 @@ |
13 | * See the License for the specific language governing permissions and | 13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | -package org.onosproject.yangutils.datamodel.utils.builtindatatype; | 16 | +package org.onosproject.yangutils.datamodel; |
17 | 17 | ||
18 | import java.io.Serializable; | 18 | import java.io.Serializable; |
19 | - | 19 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.DataTypeException; |
20 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 20 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo; |
21 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | ||
22 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt16; | ||
23 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt32; | ||
24 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt64; | ||
25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt8; | ||
26 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint16; | ||
27 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint32; | ||
28 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint64; | ||
29 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint8; | ||
21 | 30 | ||
22 | /** | 31 | /** |
23 | * Factory to create an object of required type. | 32 | * Factory to create an object of required type. |
... | @@ -42,36 +51,36 @@ public final class BuiltInTypeObjectFactory implements Serializable { | ... | @@ -42,36 +51,36 @@ public final class BuiltInTypeObjectFactory implements Serializable { |
42 | * @return the target data type object with the value initialized | 51 | * @return the target data type object with the value initialized |
43 | */ | 52 | */ |
44 | public static <T extends YangBuiltInDataTypeInfo<?>> T getDataObjectFromString(String valueInStr, | 53 | public static <T extends YangBuiltInDataTypeInfo<?>> T getDataObjectFromString(String valueInStr, |
45 | - YangDataTypes builtInType) { | 54 | + YangDataTypes builtInType) { |
46 | 55 | ||
47 | switch (builtInType) { | 56 | switch (builtInType) { |
48 | - case INT8: { | 57 | + case INT8: { |
49 | - return (T) new YangInt8(valueInStr); | 58 | + return (T) new YangInt8(valueInStr); |
50 | - } | 59 | + } |
51 | - case INT16: { | 60 | + case INT16: { |
52 | - return (T) new YangInt16(valueInStr); | 61 | + return (T) new YangInt16(valueInStr); |
53 | - } | 62 | + } |
54 | - case INT32: { | 63 | + case INT32: { |
55 | - return (T) new YangInt32(valueInStr); | 64 | + return (T) new YangInt32(valueInStr); |
56 | - } | 65 | + } |
57 | - case INT64: { | 66 | + case INT64: { |
58 | - return (T) new YangInt64(valueInStr); | 67 | + return (T) new YangInt64(valueInStr); |
59 | - } | 68 | + } |
60 | - case UINT8: { | 69 | + case UINT8: { |
61 | - return (T) new YangUint8(valueInStr); | 70 | + return (T) new YangUint8(valueInStr); |
62 | - } | 71 | + } |
63 | - case UINT16: { | 72 | + case UINT16: { |
64 | - return (T) new YangUint16(valueInStr); | 73 | + return (T) new YangUint16(valueInStr); |
65 | - } | 74 | + } |
66 | - case UINT32: { | 75 | + case UINT32: { |
67 | - return (T) new YangUint32(valueInStr); | 76 | + return (T) new YangUint32(valueInStr); |
68 | - } | 77 | + } |
69 | - case UINT64: { | 78 | + case UINT64: { |
70 | - return (T) new YangUint64(valueInStr); | 79 | + return (T) new YangUint64(valueInStr); |
71 | - } | 80 | + } |
72 | - default: { | 81 | + default: { |
73 | - throw new DataTypeException("YANG file error : Unsupported data type"); | 82 | + throw new DataTypeException("YANG file error : Unsupported data type"); |
74 | - } | 83 | + } |
75 | } | 84 | } |
76 | 85 | ||
77 | } | 86 | } | ... | ... |
utils/yangutils/datamodel/src/main/java/org/onosproject/yangutils/datamodel/YangDataNode.java
0 → 100644
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 | + | ||
17 | +package org.onosproject.yangutils.datamodel; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of YANG data node, used by YMS to abstractly refer the data | ||
21 | + * nodes in YANG data tree. | ||
22 | + */ | ||
23 | +public interface YangDataNode { | ||
24 | +} |
... | @@ -20,22 +20,23 @@ import java.io.Serializable; | ... | @@ -20,22 +20,23 @@ import java.io.Serializable; |
20 | 20 | ||
21 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 21 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
22 | import org.onosproject.yangutils.datamodel.utils.ResolvableStatus; | 22 | import org.onosproject.yangutils.datamodel.utils.ResolvableStatus; |
23 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | ||
23 | 24 | ||
24 | import com.google.common.base.Strings; | 25 | import com.google.common.base.Strings; |
25 | 26 | ||
26 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY; | 27 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY; |
27 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.BITS; | 28 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BITS; |
28 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.BOOLEAN; | 29 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BOOLEAN; |
29 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 30 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
30 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.EMPTY; | 31 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.EMPTY; |
31 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.ENUMERATION; | 32 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.ENUMERATION; |
32 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.IDENTITYREF; | 33 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.IDENTITYREF; |
33 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.LEAFREF; | 34 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.LEAFREF; |
34 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 35 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
35 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.UNION; | 36 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UNION; |
36 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED; | 37 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED; |
37 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; | 38 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; |
38 | -import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.isOfRangeRestrictedType; | 39 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypeUtils.isOfRangeRestrictedType; |
39 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processLengthRestriction; | 40 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processLengthRestriction; |
40 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processRangeRestriction; | 41 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processRangeRestriction; |
41 | 42 | ... | ... |
... | @@ -62,7 +62,7 @@ import org.onosproject.yangutils.datamodel.utils.YangConstructType; | ... | @@ -62,7 +62,7 @@ import org.onosproject.yangutils.datamodel.utils.YangConstructType; |
62 | */ | 62 | */ |
63 | public class YangLeaf | 63 | public class YangLeaf |
64 | implements YangCommonInfo, Parsable, Cloneable, Serializable, | 64 | implements YangCommonInfo, Parsable, Cloneable, Serializable, |
65 | - YangMustHolder, YangIfFeatureHolder, YangWhenHolder { | 65 | + YangMustHolder, YangIfFeatureHolder, YangWhenHolder, YangDataNode { |
66 | 66 | ||
67 | private static final long serialVersionUID = 806201635L; | 67 | private static final long serialVersionUID = 806201635L; |
68 | 68 | ... | ... |
... | @@ -58,7 +58,7 @@ import org.onosproject.yangutils.datamodel.utils.YangConstructType; | ... | @@ -58,7 +58,7 @@ import org.onosproject.yangutils.datamodel.utils.YangConstructType; |
58 | */ | 58 | */ |
59 | public class YangLeafList | 59 | public class YangLeafList |
60 | implements YangCommonInfo, Parsable, Cloneable, Serializable, | 60 | implements YangCommonInfo, Parsable, Cloneable, Serializable, |
61 | - YangMustHolder, YangWhenHolder, YangIfFeatureHolder { | 61 | + YangMustHolder, YangWhenHolder, YangIfFeatureHolder, YangDataNode { |
62 | 62 | ||
63 | private static final long serialVersionUID = 806201637L; | 63 | private static final long serialVersionUID = 806201637L; |
64 | 64 | ... | ... |
... | @@ -22,6 +22,7 @@ import java.util.List; | ... | @@ -22,6 +22,7 @@ import java.util.List; |
22 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 22 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
23 | import org.onosproject.yangutils.datamodel.utils.Parsable; | 23 | import org.onosproject.yangutils.datamodel.utils.Parsable; |
24 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; | 24 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; |
25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | ||
25 | 26 | ||
26 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil; | 27 | import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil; |
27 | 28 | ||
... | @@ -70,7 +71,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol | ... | @@ -70,7 +71,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol |
70 | public class YangList | 71 | public class YangList |
71 | extends YangNode | 72 | extends YangNode |
72 | implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder, | 73 | implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder, |
73 | - YangMustHolder, YangIfFeatureHolder { | 74 | + YangMustHolder, YangIfFeatureHolder, YangDataNode { |
74 | 75 | ||
75 | private static final long serialVersionUID = 806201609L; | 76 | private static final long serialVersionUID = 806201609L; |
76 | 77 | ... | ... |
... | @@ -16,14 +16,13 @@ | ... | @@ -16,14 +16,13 @@ |
16 | package org.onosproject.yangutils.datamodel; | 16 | package org.onosproject.yangutils.datamodel; |
17 | 17 | ||
18 | import java.io.Serializable; | 18 | import java.io.Serializable; |
19 | - | ||
20 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 19 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
21 | 20 | ||
22 | /** | 21 | /** |
23 | * Represents base class of a node in data model tree. | 22 | * Represents base class of a node in data model tree. |
24 | */ | 23 | */ |
25 | public abstract class YangNode | 24 | public abstract class YangNode |
26 | - implements Cloneable, Serializable { | 25 | + implements Cloneable, Serializable, YangDataNode { |
27 | 26 | ||
28 | private static final long serialVersionUID = 806201601L; | 27 | private static final long serialVersionUID = 806201601L; |
29 | 28 | ... | ... |
... | @@ -19,14 +19,13 @@ package org.onosproject.yangutils.datamodel; | ... | @@ -19,14 +19,13 @@ package org.onosproject.yangutils.datamodel; |
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | import java.util.LinkedList; | 20 | import java.util.LinkedList; |
21 | import java.util.List; | 21 | import java.util.List; |
22 | - | ||
23 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 22 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
24 | import org.onosproject.yangutils.datamodel.utils.Parsable; | 23 | import org.onosproject.yangutils.datamodel.utils.Parsable; |
25 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; | 24 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; |
26 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo; | 25 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo; |
26 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | ||
27 | 27 | ||
28 | -import static org.onosproject.yangutils.datamodel.utils.builtindatatype.BuiltInTypeObjectFactory.getDataObjectFromString; | 28 | +import static org.onosproject.yangutils.datamodel.BuiltInTypeObjectFactory.getDataObjectFromString; |
29 | - | ||
30 | import static com.google.common.base.Preconditions.checkNotNull; | 29 | import static com.google.common.base.Preconditions.checkNotNull; |
31 | 30 | ||
32 | /*- | 31 | /*- |
... | @@ -208,7 +207,6 @@ public class YangRangeRestriction<T extends YangBuiltInDataTypeInfo<T>> | ... | @@ -208,7 +207,6 @@ public class YangRangeRestriction<T extends YangBuiltInDataTypeInfo<T>> |
208 | return true; | 207 | return true; |
209 | } | 208 | } |
210 | } | 209 | } |
211 | - | ||
212 | return false; | 210 | return false; |
213 | } | 211 | } |
214 | 212 | ... | ... |
... | @@ -17,13 +17,15 @@ | ... | @@ -17,13 +17,15 @@ |
17 | package org.onosproject.yangutils.datamodel; | 17 | package org.onosproject.yangutils.datamodel; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | - | ||
21 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 20 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
22 | import org.onosproject.yangutils.datamodel.utils.Parsable; | 21 | import org.onosproject.yangutils.datamodel.utils.Parsable; |
23 | import org.onosproject.yangutils.datamodel.utils.ResolvableStatus; | 22 | import org.onosproject.yangutils.datamodel.utils.ResolvableStatus; |
24 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; | 23 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; |
24 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | ||
25 | 25 | ||
26 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 26 | +import static org.onosproject.yangutils.datamodel.BuiltInTypeObjectFactory.getDataObjectFromString; |
27 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypeUtils.isOfRangeRestrictedType; | ||
28 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; | ||
27 | 29 | ||
28 | /* | 30 | /* |
29 | * Reference:RFC 6020. | 31 | * Reference:RFC 6020. |
... | @@ -271,4 +273,101 @@ public class YangType<T> | ... | @@ -271,4 +273,101 @@ public class YangType<T> |
271 | throw new DataModelException(e.getMessage()); | 273 | throw new DataModelException(e.getMessage()); |
272 | } | 274 | } |
273 | } | 275 | } |
276 | + | ||
277 | + /** | ||
278 | + * Validates the input data value against the permissible value for the | ||
279 | + * type as per the YANG file. | ||
280 | + * | ||
281 | + * @param value input data value | ||
282 | + * @return status of validation | ||
283 | + */ | ||
284 | + public boolean isValidValue(String value) { | ||
285 | + switch (getDataType()) { | ||
286 | + case INT8: | ||
287 | + case INT16: | ||
288 | + case INT32: | ||
289 | + case INT64: | ||
290 | + case UINT8: | ||
291 | + case UINT16: | ||
292 | + case UINT32: | ||
293 | + case UINT64: { | ||
294 | + isValidValueForRangeRestrictedType(value); | ||
295 | + } | ||
296 | + case DECIMAL64: { | ||
297 | + // TODO | ||
298 | + } | ||
299 | + case STRING: { | ||
300 | + // TODO implement in string restriction similar to range restriction | ||
301 | + } | ||
302 | + case ENUMERATION: { | ||
303 | + // TODO validate using list of YANG enum of enumeration class in extended info. | ||
304 | + } | ||
305 | + case BINARY: { | ||
306 | + // TODO validate based on extended info | ||
307 | + } | ||
308 | + case BITS: { | ||
309 | + // TODO validate based on extended info | ||
310 | + } | ||
311 | + case BOOLEAN: { | ||
312 | + // TODO true or false | ||
313 | + } | ||
314 | + case LEAFREF: { | ||
315 | + // TODO validate based on extended info | ||
316 | + } | ||
317 | + case IDENTITYREF: { | ||
318 | + // TODO TBD | ||
319 | + } | ||
320 | + case EMPTY: { | ||
321 | + // TODO true or false | ||
322 | + } | ||
323 | + case UNION: { | ||
324 | + // TODO validate based on extended info | ||
325 | + } | ||
326 | + case INSTANCE_IDENTIFIER: { | ||
327 | + // TODO TBD | ||
328 | + } | ||
329 | + case DERIVED: { | ||
330 | + if (isOfRangeRestrictedType(((YangDerivedInfo) getDataTypeExtendedInfo()).getEffectiveBuiltInType())) { | ||
331 | + try { | ||
332 | + if (((YangDerivedInfo) getDataTypeExtendedInfo()).getResolvedExtendedInfo() == null) { | ||
333 | + getDataObjectFromString(value, | ||
334 | + ((YangDerivedInfo) getDataTypeExtendedInfo()).getEffectiveBuiltInType()); | ||
335 | + return true; | ||
336 | + } else { | ||
337 | + return ((YangRangeRestriction) ((YangDerivedInfo) getDataTypeExtendedInfo()) | ||
338 | + .getResolvedExtendedInfo()).isValidValueString(value); | ||
339 | + } | ||
340 | + } catch (Exception e) { | ||
341 | + return false; | ||
342 | + } | ||
343 | + } else { | ||
344 | + // TODO | ||
345 | + } | ||
346 | + } | ||
347 | + default: { | ||
348 | + // TODO | ||
349 | + } | ||
350 | + } | ||
351 | + return true; | ||
352 | + } | ||
353 | + | ||
354 | + /** | ||
355 | + * Validates the input data value for range restricted types against the | ||
356 | + * permissible value for the type as per the YANG file. | ||
357 | + * | ||
358 | + * @param value input data value | ||
359 | + * @return status of validation | ||
360 | + */ | ||
361 | + private boolean isValidValueForRangeRestrictedType(String value) { | ||
362 | + try { | ||
363 | + if (getDataTypeExtendedInfo() == null) { | ||
364 | + getDataObjectFromString(value, getDataType()); | ||
365 | + return true; | ||
366 | + } else { | ||
367 | + return ((YangRangeRestriction) getDataTypeExtendedInfo()).isValidValueString(value); | ||
368 | + } | ||
369 | + } catch (Exception e) { | ||
370 | + return false; | ||
371 | + } | ||
372 | + } | ||
274 | } | 373 | } | ... | ... |
... | @@ -22,6 +22,7 @@ import java.util.List; | ... | @@ -22,6 +22,7 @@ import java.util.List; |
22 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 22 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
23 | import org.onosproject.yangutils.datamodel.utils.Parsable; | 23 | import org.onosproject.yangutils.datamodel.utils.Parsable; |
24 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; | 24 | import org.onosproject.yangutils.datamodel.utils.YangConstructType; |
25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * Reference RFC 6020. | 28 | * Reference RFC 6020. | ... | ... |
... | @@ -16,26 +16,16 @@ | ... | @@ -16,26 +16,16 @@ |
16 | 16 | ||
17 | package org.onosproject.yangutils.datamodel.utils; | 17 | package org.onosproject.yangutils.datamodel.utils; |
18 | 18 | ||
19 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DECIMAL64; | ||
20 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.INT16; | ||
21 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32; | ||
22 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.INT64; | ||
23 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.INT8; | ||
24 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT16; | ||
25 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT32; | ||
26 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT64; | ||
27 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT8; | ||
28 | -import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA; | ||
29 | -import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA; | ||
30 | -import static org.onosproject.yangutils.datamodel.utils.builtindatatype.BuiltInTypeObjectFactory.getDataObjectFromString; | ||
31 | - | ||
32 | import java.util.regex.Pattern; | 19 | import java.util.regex.Pattern; |
33 | - | ||
34 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
35 | import org.onosproject.yangutils.datamodel.YangRangeInterval; | 20 | import org.onosproject.yangutils.datamodel.YangRangeInterval; |
36 | import org.onosproject.yangutils.datamodel.YangRangeRestriction; | 21 | import org.onosproject.yangutils.datamodel.YangRangeRestriction; |
37 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; | 22 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
38 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo; | 23 | import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo; |
24 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; | ||
25 | + | ||
26 | +import static org.onosproject.yangutils.datamodel.BuiltInTypeObjectFactory.getDataObjectFromString; | ||
27 | +import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA; | ||
28 | +import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA; | ||
39 | 29 | ||
40 | /** | 30 | /** |
41 | * Represents restriction resolver which provide common utility used by parser | 31 | * Represents restriction resolver which provide common utility used by parser |
... | @@ -71,9 +61,9 @@ public final class RestrictionResolver { | ... | @@ -71,9 +61,9 @@ public final class RestrictionResolver { |
71 | * @throws DataModelException a violation in data model rule | 61 | * @throws DataModelException a violation in data model rule |
72 | */ | 62 | */ |
73 | public static YangRangeRestriction processRangeRestriction(YangRangeRestriction refRangeRestriction, | 63 | public static YangRangeRestriction processRangeRestriction(YangRangeRestriction refRangeRestriction, |
74 | - int lineNumber, int charPositionInLine, | 64 | + int lineNumber, int charPositionInLine, |
75 | - boolean hasReferredRestriction, | 65 | + boolean hasReferredRestriction, |
76 | - String curRangeString, YangDataTypes effectiveType) | 66 | + String curRangeString, YangDataTypes effectiveType) |
77 | throws DataModelException { | 67 | throws DataModelException { |
78 | YangBuiltInDataTypeInfo<?> startValue; | 68 | YangBuiltInDataTypeInfo<?> startValue; |
79 | YangBuiltInDataTypeInfo<?> endValue; | 69 | YangBuiltInDataTypeInfo<?> endValue; |
... | @@ -157,9 +147,9 @@ public final class RestrictionResolver { | ... | @@ -157,9 +147,9 @@ public final class RestrictionResolver { |
157 | * @throws DataModelException a violation in data model rule | 147 | * @throws DataModelException a violation in data model rule |
158 | */ | 148 | */ |
159 | public static YangRangeRestriction processLengthRestriction(YangRangeRestriction refLengthRestriction, | 149 | public static YangRangeRestriction processLengthRestriction(YangRangeRestriction refLengthRestriction, |
160 | - int lineNumber, int charPositionInLine, | 150 | + int lineNumber, int charPositionInLine, |
161 | - boolean hasReferredRestriction, | 151 | + boolean hasReferredRestriction, |
162 | - String curLengthString) throws DataModelException { | 152 | + String curLengthString) throws DataModelException { |
163 | 153 | ||
164 | YangBuiltInDataTypeInfo<?> startValue; | 154 | YangBuiltInDataTypeInfo<?> startValue; |
165 | YangBuiltInDataTypeInfo<?> endValue; | 155 | YangBuiltInDataTypeInfo<?> endValue; |
... | @@ -232,24 +222,6 @@ public final class RestrictionResolver { | ... | @@ -232,24 +222,6 @@ public final class RestrictionResolver { |
232 | } | 222 | } |
233 | 223 | ||
234 | /** | 224 | /** |
235 | - * Returns whether the data type is of range restricted type. | ||
236 | - * | ||
237 | - * @param dataType data type to be checked | ||
238 | - * @return true, if data type can have range restrictions, false otherwise | ||
239 | - */ | ||
240 | - public static boolean isOfRangeRestrictedType(YangDataTypes dataType) { | ||
241 | - return dataType == INT8 | ||
242 | - || dataType == INT16 | ||
243 | - || dataType == INT32 | ||
244 | - || dataType == INT64 | ||
245 | - || dataType == UINT8 | ||
246 | - || dataType == UINT16 | ||
247 | - || dataType == UINT32 | ||
248 | - || dataType == UINT64 | ||
249 | - || dataType == DECIMAL64; | ||
250 | - } | ||
251 | - | ||
252 | - /** | ||
253 | * Removes doubles quotes and concatenates if string has plus symbol. | 225 | * Removes doubles quotes and concatenates if string has plus symbol. |
254 | * | 226 | * |
255 | * @param yangStringData string from yang file | 227 | * @param yangStringData string from yang file | ... | ... |
... | @@ -15,8 +15,6 @@ | ... | @@ -15,8 +15,6 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.yangutils.datamodel.utils.builtindatatype; | 16 | package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
17 | 17 | ||
18 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
19 | - | ||
20 | /** | 18 | /** |
21 | * Represents the list of utility functions to be supported by YANG built in | 19 | * Represents the list of utility functions to be supported by YANG built in |
22 | * data type implementations. | 20 | * data type implementations. | ... | ... |
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 | + | ||
17 | +package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ||
18 | + | ||
19 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DECIMAL64; | ||
20 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT16; | ||
21 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; | ||
22 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT64; | ||
23 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT8; | ||
24 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT16; | ||
25 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT32; | ||
26 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT64; | ||
27 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT8; | ||
28 | + | ||
29 | +/** | ||
30 | + * Represents YANG data type utilities. | ||
31 | + */ | ||
32 | +public final class YangDataTypeUtils { | ||
33 | + | ||
34 | + /** | ||
35 | + * Restricts creation of YANG data type utils instance. | ||
36 | + */ | ||
37 | + private YangDataTypeUtils() { | ||
38 | + } | ||
39 | + | ||
40 | + /** | ||
41 | + * Returns whether the data type is of range restricted type. | ||
42 | + * | ||
43 | + * @param dataType data type to be checked | ||
44 | + * @return true, if data type can have range restrictions, false otherwise | ||
45 | + */ | ||
46 | + public static boolean isOfRangeRestrictedType(YangDataTypes dataType) { | ||
47 | + return dataType == INT8 | ||
48 | + || dataType == INT16 | ||
49 | + || dataType == INT32 | ||
50 | + || dataType == INT64 | ||
51 | + || dataType == UINT8 | ||
52 | + || dataType == UINT16 | ||
53 | + || dataType == UINT32 | ||
54 | + || dataType == UINT64 | ||
55 | + || dataType == DECIMAL64; | ||
56 | + } | ||
57 | +} |
... | @@ -14,7 +14,7 @@ | ... | @@ -14,7 +14,7 @@ |
14 | * limitations under the License. | 14 | * limitations under the License. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | -package org.onosproject.yangutils.datamodel; | 17 | +package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | /** | 19 | /** |
20 | * Represents ENUM to identify the YANG data type. | 20 | * Represents ENUM to identify the YANG data type. | ... | ... |
... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Handles the YANG's int16 data type processing. | 22 | * Handles the YANG's int16 data type processing. |
25 | * | 23 | * |
... | @@ -94,5 +92,4 @@ public class YangInt16 implements YangBuiltInDataTypeInfo<YangInt16>, Serializab | ... | @@ -94,5 +92,4 @@ public class YangInt16 implements YangBuiltInDataTypeInfo<YangInt16>, Serializab |
94 | public YangDataTypes getYangType() { | 92 | public YangDataTypes getYangType() { |
95 | return YangDataTypes.INT16; | 93 | return YangDataTypes.INT16; |
96 | } | 94 | } |
97 | - | ||
98 | } | 95 | } | ... | ... |
... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Handles the YANG's int32 data type processing. | 22 | * Handles the YANG's int32 data type processing. |
25 | * | 23 | * |
... | @@ -94,5 +92,4 @@ public class YangInt32 implements YangBuiltInDataTypeInfo<YangInt32>, Serializab | ... | @@ -94,5 +92,4 @@ public class YangInt32 implements YangBuiltInDataTypeInfo<YangInt32>, Serializab |
94 | public YangDataTypes getYangType() { | 92 | public YangDataTypes getYangType() { |
95 | return YangDataTypes.INT32; | 93 | return YangDataTypes.INT32; |
96 | } | 94 | } |
97 | - | ||
98 | } | 95 | } | ... | ... |
... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Handles the YANG's int8 data type processing. | 22 | * Handles the YANG's int8 data type processing. |
25 | * | 23 | * |
... | @@ -94,5 +92,4 @@ public class YangInt64 implements YangBuiltInDataTypeInfo<YangInt64>, Serializab | ... | @@ -94,5 +92,4 @@ public class YangInt64 implements YangBuiltInDataTypeInfo<YangInt64>, Serializab |
94 | public YangDataTypes getYangType() { | 92 | public YangDataTypes getYangType() { |
95 | return YangDataTypes.INT64; | 93 | return YangDataTypes.INT64; |
96 | } | 94 | } |
97 | - | ||
98 | } | 95 | } | ... | ... |
... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Handles the YANG's int8 data type processing. | 22 | * Handles the YANG's int8 data type processing. |
25 | * | 23 | * |
... | @@ -94,5 +92,4 @@ public class YangInt8 implements YangBuiltInDataTypeInfo<YangInt8>, Serializable | ... | @@ -94,5 +92,4 @@ public class YangInt8 implements YangBuiltInDataTypeInfo<YangInt8>, Serializable |
94 | public YangDataTypes getYangType() { | 92 | public YangDataTypes getYangType() { |
95 | return YangDataTypes.INT8; | 93 | return YangDataTypes.INT8; |
96 | } | 94 | } |
97 | - | ||
98 | } | 95 | } | ... | ... |
... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Handles the YANG's Uint16 data type processing. | 22 | * Handles the YANG's Uint16 data type processing. |
25 | * | 23 | * |
... | @@ -60,7 +58,7 @@ public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16>, Serializ | ... | @@ -60,7 +58,7 @@ public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16>, Serializ |
60 | * | 58 | * |
61 | * @param valueInString value of the object in string | 59 | * @param valueInString value of the object in string |
62 | */ | 60 | */ |
63 | - YangUint16(String valueInString) { | 61 | + public YangUint16(String valueInString) { |
64 | 62 | ||
65 | if (valueInString.matches(MIN_KEYWORD)) { | 63 | if (valueInString.matches(MIN_KEYWORD)) { |
66 | value = MIN_VALUE; | 64 | value = MIN_VALUE; |
... | @@ -102,5 +100,4 @@ public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16>, Serializ | ... | @@ -102,5 +100,4 @@ public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16>, Serializ |
102 | public YangDataTypes getYangType() { | 100 | public YangDataTypes getYangType() { |
103 | return YangDataTypes.UINT16; | 101 | return YangDataTypes.UINT16; |
104 | } | 102 | } |
105 | - | ||
106 | } | 103 | } | ... | ... |
... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Handles the YANG's Uint32 data type processing. | 22 | * Handles the YANG's Uint32 data type processing. |
25 | * | 23 | * |
... | @@ -53,7 +51,7 @@ public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32>, Serializ | ... | @@ -53,7 +51,7 @@ public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32>, Serializ |
53 | * | 51 | * |
54 | * @param valueInString value of the object in string | 52 | * @param valueInString value of the object in string |
55 | */ | 53 | */ |
56 | - YangUint32(String valueInString) { | 54 | + public YangUint32(String valueInString) { |
57 | 55 | ||
58 | if (valueInString.matches(MIN_KEYWORD)) { | 56 | if (valueInString.matches(MIN_KEYWORD)) { |
59 | value = MIN_VALUE; | 57 | value = MIN_VALUE; |
... | @@ -95,5 +93,4 @@ public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32>, Serializ | ... | @@ -95,5 +93,4 @@ public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32>, Serializ |
95 | public YangDataTypes getYangType() { | 93 | public YangDataTypes getYangType() { |
96 | return YangDataTypes.UINT32; | 94 | return YangDataTypes.UINT32; |
97 | } | 95 | } |
98 | - | ||
99 | } | 96 | } | ... | ... |
... | @@ -20,8 +20,6 @@ import java.io.Serializable; | ... | @@ -20,8 +20,6 @@ import java.io.Serializable; |
20 | import java.math.BigInteger; | 20 | import java.math.BigInteger; |
21 | import java.util.regex.Pattern; | 21 | import java.util.regex.Pattern; |
22 | 22 | ||
23 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
24 | - | ||
25 | /** | 23 | /** |
26 | * Handles the YANG's Uint16 data type processing. | 24 | * Handles the YANG's Uint16 data type processing. |
27 | * | 25 | * |
... | @@ -67,7 +65,7 @@ public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64>, Serializ | ... | @@ -67,7 +65,7 @@ public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64>, Serializ |
67 | * | 65 | * |
68 | * @param valueInString value of the object in string | 66 | * @param valueInString value of the object in string |
69 | */ | 67 | */ |
70 | - YangUint64(String valueInString) { | 68 | + public YangUint64(String valueInString) { |
71 | 69 | ||
72 | if (valueInString.matches(MIN_KEYWORD)) { | 70 | if (valueInString.matches(MIN_KEYWORD)) { |
73 | value = MIN_VALUE; | 71 | value = MIN_VALUE; |
... | @@ -107,5 +105,4 @@ public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64>, Serializ | ... | @@ -107,5 +105,4 @@ public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64>, Serializ |
107 | public YangDataTypes getYangType() { | 105 | public YangDataTypes getYangType() { |
108 | return YangDataTypes.UINT64; | 106 | return YangDataTypes.UINT64; |
109 | } | 107 | } |
110 | - | ||
111 | } | 108 | } | ... | ... |
... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; | ... | @@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype; |
18 | 18 | ||
19 | import java.io.Serializable; | 19 | import java.io.Serializable; |
20 | 20 | ||
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | ||
22 | - | ||
23 | /** | 21 | /** |
24 | * Handles the YANG's Uint8 data type processing. | 22 | * Handles the YANG's Uint8 data type processing. |
25 | * | 23 | * |
... | @@ -60,7 +58,7 @@ public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8>, Serializab | ... | @@ -60,7 +58,7 @@ public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8>, Serializab |
60 | * | 58 | * |
61 | * @param valueInString value of the object in string | 59 | * @param valueInString value of the object in string |
62 | */ | 60 | */ |
63 | - YangUint8(String valueInString) { | 61 | + public YangUint8(String valueInString) { |
64 | 62 | ||
65 | if (valueInString.matches(MIN_KEYWORD)) { | 63 | if (valueInString.matches(MIN_KEYWORD)) { |
66 | value = MIN_VALUE; | 64 | value = MIN_VALUE; |
... | @@ -102,5 +100,4 @@ public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8>, Serializab | ... | @@ -102,5 +100,4 @@ public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8>, Serializab |
102 | public YangDataTypes getYangType() { | 100 | public YangDataTypes getYangType() { |
103 | return YangDataTypes.UINT8; | 101 | return YangDataTypes.UINT8; |
104 | } | 102 | } |
105 | - | ||
106 | } | 103 | } | ... | ... |
... | @@ -22,7 +22,7 @@ import java.util.List; | ... | @@ -22,7 +22,7 @@ import java.util.List; |
22 | import java.util.Stack; | 22 | import java.util.Stack; |
23 | 23 | ||
24 | import org.onosproject.yangutils.datamodel.Resolvable; | 24 | import org.onosproject.yangutils.datamodel.Resolvable; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; | 26 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
27 | import org.onosproject.yangutils.datamodel.YangEntityToResolveInfo; | 27 | import org.onosproject.yangutils.datamodel.YangEntityToResolveInfo; |
28 | import org.onosproject.yangutils.datamodel.YangFeature; | 28 | import org.onosproject.yangutils.datamodel.YangFeature; | ... | ... |
... | @@ -27,9 +27,9 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ... | @@ -27,9 +27,9 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; |
27 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 27 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
28 | import org.onosproject.yangutils.parser.impl.TreeWalkListener; | 28 | import org.onosproject.yangutils.parser.impl.TreeWalkListener; |
29 | 29 | ||
30 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY; | 30 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY; |
31 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 31 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
32 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 32 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
33 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processLengthRestriction; | 33 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processLengthRestriction; |
34 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA; | 34 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA; |
35 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA; | 35 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA; | ... | ... |
... | @@ -18,7 +18,7 @@ package org.onosproject.yangutils.parser.impl.listeners; | ... | @@ -18,7 +18,7 @@ package org.onosproject.yangutils.parser.impl.listeners; |
18 | 18 | ||
19 | import java.util.regex.Pattern; | 19 | import java.util.regex.Pattern; |
20 | import java.util.regex.PatternSyntaxException; | 20 | import java.util.regex.PatternSyntaxException; |
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 21 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
22 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; | 22 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
23 | import org.onosproject.yangutils.datamodel.YangPatternRestriction; | 23 | import org.onosproject.yangutils.datamodel.YangPatternRestriction; |
24 | import org.onosproject.yangutils.datamodel.YangStringRestriction; | 24 | import org.onosproject.yangutils.datamodel.YangStringRestriction; |
... | @@ -29,7 +29,7 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ... | @@ -29,7 +29,7 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; |
29 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 29 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
30 | import org.onosproject.yangutils.parser.impl.TreeWalkListener; | 30 | import org.onosproject.yangutils.parser.impl.TreeWalkListener; |
31 | 31 | ||
32 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 32 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
33 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.PATTERN_DATA; | 33 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.PATTERN_DATA; |
34 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA; | 34 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA; |
35 | import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY; | 35 | import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY; | ... | ... |
... | @@ -25,8 +25,8 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; | ... | @@ -25,8 +25,8 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser; |
25 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 25 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
26 | import org.onosproject.yangutils.parser.impl.TreeWalkListener; | 26 | import org.onosproject.yangutils.parser.impl.TreeWalkListener; |
27 | 27 | ||
28 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 28 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
29 | -import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.isOfRangeRestrictedType; | 29 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypeUtils.isOfRangeRestrictedType; |
30 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processRangeRestriction; | 30 | import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processRangeRestriction; |
31 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA; | 31 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA; |
32 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA; | 32 | import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA; | ... | ... |
... | @@ -16,7 +16,7 @@ | ... | @@ -16,7 +16,7 @@ |
16 | 16 | ||
17 | package org.onosproject.yangutils.parser.impl.listeners; | 17 | package org.onosproject.yangutils.parser.impl.listeners; |
18 | 18 | ||
19 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 19 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
20 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; | 20 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
21 | import org.onosproject.yangutils.datamodel.YangLeaf; | 21 | import org.onosproject.yangutils.datamodel.YangLeaf; |
22 | import org.onosproject.yangutils.datamodel.YangLeafList; | 22 | import org.onosproject.yangutils.datamodel.YangLeafList; | ... | ... |
... | @@ -22,7 +22,7 @@ import java.util.HashMap; | ... | @@ -22,7 +22,7 @@ import java.util.HashMap; |
22 | import java.util.List; | 22 | import java.util.List; |
23 | import java.util.Map; | 23 | import java.util.Map; |
24 | 24 | ||
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangEnum; | 26 | import org.onosproject.yangutils.datamodel.YangEnum; |
27 | import org.onosproject.yangutils.datamodel.YangEnumeration; | 27 | import org.onosproject.yangutils.datamodel.YangEnumeration; |
28 | import org.onosproject.yangutils.datamodel.YangNode; | 28 | import org.onosproject.yangutils.datamodel.YangNode; | ... | ... |
... | @@ -17,7 +17,7 @@ | ... | @@ -17,7 +17,7 @@ |
17 | package org.onosproject.yangutils.translator.tojava.javamodel; | 17 | package org.onosproject.yangutils.translator.tojava.javamodel; |
18 | 18 | ||
19 | import java.util.Stack; | 19 | import java.util.Stack; |
20 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 20 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
21 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; | 21 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
22 | import org.onosproject.yangutils.datamodel.YangEnumeration; | 22 | import org.onosproject.yangutils.datamodel.YangEnumeration; |
23 | import org.onosproject.yangutils.datamodel.YangNode; | 23 | import org.onosproject.yangutils.datamodel.YangNode; | ... | ... |
... | @@ -18,7 +18,7 @@ package org.onosproject.yangutils.translator.tojava.utils; | ... | @@ -18,7 +18,7 @@ package org.onosproject.yangutils.translator.tojava.utils; |
18 | 18 | ||
19 | import java.util.List; | 19 | import java.util.List; |
20 | import java.util.Map; | 20 | import java.util.Map; |
21 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 21 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
22 | import org.onosproject.yangutils.datamodel.YangType; | 22 | import org.onosproject.yangutils.datamodel.YangType; |
23 | import org.onosproject.yangutils.translator.exception.TranslatorException; | 23 | import org.onosproject.yangutils.translator.exception.TranslatorException; |
24 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; | 24 | import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo; | ... | ... |
... | @@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangModule; | ... | @@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangModule; |
25 | import org.onosproject.yangutils.datamodel.YangAugment; | 25 | import org.onosproject.yangutils.datamodel.YangAugment; |
26 | import org.onosproject.yangutils.datamodel.YangLeaf; | 26 | import org.onosproject.yangutils.datamodel.YangLeaf; |
27 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; | 27 | import org.onosproject.yangutils.datamodel.YangNodeIdentifier; |
28 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 28 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
29 | import org.onosproject.yangutils.datamodel.YangNodeType; | 29 | import org.onosproject.yangutils.datamodel.YangNodeType; |
30 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 30 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
31 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 31 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | ... | ... |
... | @@ -21,7 +21,7 @@ import static org.hamcrest.core.Is.is; | ... | @@ -21,7 +21,7 @@ import static org.hamcrest.core.Is.is; |
21 | import org.junit.Test; | 21 | import org.junit.Test; |
22 | import org.onosproject.yangutils.datamodel.YangBit; | 22 | import org.onosproject.yangutils.datamodel.YangBit; |
23 | import org.onosproject.yangutils.datamodel.YangBits; | 23 | import org.onosproject.yangutils.datamodel.YangBits; |
24 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 24 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
25 | import org.onosproject.yangutils.datamodel.YangLeaf; | 25 | import org.onosproject.yangutils.datamodel.YangLeaf; |
26 | import org.onosproject.yangutils.datamodel.YangModule; | 26 | import org.onosproject.yangutils.datamodel.YangModule; |
27 | import org.onosproject.yangutils.datamodel.YangNode; | 27 | import org.onosproject.yangutils.datamodel.YangNode; | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Rule; | ... | @@ -22,7 +22,7 @@ import org.junit.Rule; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.junit.rules.ExpectedException; | 23 | import org.junit.rules.ExpectedException; |
24 | import org.onosproject.yangutils.datamodel.YangContainer; | 24 | import org.onosproject.yangutils.datamodel.YangContainer; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangLeaf; | 26 | import org.onosproject.yangutils.datamodel.YangLeaf; |
27 | import org.onosproject.yangutils.datamodel.YangLeafList; | 27 | import org.onosproject.yangutils.datamodel.YangLeafList; |
28 | import org.onosproject.yangutils.datamodel.YangList; | 28 | import org.onosproject.yangutils.datamodel.YangList; | ... | ... |
... | @@ -23,7 +23,7 @@ import org.junit.Rule; | ... | @@ -23,7 +23,7 @@ import org.junit.Rule; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.junit.rules.ExpectedException; | 24 | import org.junit.rules.ExpectedException; |
25 | import org.onosproject.yangutils.datamodel.YangContainer; | 25 | import org.onosproject.yangutils.datamodel.YangContainer; |
26 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 26 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
27 | import org.onosproject.yangutils.datamodel.YangLeaf; | 27 | import org.onosproject.yangutils.datamodel.YangLeaf; |
28 | import org.onosproject.yangutils.datamodel.YangList; | 28 | import org.onosproject.yangutils.datamodel.YangList; |
29 | import org.onosproject.yangutils.datamodel.YangModule; | 29 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Rule; | ... | @@ -22,7 +22,7 @@ import org.junit.Rule; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.junit.rules.ExpectedException; | 23 | import org.junit.rules.ExpectedException; |
24 | import org.onosproject.yangutils.datamodel.YangContainer; | 24 | import org.onosproject.yangutils.datamodel.YangContainer; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangLeaf; | 26 | import org.onosproject.yangutils.datamodel.YangLeaf; |
27 | import org.onosproject.yangutils.datamodel.YangLeafList; | 27 | import org.onosproject.yangutils.datamodel.YangLeafList; |
28 | import org.onosproject.yangutils.datamodel.YangList; | 28 | import org.onosproject.yangutils.datamodel.YangList; | ... | ... |
... | @@ -22,7 +22,7 @@ import static org.hamcrest.core.Is.is; | ... | @@ -22,7 +22,7 @@ import static org.hamcrest.core.Is.is; |
22 | import org.junit.Rule; | 22 | import org.junit.Rule; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.junit.rules.ExpectedException; | 24 | import org.junit.rules.ExpectedException; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangEnum; | 26 | import org.onosproject.yangutils.datamodel.YangEnum; |
27 | import org.onosproject.yangutils.datamodel.YangEnumeration; | 27 | import org.onosproject.yangutils.datamodel.YangEnumeration; |
28 | import org.onosproject.yangutils.datamodel.YangLeaf; | 28 | import org.onosproject.yangutils.datamodel.YangLeaf; | ... | ... |
... | @@ -30,7 +30,7 @@ import org.onosproject.yangutils.datamodel.YangList; | ... | @@ -30,7 +30,7 @@ import org.onosproject.yangutils.datamodel.YangList; |
30 | import org.onosproject.yangutils.datamodel.YangContainer; | 30 | import org.onosproject.yangutils.datamodel.YangContainer; |
31 | import org.onosproject.yangutils.datamodel.YangTypeDef; | 31 | import org.onosproject.yangutils.datamodel.YangTypeDef; |
32 | import org.onosproject.yangutils.datamodel.YangStatusType; | 32 | import org.onosproject.yangutils.datamodel.YangStatusType; |
33 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 33 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
34 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 34 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
35 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 35 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
36 | 36 | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Rule; | ... | @@ -22,7 +22,7 @@ import org.junit.Rule; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.junit.rules.ExpectedException; | 23 | import org.junit.rules.ExpectedException; |
24 | import org.onosproject.yangutils.datamodel.YangContainer; | 24 | import org.onosproject.yangutils.datamodel.YangContainer; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangLeafList; | 26 | import org.onosproject.yangutils.datamodel.YangLeafList; |
27 | import org.onosproject.yangutils.datamodel.YangList; | 27 | import org.onosproject.yangutils.datamodel.YangList; |
28 | import org.onosproject.yangutils.datamodel.YangModule; | 28 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -23,7 +23,7 @@ import org.junit.Rule; | ... | @@ -23,7 +23,7 @@ import org.junit.Rule; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.junit.rules.ExpectedException; | 24 | import org.junit.rules.ExpectedException; |
25 | import org.onosproject.yangutils.datamodel.YangContainer; | 25 | import org.onosproject.yangutils.datamodel.YangContainer; |
26 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 26 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
27 | import org.onosproject.yangutils.datamodel.YangLeaf; | 27 | import org.onosproject.yangutils.datamodel.YangLeaf; |
28 | import org.onosproject.yangutils.datamodel.YangList; | 28 | import org.onosproject.yangutils.datamodel.YangList; |
29 | import org.onosproject.yangutils.datamodel.YangModule; | 29 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -22,7 +22,7 @@ import java.util.ListIterator; | ... | @@ -22,7 +22,7 @@ import java.util.ListIterator; |
22 | import org.junit.Rule; | 22 | import org.junit.Rule; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.junit.rules.ExpectedException; | 24 | import org.junit.rules.ExpectedException; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangLeaf; | 26 | import org.onosproject.yangutils.datamodel.YangLeaf; |
27 | import org.onosproject.yangutils.datamodel.YangLeafList; | 27 | import org.onosproject.yangutils.datamodel.YangLeafList; |
28 | import org.onosproject.yangutils.datamodel.YangModule; | 28 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -23,7 +23,7 @@ import org.junit.Rule; | ... | @@ -23,7 +23,7 @@ import org.junit.Rule; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.junit.rules.ExpectedException; | 24 | import org.junit.rules.ExpectedException; |
25 | import org.onosproject.yangutils.datamodel.YangContainer; | 25 | import org.onosproject.yangutils.datamodel.YangContainer; |
26 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 26 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
27 | import org.onosproject.yangutils.datamodel.YangLeaf; | 27 | import org.onosproject.yangutils.datamodel.YangLeaf; |
28 | import org.onosproject.yangutils.datamodel.YangList; | 28 | import org.onosproject.yangutils.datamodel.YangList; |
29 | import org.onosproject.yangutils.datamodel.YangModule; | 29 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -20,7 +20,7 @@ import java.io.IOException; | ... | @@ -20,7 +20,7 @@ import java.io.IOException; |
20 | import java.util.ListIterator; | 20 | import java.util.ListIterator; |
21 | import org.junit.Test; | 21 | import org.junit.Test; |
22 | import org.onosproject.yangutils.datamodel.YangContainer; | 22 | import org.onosproject.yangutils.datamodel.YangContainer; |
23 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 23 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
24 | import org.onosproject.yangutils.datamodel.YangLeaf; | 24 | import org.onosproject.yangutils.datamodel.YangLeaf; |
25 | import org.onosproject.yangutils.datamodel.YangList; | 25 | import org.onosproject.yangutils.datamodel.YangList; |
26 | import org.onosproject.yangutils.datamodel.YangModule; | 26 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -20,7 +20,7 @@ import java.io.IOException; | ... | @@ -20,7 +20,7 @@ import java.io.IOException; |
20 | import java.util.ListIterator; | 20 | import java.util.ListIterator; |
21 | 21 | ||
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 23 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
24 | import org.onosproject.yangutils.datamodel.YangLeaf; | 24 | import org.onosproject.yangutils.datamodel.YangLeaf; |
25 | import org.onosproject.yangutils.datamodel.YangLeafList; | 25 | import org.onosproject.yangutils.datamodel.YangLeafList; |
26 | import org.onosproject.yangutils.datamodel.YangModule; | 26 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -21,7 +21,7 @@ import static org.hamcrest.core.Is.is; | ... | @@ -21,7 +21,7 @@ import static org.hamcrest.core.Is.is; |
21 | import org.junit.Test; | 21 | import org.junit.Test; |
22 | import org.onosproject.yangutils.datamodel.YangBit; | 22 | import org.onosproject.yangutils.datamodel.YangBit; |
23 | import org.onosproject.yangutils.datamodel.YangBits; | 23 | import org.onosproject.yangutils.datamodel.YangBits; |
24 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 24 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
25 | import org.onosproject.yangutils.datamodel.YangLeaf; | 25 | import org.onosproject.yangutils.datamodel.YangLeaf; |
26 | import org.onosproject.yangutils.datamodel.YangModule; | 26 | import org.onosproject.yangutils.datamodel.YangModule; |
27 | import org.onosproject.yangutils.datamodel.YangNode; | 27 | import org.onosproject.yangutils.datamodel.YangNode; | ... | ... |
... | @@ -21,7 +21,7 @@ import java.util.ListIterator; | ... | @@ -21,7 +21,7 @@ import java.util.ListIterator; |
21 | import org.junit.Rule; | 21 | import org.junit.Rule; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.junit.rules.ExpectedException; | 23 | import org.junit.rules.ExpectedException; |
24 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 24 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
25 | import org.onosproject.yangutils.datamodel.YangLeaf; | 25 | import org.onosproject.yangutils.datamodel.YangLeaf; |
26 | import org.onosproject.yangutils.datamodel.YangLeafList; | 26 | import org.onosproject.yangutils.datamodel.YangLeafList; |
27 | import org.onosproject.yangutils.datamodel.YangModule; | 27 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Rule; | ... | @@ -22,7 +22,7 @@ import org.junit.Rule; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.junit.rules.ExpectedException; | 23 | import org.junit.rules.ExpectedException; |
24 | import org.onosproject.yangutils.datamodel.YangContainer; | 24 | import org.onosproject.yangutils.datamodel.YangContainer; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangLeaf; | 26 | import org.onosproject.yangutils.datamodel.YangLeaf; |
27 | import org.onosproject.yangutils.datamodel.YangLeafList; | 27 | import org.onosproject.yangutils.datamodel.YangLeafList; |
28 | import org.onosproject.yangutils.datamodel.YangList; | 28 | import org.onosproject.yangutils.datamodel.YangList; | ... | ... |
... | @@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangRpc; | ... | @@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangRpc; |
25 | import org.onosproject.yangutils.datamodel.YangTypeDef; | 25 | import org.onosproject.yangutils.datamodel.YangTypeDef; |
26 | import org.onosproject.yangutils.datamodel.YangStatusType; | 26 | import org.onosproject.yangutils.datamodel.YangStatusType; |
27 | import org.onosproject.yangutils.datamodel.YangNodeType; | 27 | import org.onosproject.yangutils.datamodel.YangNodeType; |
28 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 28 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
29 | import org.onosproject.yangutils.parser.exceptions.ParserException; | 29 | import org.onosproject.yangutils.parser.exceptions.ParserException; |
30 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | 30 | import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
31 | 31 | ... | ... |
... | @@ -22,7 +22,7 @@ import org.junit.Rule; | ... | @@ -22,7 +22,7 @@ import org.junit.Rule; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | import org.junit.rules.ExpectedException; | 23 | import org.junit.rules.ExpectedException; |
24 | import org.onosproject.yangutils.datamodel.YangContainer; | 24 | import org.onosproject.yangutils.datamodel.YangContainer; |
25 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 25 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
26 | import org.onosproject.yangutils.datamodel.YangLeaf; | 26 | import org.onosproject.yangutils.datamodel.YangLeaf; |
27 | import org.onosproject.yangutils.datamodel.YangLeafList; | 27 | import org.onosproject.yangutils.datamodel.YangLeafList; |
28 | import org.onosproject.yangutils.datamodel.YangList; | 28 | import org.onosproject.yangutils.datamodel.YangList; | ... | ... |
... | @@ -20,7 +20,7 @@ import java.util.ListIterator; | ... | @@ -20,7 +20,7 @@ import java.util.ListIterator; |
20 | import org.junit.Rule; | 20 | import org.junit.Rule; |
21 | import org.junit.Test; | 21 | import org.junit.Test; |
22 | import org.junit.rules.ExpectedException; | 22 | import org.junit.rules.ExpectedException; |
23 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 23 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
24 | import org.onosproject.yangutils.datamodel.YangLeaf; | 24 | import org.onosproject.yangutils.datamodel.YangLeaf; |
25 | import org.onosproject.yangutils.datamodel.YangLeafList; | 25 | import org.onosproject.yangutils.datamodel.YangLeafList; |
26 | import org.onosproject.yangutils.datamodel.YangModule; | 26 | import org.onosproject.yangutils.datamodel.YangModule; | ... | ... |
... | @@ -20,7 +20,7 @@ import java.io.IOException; | ... | @@ -20,7 +20,7 @@ import java.io.IOException; |
20 | import java.util.List; | 20 | import java.util.List; |
21 | import java.util.ListIterator; | 21 | import java.util.ListIterator; |
22 | import org.junit.Test; | 22 | import org.junit.Test; |
23 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 23 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
24 | import org.onosproject.yangutils.datamodel.YangLeaf; | 24 | import org.onosproject.yangutils.datamodel.YangLeaf; |
25 | import org.onosproject.yangutils.datamodel.YangLeafList; | 25 | import org.onosproject.yangutils.datamodel.YangLeafList; |
26 | import org.onosproject.yangutils.datamodel.YangList; | 26 | import org.onosproject.yangutils.datamodel.YangList; | ... | ... |
... | @@ -19,7 +19,7 @@ package org.onosproject.yangutils.parser.impl.listeners; | ... | @@ -19,7 +19,7 @@ package org.onosproject.yangutils.parser.impl.listeners; |
19 | import static org.hamcrest.MatcherAssert.assertThat; | 19 | import static org.hamcrest.MatcherAssert.assertThat; |
20 | import static org.hamcrest.core.Is.is; | 20 | import static org.hamcrest.core.Is.is; |
21 | import org.junit.Test; | 21 | import org.junit.Test; |
22 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 22 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
23 | import org.onosproject.yangutils.datamodel.YangEnum; | 23 | import org.onosproject.yangutils.datamodel.YangEnum; |
24 | import org.onosproject.yangutils.datamodel.YangEnumeration; | 24 | import org.onosproject.yangutils.datamodel.YangEnumeration; |
25 | import org.onosproject.yangutils.datamodel.YangLeaf; | 25 | import org.onosproject.yangutils.datamodel.YangLeaf; | ... | ... |
... | @@ -21,7 +21,7 @@ import java.util.Iterator; | ... | @@ -21,7 +21,7 @@ import java.util.Iterator; |
21 | import java.util.ListIterator; | 21 | import java.util.ListIterator; |
22 | import org.apache.maven.plugin.MojoExecutionException; | 22 | import org.apache.maven.plugin.MojoExecutionException; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 24 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
25 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; | 25 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
26 | import org.onosproject.yangutils.datamodel.YangGrouping; | 26 | import org.onosproject.yangutils.datamodel.YangGrouping; |
27 | import org.onosproject.yangutils.datamodel.YangLeaf; | 27 | import org.onosproject.yangutils.datamodel.YangLeaf; |
... | @@ -39,8 +39,8 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ... | @@ -39,8 +39,8 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; |
39 | import static org.hamcrest.CoreMatchers.nullValue; | 39 | import static org.hamcrest.CoreMatchers.nullValue; |
40 | import static org.hamcrest.MatcherAssert.assertThat; | 40 | import static org.hamcrest.MatcherAssert.assertThat; |
41 | import static org.hamcrest.core.Is.is; | 41 | import static org.hamcrest.core.Is.is; |
42 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 42 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
43 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 43 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
44 | import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE; | 44 | import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE; |
45 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; | 45 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; |
46 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | 46 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory; | ... | ... |
... | @@ -41,8 +41,8 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ... | @@ -41,8 +41,8 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; |
41 | 41 | ||
42 | import static org.hamcrest.MatcherAssert.assertThat; | 42 | import static org.hamcrest.MatcherAssert.assertThat; |
43 | import static org.hamcrest.core.Is.is; | 43 | import static org.hamcrest.core.Is.is; |
44 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 44 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
45 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 45 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
46 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; | 46 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; |
47 | import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.deSerializeDataModel; | 47 | import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.deSerializeDataModel; |
48 | import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.parseJarFile; | 48 | import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.parseJarFile; | ... | ... |
... | @@ -33,10 +33,10 @@ import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; | ... | @@ -33,10 +33,10 @@ import org.onosproject.yangutils.parser.impl.YangUtilsParserManager; |
33 | import static org.hamcrest.CoreMatchers.nullValue; | 33 | import static org.hamcrest.CoreMatchers.nullValue; |
34 | import static org.hamcrest.MatcherAssert.assertThat; | 34 | import static org.hamcrest.MatcherAssert.assertThat; |
35 | import static org.hamcrest.core.Is.is; | 35 | import static org.hamcrest.core.Is.is; |
36 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY; | 36 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY; |
37 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 37 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
38 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32; | 38 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; |
39 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 39 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
40 | import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE; | 40 | import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE; |
41 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED; | 41 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED; |
42 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; | 42 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; | ... | ... |
... | @@ -23,7 +23,7 @@ import org.junit.Rule; | ... | @@ -23,7 +23,7 @@ import org.junit.Rule; |
23 | import org.junit.Test; | 23 | import org.junit.Test; |
24 | import org.junit.rules.ExpectedException; | 24 | import org.junit.rules.ExpectedException; |
25 | import org.onosproject.yangutils.datamodel.YangContainer; | 25 | import org.onosproject.yangutils.datamodel.YangContainer; |
26 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 26 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
27 | import org.onosproject.yangutils.datamodel.YangGrouping; | 27 | import org.onosproject.yangutils.datamodel.YangGrouping; |
28 | import org.onosproject.yangutils.datamodel.YangLeaf; | 28 | import org.onosproject.yangutils.datamodel.YangLeaf; |
29 | import org.onosproject.yangutils.datamodel.YangList; | 29 | import org.onosproject.yangutils.datamodel.YangList; | ... | ... |
... | @@ -40,9 +40,9 @@ import static org.hamcrest.CoreMatchers.nullValue; | ... | @@ -40,9 +40,9 @@ import static org.hamcrest.CoreMatchers.nullValue; |
40 | import static org.hamcrest.MatcherAssert.assertThat; | 40 | import static org.hamcrest.MatcherAssert.assertThat; |
41 | import static org.hamcrest.core.Is.is; | 41 | import static org.hamcrest.core.Is.is; |
42 | import static org.hamcrest.core.IsNull.notNullValue; | 42 | import static org.hamcrest.core.IsNull.notNullValue; |
43 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 43 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
44 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32; | 44 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; |
45 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 45 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
46 | import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE; | 46 | import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE; |
47 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; | 47 | import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED; |
48 | 48 | ... | ... |
... | @@ -19,7 +19,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel; | ... | @@ -19,7 +19,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel; |
19 | import java.lang.reflect.Constructor; | 19 | import java.lang.reflect.Constructor; |
20 | import java.lang.reflect.InvocationTargetException; | 20 | import java.lang.reflect.InvocationTargetException; |
21 | import org.junit.Test; | 21 | import org.junit.Test; |
22 | -import org.onosproject.yangutils.datamodel.YangDataTypes; | 22 | +import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes; |
23 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; | 23 | import org.onosproject.yangutils.datamodel.YangDerivedInfo; |
24 | import org.onosproject.yangutils.datamodel.YangNode; | 24 | import org.onosproject.yangutils.datamodel.YangNode; |
25 | import org.onosproject.yangutils.datamodel.YangType; | 25 | import org.onosproject.yangutils.datamodel.YangType; |
... | @@ -30,11 +30,11 @@ import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; | ... | @@ -30,11 +30,11 @@ import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil; |
30 | import static org.hamcrest.core.Is.is; | 30 | import static org.hamcrest.core.Is.is; |
31 | import static org.hamcrest.core.IsNot.not; | 31 | import static org.hamcrest.core.IsNot.not; |
32 | import static org.junit.Assert.assertThat; | 32 | import static org.junit.Assert.assertThat; |
33 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.BOOLEAN; | 33 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BOOLEAN; |
34 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED; | 34 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED; |
35 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32; | 35 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32; |
36 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 36 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
37 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT8; | 37 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT8; |
38 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaDataType; | 38 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaDataType; |
39 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportClass; | 39 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportClass; |
40 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportPackage; | 40 | import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportPackage; | ... | ... |
... | @@ -28,7 +28,7 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; | ... | @@ -28,7 +28,7 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig; |
28 | import static org.hamcrest.core.Is.is; | 28 | import static org.hamcrest.core.Is.is; |
29 | import static org.hamcrest.core.IsNot.not; | 29 | import static org.hamcrest.core.IsNot.not; |
30 | import static org.junit.Assert.assertThat; | 30 | import static org.junit.Assert.assertThat; |
31 | -import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING; | 31 | +import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING; |
32 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; | 32 | import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER; |
33 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; | 33 | import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase; |
34 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuild; | 34 | import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuild; | ... | ... |
-
Please register or login to post a comment