Gaurav Agrawal
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 277 additions and 142 deletions
......@@ -13,11 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.DataTypeException;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt16;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt32;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt64;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangInt8;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint16;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint32;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint64;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint8;
/**
* Factory to create an object of required type.
......
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.yangutils.datamodel;
/**
* Abstraction of YANG data node, used by YMS to abstractly refer the data
* nodes in YANG data tree.
*/
public interface YangDataNode {
}
......@@ -20,22 +20,23 @@ import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import com.google.common.base.Strings;
import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY;
import static org.onosproject.yangutils.datamodel.YangDataTypes.BITS;
import static org.onosproject.yangutils.datamodel.YangDataTypes.BOOLEAN;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.YangDataTypes.EMPTY;
import static org.onosproject.yangutils.datamodel.YangDataTypes.ENUMERATION;
import static org.onosproject.yangutils.datamodel.YangDataTypes.IDENTITYREF;
import static org.onosproject.yangutils.datamodel.YangDataTypes.LEAFREF;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.YangDataTypes.UNION;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BITS;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BOOLEAN;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.EMPTY;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.ENUMERATION;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.IDENTITYREF;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.LEAFREF;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UNION;
import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED;
import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED;
import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.isOfRangeRestrictedType;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypeUtils.isOfRangeRestrictedType;
import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processLengthRestriction;
import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processRangeRestriction;
......
......@@ -62,7 +62,7 @@ import org.onosproject.yangutils.datamodel.utils.YangConstructType;
*/
public class YangLeaf
implements YangCommonInfo, Parsable, Cloneable, Serializable,
YangMustHolder, YangIfFeatureHolder, YangWhenHolder {
YangMustHolder, YangIfFeatureHolder, YangWhenHolder, YangDataNode {
private static final long serialVersionUID = 806201635L;
......
......@@ -58,7 +58,7 @@ import org.onosproject.yangutils.datamodel.utils.YangConstructType;
*/
public class YangLeafList
implements YangCommonInfo, Parsable, Cloneable, Serializable,
YangMustHolder, YangWhenHolder, YangIfFeatureHolder {
YangMustHolder, YangWhenHolder, YangIfFeatureHolder, YangDataNode {
private static final long serialVersionUID = 806201637L;
......
......@@ -22,6 +22,7 @@ import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -70,7 +71,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
public class YangList
extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder,
YangMustHolder, YangIfFeatureHolder {
YangMustHolder, YangIfFeatureHolder, YangDataNode {
private static final long serialVersionUID = 806201609L;
......
......@@ -16,14 +16,13 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
/**
* Represents base class of a node in data model tree.
*/
public abstract class YangNode
implements Cloneable, Serializable {
implements Cloneable, Serializable, YangDataNode {
private static final long serialVersionUID = 806201601L;
......
......@@ -19,14 +19,13 @@ package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.BuiltInTypeObjectFactory.getDataObjectFromString;
import static org.onosproject.yangutils.datamodel.BuiltInTypeObjectFactory.getDataObjectFromString;
import static com.google.common.base.Preconditions.checkNotNull;
/*-
......@@ -208,7 +207,6 @@ public class YangRangeRestriction<T extends YangBuiltInDataTypeInfo<T>>
return true;
}
}
return false;
}
......
......@@ -17,13 +17,15 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.BuiltInTypeObjectFactory.getDataObjectFromString;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypeUtils.isOfRangeRestrictedType;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
/*
* Reference:RFC 6020.
......@@ -271,4 +273,101 @@ public class YangType<T>
throw new DataModelException(e.getMessage());
}
}
/**
* Validates the input data value against the permissible value for the
* type as per the YANG file.
*
* @param value input data value
* @return status of validation
*/
public boolean isValidValue(String value) {
switch (getDataType()) {
case INT8:
case INT16:
case INT32:
case INT64:
case UINT8:
case UINT16:
case UINT32:
case UINT64: {
isValidValueForRangeRestrictedType(value);
}
case DECIMAL64: {
// TODO
}
case STRING: {
// TODO implement in string restriction similar to range restriction
}
case ENUMERATION: {
// TODO validate using list of YANG enum of enumeration class in extended info.
}
case BINARY: {
// TODO validate based on extended info
}
case BITS: {
// TODO validate based on extended info
}
case BOOLEAN: {
// TODO true or false
}
case LEAFREF: {
// TODO validate based on extended info
}
case IDENTITYREF: {
// TODO TBD
}
case EMPTY: {
// TODO true or false
}
case UNION: {
// TODO validate based on extended info
}
case INSTANCE_IDENTIFIER: {
// TODO TBD
}
case DERIVED: {
if (isOfRangeRestrictedType(((YangDerivedInfo) getDataTypeExtendedInfo()).getEffectiveBuiltInType())) {
try {
if (((YangDerivedInfo) getDataTypeExtendedInfo()).getResolvedExtendedInfo() == null) {
getDataObjectFromString(value,
((YangDerivedInfo) getDataTypeExtendedInfo()).getEffectiveBuiltInType());
return true;
} else {
return ((YangRangeRestriction) ((YangDerivedInfo) getDataTypeExtendedInfo())
.getResolvedExtendedInfo()).isValidValueString(value);
}
} catch (Exception e) {
return false;
}
} else {
// TODO
}
}
default: {
// TODO
}
}
return true;
}
/**
* Validates the input data value for range restricted types against the
* permissible value for the type as per the YANG file.
*
* @param value input data value
* @return status of validation
*/
private boolean isValidValueForRangeRestrictedType(String value) {
try {
if (getDataTypeExtendedInfo() == null) {
getDataObjectFromString(value, getDataType());
return true;
} else {
return ((YangRangeRestriction) getDataTypeExtendedInfo()).isValidValueString(value);
}
} catch (Exception e) {
return false;
}
}
}
......
......@@ -22,6 +22,7 @@ import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
/*
* Reference RFC 6020.
......
......@@ -16,26 +16,16 @@
package org.onosproject.yangutils.datamodel.utils;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DECIMAL64;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT16;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT64;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT8;
import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT16;
import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT32;
import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT64;
import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT8;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.BuiltInTypeObjectFactory.getDataObjectFromString;
import java.util.regex.Pattern;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangRangeInterval;
import org.onosproject.yangutils.datamodel.YangRangeRestriction;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import static org.onosproject.yangutils.datamodel.BuiltInTypeObjectFactory.getDataObjectFromString;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA;
/**
* Represents restriction resolver which provide common utility used by parser
......@@ -232,24 +222,6 @@ public final class RestrictionResolver {
}
/**
* Returns whether the data type is of range restricted type.
*
* @param dataType data type to be checked
* @return true, if data type can have range restrictions, false otherwise
*/
public static boolean isOfRangeRestrictedType(YangDataTypes dataType) {
return dataType == INT8
|| dataType == INT16
|| dataType == INT32
|| dataType == INT64
|| dataType == UINT8
|| dataType == UINT16
|| dataType == UINT32
|| dataType == UINT64
|| dataType == DECIMAL64;
}
/**
* Removes doubles quotes and concatenates if string has plus symbol.
*
* @param yangStringData string from yang file
......
......@@ -15,8 +15,6 @@
*/
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Represents the list of utility functions to be supported by YANG built in
* data type implementations.
......
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DECIMAL64;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT16;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT64;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT8;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT16;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT32;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT64;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT8;
/**
* Represents YANG data type utilities.
*/
public final class YangDataTypeUtils {
/**
* Restricts creation of YANG data type utils instance.
*/
private YangDataTypeUtils() {
}
/**
* Returns whether the data type is of range restricted type.
*
* @param dataType data type to be checked
* @return true, if data type can have range restrictions, false otherwise
*/
public static boolean isOfRangeRestrictedType(YangDataTypes dataType) {
return dataType == INT8
|| dataType == INT16
|| dataType == INT32
|| dataType == INT64
|| dataType == UINT8
|| dataType == UINT16
|| dataType == UINT32
|| dataType == UINT64
|| dataType == DECIMAL64;
}
}
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.onosproject.yangutils.datamodel;
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
/**
* Represents ENUM to identify the YANG data type.
......
......@@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's int16 data type processing.
*
......@@ -94,5 +92,4 @@ public class YangInt16 implements YangBuiltInDataTypeInfo<YangInt16>, Serializab
public YangDataTypes getYangType() {
return YangDataTypes.INT16;
}
}
......
......@@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's int32 data type processing.
*
......@@ -94,5 +92,4 @@ public class YangInt32 implements YangBuiltInDataTypeInfo<YangInt32>, Serializab
public YangDataTypes getYangType() {
return YangDataTypes.INT32;
}
}
......
......@@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's int8 data type processing.
*
......@@ -94,5 +92,4 @@ public class YangInt64 implements YangBuiltInDataTypeInfo<YangInt64>, Serializab
public YangDataTypes getYangType() {
return YangDataTypes.INT64;
}
}
......
......@@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's int8 data type processing.
*
......@@ -94,5 +92,4 @@ public class YangInt8 implements YangBuiltInDataTypeInfo<YangInt8>, Serializable
public YangDataTypes getYangType() {
return YangDataTypes.INT8;
}
}
......
......@@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's Uint16 data type processing.
*
......@@ -60,7 +58,7 @@ public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16>, Serializ
*
* @param valueInString value of the object in string
*/
YangUint16(String valueInString) {
public YangUint16(String valueInString) {
if (valueInString.matches(MIN_KEYWORD)) {
value = MIN_VALUE;
......@@ -102,5 +100,4 @@ public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16>, Serializ
public YangDataTypes getYangType() {
return YangDataTypes.UINT16;
}
}
......
......@@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's Uint32 data type processing.
*
......@@ -53,7 +51,7 @@ public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32>, Serializ
*
* @param valueInString value of the object in string
*/
YangUint32(String valueInString) {
public YangUint32(String valueInString) {
if (valueInString.matches(MIN_KEYWORD)) {
value = MIN_VALUE;
......@@ -95,5 +93,4 @@ public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32>, Serializ
public YangDataTypes getYangType() {
return YangDataTypes.UINT32;
}
}
......
......@@ -20,8 +20,6 @@ import java.io.Serializable;
import java.math.BigInteger;
import java.util.regex.Pattern;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's Uint16 data type processing.
*
......@@ -67,7 +65,7 @@ public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64>, Serializ
*
* @param valueInString value of the object in string
*/
YangUint64(String valueInString) {
public YangUint64(String valueInString) {
if (valueInString.matches(MIN_KEYWORD)) {
value = MIN_VALUE;
......@@ -107,5 +105,4 @@ public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64>, Serializ
public YangDataTypes getYangType() {
return YangDataTypes.UINT64;
}
}
......
......@@ -18,8 +18,6 @@ package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's Uint8 data type processing.
*
......@@ -60,7 +58,7 @@ public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8>, Serializab
*
* @param valueInString value of the object in string
*/
YangUint8(String valueInString) {
public YangUint8(String valueInString) {
if (valueInString.matches(MIN_KEYWORD)) {
value = MIN_VALUE;
......@@ -102,5 +100,4 @@ public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8>, Serializab
public YangDataTypes getYangType() {
return YangDataTypes.UINT8;
}
}
......
......@@ -22,7 +22,7 @@ import java.util.List;
import java.util.Stack;
import org.onosproject.yangutils.datamodel.Resolvable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangDerivedInfo;
import org.onosproject.yangutils.datamodel.YangEntityToResolveInfo;
import org.onosproject.yangutils.datamodel.YangFeature;
......
......@@ -27,9 +27,9 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.TreeWalkListener;
import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processLengthRestriction;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.LENGTH_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
......
......@@ -18,7 +18,7 @@ package org.onosproject.yangutils.parser.impl.listeners;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangDerivedInfo;
import org.onosproject.yangutils.datamodel.YangPatternRestriction;
import org.onosproject.yangutils.datamodel.YangStringRestriction;
......@@ -29,7 +29,7 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.TreeWalkListener;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.PATTERN_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
......
......@@ -25,8 +25,8 @@ import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.TreeWalkListener;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.isOfRangeRestrictedType;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypeUtils.isOfRangeRestrictedType;
import static org.onosproject.yangutils.datamodel.utils.RestrictionResolver.processRangeRestriction;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.RANGE_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.TYPE_DATA;
......
......@@ -16,7 +16,7 @@
package org.onosproject.yangutils.parser.impl.listeners;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangDerivedInfo;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
......
......@@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangEnum;
import org.onosproject.yangutils.datamodel.YangEnumeration;
import org.onosproject.yangutils.datamodel.YangNode;
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.translator.tojava.javamodel;
import java.util.Stack;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangDerivedInfo;
import org.onosproject.yangutils.datamodel.YangEnumeration;
import org.onosproject.yangutils.datamodel.YangNode;
......
......@@ -18,7 +18,7 @@ package org.onosproject.yangutils.translator.tojava.utils;
import java.util.List;
import java.util.Map;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangType;
import org.onosproject.yangutils.translator.exception.TranslatorException;
import org.onosproject.yangutils.translator.tojava.JavaAttributeInfo;
......
......@@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangModule;
import org.onosproject.yangutils.datamodel.YangAugment;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangNodeType;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
......
......@@ -21,7 +21,7 @@ import static org.hamcrest.core.Is.is;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangBit;
import org.onosproject.yangutils.datamodel.YangBits;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangModule;
import org.onosproject.yangutils.datamodel.YangNode;
......
......@@ -22,7 +22,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangList;
......
......@@ -23,7 +23,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -22,7 +22,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangList;
......
......@@ -22,7 +22,7 @@ import static org.hamcrest.core.Is.is;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangEnum;
import org.onosproject.yangutils.datamodel.YangEnumeration;
import org.onosproject.yangutils.datamodel.YangLeaf;
......
......@@ -30,7 +30,7 @@ import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangTypeDef;
import org.onosproject.yangutils.datamodel.YangStatusType;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
......
......@@ -22,7 +22,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -23,7 +23,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -22,7 +22,7 @@ import java.util.ListIterator;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -23,7 +23,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -20,7 +20,7 @@ import java.io.IOException;
import java.util.ListIterator;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -20,7 +20,7 @@ import java.io.IOException;
import java.util.ListIterator;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -21,7 +21,7 @@ import static org.hamcrest.core.Is.is;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangBit;
import org.onosproject.yangutils.datamodel.YangBits;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangModule;
import org.onosproject.yangutils.datamodel.YangNode;
......
......@@ -21,7 +21,7 @@ import java.util.ListIterator;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -22,7 +22,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangList;
......
......@@ -25,7 +25,7 @@ import org.onosproject.yangutils.datamodel.YangRpc;
import org.onosproject.yangutils.datamodel.YangTypeDef;
import org.onosproject.yangutils.datamodel.YangStatusType;
import org.onosproject.yangutils.datamodel.YangNodeType;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
......
......@@ -22,7 +22,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangList;
......
......@@ -20,7 +20,7 @@ import java.util.ListIterator;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangModule;
......
......@@ -20,7 +20,7 @@ import java.io.IOException;
import java.util.List;
import java.util.ListIterator;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangList;
......
......@@ -19,7 +19,7 @@ package org.onosproject.yangutils.parser.impl.listeners;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangEnum;
import org.onosproject.yangutils.datamodel.YangEnumeration;
import org.onosproject.yangutils.datamodel.YangLeaf;
......
......@@ -21,7 +21,7 @@ import java.util.Iterator;
import java.util.ListIterator;
import org.apache.maven.plugin.MojoExecutionException;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangDerivedInfo;
import org.onosproject.yangutils.datamodel.YangGrouping;
import org.onosproject.yangutils.datamodel.YangLeaf;
......@@ -39,8 +39,8 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE;
import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.deleteDirectory;
......
......@@ -41,8 +41,8 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED;
import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.deSerializeDataModel;
import static org.onosproject.yangutils.plugin.manager.YangPluginUtils.parseJarFile;
......
......@@ -33,10 +33,10 @@ import org.onosproject.yangutils.parser.impl.YangUtilsParserManager;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.onosproject.yangutils.datamodel.YangDataTypes.BINARY;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BINARY;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE;
import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.INTRA_FILE_RESOLVED;
import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED;
......
......@@ -23,7 +23,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangGrouping;
import org.onosproject.yangutils.datamodel.YangLeaf;
import org.onosproject.yangutils.datamodel.YangList;
......
......@@ -40,9 +40,9 @@ import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.YangNodeType.MODULE_NODE;
import static org.onosproject.yangutils.datamodel.utils.ResolvableStatus.RESOLVED;
......
......@@ -19,7 +19,7 @@ package org.onosproject.yangutils.translator.tojava.javamodel;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import org.junit.Test;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes;
import org.onosproject.yangutils.datamodel.YangDerivedInfo;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.datamodel.YangType;
......@@ -30,11 +30,11 @@ import org.onosproject.yangutils.utils.io.impl.YangToJavaNamingConflictUtil;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;
import static org.onosproject.yangutils.datamodel.YangDataTypes.BOOLEAN;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.YangDataTypes.UINT8;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.BOOLEAN;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.DERIVED;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.INT32;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.UINT8;
import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaDataType;
import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportClass;
import static org.onosproject.yangutils.translator.tojava.javamodel.AttributesJavaDataType.getJavaImportPackage;
......
......@@ -28,7 +28,7 @@ import org.onosproject.yangutils.utils.io.impl.YangPluginConfig;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;
import static org.onosproject.yangutils.datamodel.YangDataTypes.STRING;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.YangDataTypes.STRING;
import static org.onosproject.yangutils.translator.tojava.GeneratedJavaFileType.GENERATE_SERVICE_AND_MANAGER;
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getCapitalCase;
import static org.onosproject.yangutils.translator.tojava.utils.MethodsGenerator.getBuild;
......