Bharat saraswal
Committed by Gerrit Code Review

[ONOS-4350] Inter Jar dependency implementation and code restructuring.

Change-Id: Iacac75e4187aed93ce1754c170a9c19707e5b8c3
Showing 990 changed files with 678 additions and 251 deletions
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-yangutils</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>yangutils-datamodel</artifactId>
<version>1.7.0-SNAPSHOT</version>
<name>onos-yang-utils-datamodel</name>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.datamodel;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/**
* Abstraction of YANG collision function. Abstracted to unify the collision
......
......@@ -14,9 +14,10 @@
* limitations under the License.
*/
package org.onosproject.yangutils.linker;
package org.onosproject.yangutils.datamodel;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
/**
* Abstraction of YANG resolvable information. Abstracted to obtain the
......
......@@ -19,8 +19,8 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -83,6 +83,8 @@ public class YangAugment
extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
private static final long serialVersionUID = 806201602L;
/**
* Augment target node.
*/
......@@ -140,7 +142,7 @@ public class YangAugment
* @param nodeIdentifiers the augmented node
*/
public void setTargetNode(List<YangNodeIdentifier> nodeIdentifiers) {
this.targetNode = nodeIdentifiers;
targetNode = nodeIdentifiers;
}
/**
......@@ -173,9 +175,9 @@ public class YangAugment
@Override
public void detectSelfCollision(String identifierName, YangConstructType dataType)
throws DataModelException {
if (this.getName().equals(identifierName)) {
if (getName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate input identifier detected, same as input \""
+ this.getName() + "\"");
+ getName() + "\"");
}
}
......
......@@ -15,10 +15,12 @@
*/
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.Set;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.findReferredNode;
......@@ -49,7 +51,9 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.findRefer
/**
* Represents the belongs-to data type information.
*/
public class YangBelongsTo implements Parsable, LocationInfo {
public class YangBelongsTo implements Parsable, LocationInfo, Serializable {
private static final long serialVersionUID = 806201639L;
/**
* Reference RFC 6020.
......@@ -74,10 +78,10 @@ public class YangBelongsTo implements Parsable, LocationInfo {
private String prefix;
// Error Line number.
private int lineNumber;
private transient int lineNumber;
// Error character position.
private int charPosition;
private transient int charPosition;
/**
* Create a belongs to object.
......@@ -187,7 +191,7 @@ public class YangBelongsTo implements Parsable, LocationInfo {
@Override
public void setCharPosition(int charPositionInLine) {
this.charPosition = charPositionInLine;
charPosition = charPositionInLine;
}
/**
......
......@@ -16,11 +16,12 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.Objects;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*-
* The "bit" statement, which is a sub-statement to the "type" statement,
......@@ -46,7 +47,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
/**
* Represents the bit data type information.
*/
public class YangBit implements YangCommonInfo, Parsable {
public class YangBit implements YangCommonInfo, Parsable, Serializable {
private static final long serialVersionUID = 806201640L;
/**
* Name of the bit.
......@@ -194,14 +197,14 @@ public class YangBit implements YangCommonInfo, Parsable {
}
if (obj instanceof YangBit) {
final YangBit other = (YangBit) obj;
return Objects.equals(this.bitName, other.bitName);
return Objects.equals(bitName, other.bitName);
}
return false;
}
@Override
public int hashCode() {
return Objects.hashCode(this.bitName);
return Objects.hashCode(bitName);
}
/**
......
......@@ -16,12 +16,13 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*
* Reference RFC 6020.
......@@ -34,7 +35,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
/**
* Represents the bits data type information.
*/
public class YangBits implements Parsable {
public class YangBits implements Parsable, Serializable {
private static final long serialVersionUID = 806201641L;
// Bits information set.
private Set<YangBit> bitSet;
......
......@@ -19,11 +19,11 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
import static org.onosproject.yangutils.utils.YangConstructType.CASE_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CASE_DATA;
/*-
* Reference RFC 6020.
......@@ -96,6 +96,8 @@ public class YangCase
extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
private static final long serialVersionUID = 806201603L;
/**
* Case name.
*/
......
......@@ -16,10 +16,10 @@
package org.onosproject.yangutils.datamodel;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.utils.YangConstructType.CHOICE_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CHOICE_DATA;
/*-
* Reference RFC 6020.
......@@ -62,6 +62,8 @@ import static org.onosproject.yangutils.utils.YangConstructType.CHOICE_DATA;
public class YangChoice extends YangNode
implements YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
private static final long serialVersionUID = 806201604L;
/**
* Name of choice.
*/
......@@ -332,7 +334,7 @@ public class YangChoice extends YangNode
@Override
public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
if (this.getParent() instanceof YangCase && dataType != YangConstructType.CASE_DATA) {
if (getParent() instanceof YangCase && dataType != YangConstructType.CASE_DATA) {
((CollisionDetector) getParent()).detectCollidingChild(identifierName, dataType);
}
YangNode node = getChild();
......
......@@ -20,8 +20,8 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -91,6 +91,8 @@ public class YangContainer
extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
private static final long serialVersionUID = 806201605L;
/**
* Name of the container.
*/
......
......@@ -16,11 +16,12 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.Objects;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*-
* The "ENUM" statement, which is a sub-statement to the "type"
......@@ -50,7 +51,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
/**
* Represents the ENUM data type information.
*/
public class YangEnum implements YangCommonInfo, Parsable, Comparable<YangEnum> {
public class YangEnum implements YangCommonInfo, Parsable, Comparable<YangEnum>, Serializable {
private static final long serialVersionUID = 806201643L;
/**
* Named value for the ENUM.
......@@ -197,14 +200,14 @@ public class YangEnum implements YangCommonInfo, Parsable, Comparable<YangEnum>
}
if (obj instanceof YangEnum) {
final YangEnum other = (YangEnum) obj;
return Objects.equals(this.namedValue, other.namedValue);
return Objects.equals(namedValue, other.namedValue);
}
return false;
}
@Override
public int hashCode() {
return Objects.hashCode(this.namedValue);
return Objects.hashCode(namedValue);
}
/**
......@@ -229,9 +232,9 @@ public class YangEnum implements YangCommonInfo, Parsable, Comparable<YangEnum>
@Override
public int compareTo(YangEnum otherEnum) {
if (this.namedValue.equals(otherEnum.getNamedValue())) {
if (namedValue.equals(otherEnum.getNamedValue())) {
return 0;
}
return new Integer(this.value).compareTo(otherEnum.getValue());
return new Integer(value).compareTo(otherEnum.getValue());
}
}
......
......@@ -20,8 +20,8 @@ import java.util.SortedSet;
import java.util.TreeSet;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*
* The enumeration built-in type represents values from a set of
......@@ -35,6 +35,8 @@ public class YangEnumeration
extends YangNode
implements Parsable, CollisionDetector {
private static final long serialVersionUID = 806201606L;
// Enumeration info set.
private SortedSet<YangEnum> enumSet;
......
......@@ -19,8 +19,8 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -81,6 +81,8 @@ public class YangGrouping
extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
private static final long serialVersionUID = 806201607L;
/**
* Name of the grouping.
*/
......
......@@ -15,10 +15,12 @@
*/
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.Set;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.findReferredNode;
......@@ -67,7 +69,9 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.findRefer
* Represents the information about the imported modules.
*/
public class YangImport
implements Parsable, LocationInfo {
implements Parsable, LocationInfo, Serializable {
private static final long serialVersionUID = 806201642L;
/**
* Name of the module that is being imported.
......@@ -95,10 +99,10 @@ public class YangImport
private YangNode importedNode;
// Error Line number.
private int lineNumber;
private transient int lineNumber;
// Error character position.
private int charPosition;
private transient int charPosition;
/**
* Creates a YANG import.
......@@ -230,7 +234,7 @@ public class YangImport
@Override
public void setCharPosition(int charPositionInLine) {
this.charPosition = charPositionInLine;
charPosition = charPositionInLine;
}
/**
......@@ -244,8 +248,8 @@ public class YangImport
String importedModuleRevision = getRevision();
YangNode moduleNode = null;
/*
* Find the imported module node for a given module name
* with a specified revision if revision is not null.
* Find the imported module node for a given module name with a
* specified revision if revision is not null.
*/
if (importedModuleRevision != null) {
String importedModuleNameWithRevision = importedModuleName + "@" + importedModuleRevision;
......@@ -253,8 +257,8 @@ public class YangImport
}
/*
* Find the imported module node for a given module name
* without revision if can't find with revision.
* Find the imported module node for a given module name without
* revision if can't find with revision.
*/
if (moduleNode == null) {
moduleNode = findReferredNode(yangNodeSet, importedModuleName);
......
......@@ -15,10 +15,12 @@
*/
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.Set;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.findReferredNode;
......@@ -41,7 +43,9 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.findRefer
* Represents the information about the included sub-modules.
*/
public class YangInclude
implements Parsable, LocationInfo {
implements Parsable, LocationInfo, Serializable {
private static final long serialVersionUID = 806201644L;
/**
* Name of the sub-module that is being included.
......@@ -60,10 +64,10 @@ public class YangInclude
private YangNode includedNode;
// Error Line number.
private int lineNumber;
private transient int lineNumber;
// Error character position.
private int charPosition;
private transient int charPosition;
/**
* Creates a YANG include.
......@@ -166,7 +170,7 @@ public class YangInclude
@Override
public void setCharPosition(int charPositionInLine) {
this.charPosition = charPositionInLine;
charPosition = charPositionInLine;
}
/**
......@@ -182,8 +186,8 @@ public class YangInclude
YangNode subModuleNode = null;
/*
* Find the included sub-module node for a given module name
* with a specified revision if revision is not null.
* Find the included sub-module node for a given module name with a
* specified revision if revision is not null.
*/
if (includedSubModuleRevision != null) {
String includedSubModuleNameWithRevision = includedSubModuleName + "@" + includedSubModuleRevision;
......@@ -191,8 +195,8 @@ public class YangInclude
}
/*
* Find the imported sub module node for a given module name
* without revision if can't find with revision.
* Find the imported sub module node for a given module name without
* revision if can't find with revision.
*/
if (subModuleNode == null) {
subModuleNode = findReferredNode(yangNodeSet, includedSubModuleName);
......
......@@ -20,8 +20,8 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -72,6 +72,8 @@ public class YangInput
extends YangNode
implements YangLeavesHolder, Parsable, CollisionDetector, YangAugmentationHolder {
private static final long serialVersionUID = 806201608L;
/**
* Name of the input.
*/
......@@ -106,9 +108,9 @@ public class YangInput
@Override
public void detectSelfCollision(String identifierName, YangConstructType dataType)
throws DataModelException {
if (this.getName().equals(identifierName)) {
if (getName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate input identifier detected, same as input \""
+ this.getName() + "\"");
+ getName() + "\"");
}
}
......
......@@ -16,9 +16,11 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*
* Reference:RFC 6020.
......@@ -58,7 +60,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
* Represents leaf data represented in YANG.
*/
public class YangLeaf
implements YangCommonInfo, Parsable, Cloneable {
implements YangCommonInfo, Parsable, Cloneable, Serializable {
private static final long serialVersionUID = 806201635L;
/**
* Name of leaf.
......@@ -109,7 +113,7 @@ public class YangLeaf
/**
* YANG Node in which the leaf is contained.
*/
YangLeavesHolder containedIn;
private transient YangLeavesHolder containedIn;
/**
* Creates a YANG leaf.
......
......@@ -16,9 +16,11 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*
* Reference:RFC 6020.
......@@ -54,7 +56,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
* Represents leaf-list data represented in YANG.
*/
public class YangLeafList
implements YangCommonInfo, Parsable, Cloneable {
implements YangCommonInfo, Parsable, Cloneable, Serializable {
private static final long serialVersionUID = 806201637L;
/**
* Name of leaf-list.
......@@ -126,7 +130,7 @@ public class YangLeafList
/**
* YANG Node in which the leaf is contained.
*/
YangLeavesHolder containedIn;
private transient YangLeavesHolder containedIn;
/**
* Creates a YANG leaf-list.
......
......@@ -16,6 +16,8 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
/*-
* Reference RFC 6020.
*
......@@ -24,14 +26,14 @@ package org.onosproject.yangutils.datamodel;
*/
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint64;
/**
* Represents the restriction for length data type.
*/
public class YangLengthRestriction implements YangDesc, YangReference, YangAppErrorInfo, Parsable {
public class YangLengthRestriction implements YangDesc, YangReference, YangAppErrorInfo, Parsable, Serializable {
/*-
* Reference RFC 6020.
......@@ -69,6 +71,8 @@ public class YangLengthRestriction implements YangDesc, YangReference, YangAppEr
* +---------------+---------+-------------+-----------------+
*/
private static final long serialVersionUID = 806201645L;
/**
* Length restriction information.
*/
......@@ -207,11 +211,11 @@ public class YangLengthRestriction implements YangDesc, YangReference, YangAppEr
@Override
public void validateDataOnEntry() throws DataModelException {
//TODO: implement the method.
// TODO: implement the method.
}
@Override
public void validateDataOnExit() throws DataModelException {
//TODO: implement the method.
// TODO: implement the method.
}
}
......
......@@ -20,8 +20,8 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -71,6 +71,8 @@ public class YangList
extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
private static final long serialVersionUID = 806201609L;
/**
* Name of the YANG list.
*/
......@@ -619,7 +621,7 @@ public class YangList
}
private boolean isUsesPresentInList() {
YangNode node = this.getChild();
YangNode node = getChild();
while (node != null) {
if (node instanceof YangUses) {
return true;
......@@ -631,7 +633,7 @@ public class YangList
}
private boolean isListPresentInGrouping() {
YangNode node = this.getParent();
YangNode node = getParent();
while (node != null) {
if (node instanceof YangGrouping) {
return true;
......
......@@ -19,9 +19,10 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.linkInterFileReferences;
......@@ -75,6 +76,8 @@ public class YangModule
implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
RpcNotificationContainer {
private static final long serialVersionUID = 806201610L;
/**
* Name of the module.
*/
......
......@@ -15,9 +15,11 @@
*/
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*-
* The "must" statement, which is optional, takes as an argument a string that
......@@ -46,7 +48,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
/**
* Represents information defined in YANG must.
*/
public class YangMust implements YangDesc, YangReference, Parsable {
public class YangMust implements YangDesc, YangReference, Parsable, Serializable {
private static final long serialVersionUID = 806201646L;
/**
* Constraint info.
......
......@@ -16,9 +16,11 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*
* Reference:RFC 6020.
......@@ -32,7 +34,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
/**
* Represents name space to be used for the XML data tree.
*/
public class YangNameSpace implements Parsable {
public class YangNameSpace implements Parsable, Serializable {
private static final long serialVersionUID = 806201647L;
private String uri;
......
......@@ -15,13 +15,17 @@
*/
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 {
implements Cloneable, Serializable {
private static final long serialVersionUID = 806201601L;
/**
* Type of node.
......
......@@ -16,10 +16,14 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
/**
* Represents YANG node identifier which is a combination of prefix and name.
*/
public class YangNodeIdentifier {
public class YangNodeIdentifier implements Serializable {
private static final long serialVersionUID = 806201648L;
// Name of the node.
private String name;
......
......@@ -20,8 +20,8 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -78,6 +78,8 @@ public class YangNotification
extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector, YangAugmentationHolder {
private static final long serialVersionUID = 806201611L;
/**
* Name of the notification.
*/
......@@ -127,9 +129,9 @@ public class YangNotification
@Override
public void detectSelfCollision(String identifierName, YangConstructType dataType)
throws DataModelException {
if (this.getName().equals(identifierName)) {
if (getName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate input identifier detected, same as notification \""
+ this.getName() + "\"");
+ getName() + "\"");
}
}
......
......@@ -20,8 +20,8 @@ import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -71,6 +71,8 @@ public class YangOutput
extends YangNode
implements YangLeavesHolder, Parsable, CollisionDetector, YangAugmentationHolder {
private static final long serialVersionUID = 806201612L;
/**
* Name of the output.
*/
......@@ -105,9 +107,9 @@ public class YangOutput
@Override
public void detectSelfCollision(String identifierName, YangConstructType dataType)
throws DataModelException {
if (this.getName().equals(identifierName)) {
if (getName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate identifier detected, same as output \""
+ this.getName() + "\"");
+ getName() + "\"");
}
}
......
......@@ -16,6 +16,7 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
......@@ -51,7 +52,9 @@ import java.util.List;
* Represents pattern restriction information. The regular expression restriction on string
* data type.
*/
public class YangPatternRestriction {
public class YangPatternRestriction implements Serializable {
private static final long serialVersionUID = 806201649L;
/**
* Pattern restriction defined for the current type.
......
......@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.*/
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo;
/**
......@@ -20,7 +22,9 @@ import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInData
*
* @param <T> range type based on the data type
*/
public class YangRangeInterval<T extends YangBuiltInDataTypeInfo<T>> {
public class YangRangeInterval<T extends YangBuiltInDataTypeInfo<T>> implements Serializable {
private static final long serialVersionUID = 806201650L;
/**
* Starting value of the range interval.
......
......@@ -16,14 +16,17 @@
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.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo;
import static org.onosproject.yangutils.datamodel.utils.builtindatatype.BuiltInTypeObjectFactory.getDataObjectFromString;
import static com.google.common.base.Preconditions.checkNotNull;
/*-
......@@ -57,7 +60,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
* @param <T> range type (data type)
*/
public class YangRangeRestriction<T extends YangBuiltInDataTypeInfo<T>>
implements YangDesc, YangReference, YangAppErrorInfo, Parsable {
implements YangDesc, YangReference, YangAppErrorInfo, Parsable, Serializable {
private static final long serialVersionUID = 8062016051L;
/**
* Ascending list of range interval restriction. If the restriction is a
......@@ -186,7 +191,8 @@ public class YangRangeRestriction<T extends YangBuiltInDataTypeInfo<T>>
if (getAscendingRangeIntervals() == null
|| getAscendingRangeIntervals().isEmpty()) {
// Throw exception, At least one default range needs to be set in constructor or in linker.
// Throw exception, At least one default range needs to be set in
// constructor or in linker.
throw new DataModelException("Range interval missing in range restriction.");
}
......@@ -217,7 +223,8 @@ public class YangRangeRestriction<T extends YangBuiltInDataTypeInfo<T>>
if (getAscendingRangeIntervals() == null
|| getAscendingRangeIntervals().isEmpty()) {
// Throw exception, At least one default range needs to be set in constructor or in linker.
// Throw exception, At least one default range needs to be set in
// constructor or in linker.
throw new DataModelException("Range interval missing in range restriction.");
}
......@@ -321,11 +328,11 @@ public class YangRangeRestriction<T extends YangBuiltInDataTypeInfo<T>>
@Override
public void validateDataOnEntry() throws DataModelException {
//TODO: implement the method.
// TODO: implement the method.
}
@Override
public void validateDataOnExit() throws DataModelException {
//TODO: implement the method.
// TODO: implement the method.
}
}
......
......@@ -15,9 +15,11 @@
*/
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*
* Reference:RFC 6020.
......@@ -42,7 +44,9 @@ import org.onosproject.yangutils.utils.YangConstructType;
/**
* Represents the information about the revision.
*/
public class YangRevision implements YangDesc, YangReference, Parsable {
public class YangRevision implements YangDesc, YangReference, Parsable, Serializable {
private static final long serialVersionUID = 8062016052L;
/**
* Revision date. Date string in the format "YYYY-MM-DD"
......
......@@ -17,8 +17,8 @@
package org.onosproject.yangutils.datamodel;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -59,6 +59,8 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
public class YangRpc extends YangNode implements YangCommonInfo, Parsable,
CollisionDetector {
private static final long serialVersionUID = 806201613L;
/**
* Name of the rpc.
*/
......
......@@ -16,9 +16,11 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint64;
/*-
......@@ -31,7 +33,7 @@ import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangUint64;
/**
* Represents the restriction for string data type.
*/
public class YangStringRestriction implements YangDesc, YangReference, YangAppErrorInfo, Parsable {
public class YangStringRestriction implements YangDesc, YangReference, YangAppErrorInfo, Parsable, Serializable {
/*-
* Reference RFC 6020.
......@@ -69,6 +71,8 @@ public class YangStringRestriction implements YangDesc, YangReference, YangAppEr
* +---------------+---------+-------------+-----------------+
*/
private static final long serialVersionUID = 8062016053L;
/**
* Length restriction information.
*/
......@@ -242,11 +246,11 @@ public class YangStringRestriction implements YangDesc, YangReference, YangAppEr
@Override
public void validateDataOnEntry() throws DataModelException {
//TODO: implement the method.
// TODO: implement the method.
}
@Override
public void validateDataOnExit() throws DataModelException {
//TODO: implement the method.
// TODO: implement the method.
}
}
......
......@@ -19,9 +19,10 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.linkInterFileReferences;
......@@ -83,6 +84,8 @@ public class YangSubModule
implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, YangReferenceResolver,
RpcNotificationContainer {
private static final long serialVersionUID = 806201614L;
/**
* Name of sub module.
*/
......
......@@ -16,11 +16,12 @@
package org.onosproject.yangutils.datamodel;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.linker.Resolvable;
import org.onosproject.yangutils.linker.ResolvableStatus;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
......@@ -54,7 +55,9 @@ import static org.onosproject.yangutils.datamodel.YangDataTypes.DERIVED;
* @param <T> YANG data type info
*/
public class YangType<T>
implements Parsable, Resolvable {
implements Parsable, Resolvable, Serializable {
private static final long serialVersionUID = 8062016054L;
/**
* YANG node identifier.
......@@ -248,9 +251,9 @@ public class YangType<T>
@Override
public void resolve()
throws DataModelException {
/*
* Check whether the data type is derived.
*/
/*
* Check whether the data type is derived.
*/
if (getDataType() != DERIVED) {
throw new DataModelException("Linker Error: Resolve should only be called for derived data types.");
}
......
......@@ -17,9 +17,10 @@ package org.onosproject.yangutils.datamodel;
import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
......@@ -58,6 +59,8 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable, YangTypeHolder, CollisionDetector {
private static final long serialVersionUID = 806201615L;
/**
* Default value in string, needs to be converted to the target object,
* based on the type.
......
......@@ -18,9 +18,10 @@ package org.onosproject.yangutils.datamodel;
import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
/*
* Reference RFC 6020.
......@@ -49,6 +50,8 @@ import org.onosproject.yangutils.utils.YangConstructType;
*/
public class YangUnion extends YangNode implements Parsable, YangTypeHolder {
private static final long serialVersionUID = 806201616L;
// List of YANG type.
private List<YangType<?>> typeList;
......@@ -56,7 +59,7 @@ public class YangUnion extends YangNode implements Parsable, YangTypeHolder {
private String name;
// Current child union number.
private int childUnionNumber;
private transient int childUnionNumber;
/**
* Creates a YANG union node.
......
......@@ -17,14 +17,14 @@ package org.onosproject.yangutils.datamodel;
import java.util.LinkedList;
import java.util.List;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.linker.Resolvable;
import org.onosproject.yangutils.linker.ResolvableStatus;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.ResolvableStatus;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCollidingChildUtil;
import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getParentNodeInGenCode;
import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.getParentNodeInGenCode;
/*-
* Reference RFC 6020.
......@@ -63,6 +63,8 @@ public class YangUses
extends YangNode
implements YangCommonInfo, Parsable, Resolvable, CollisionDetector {
private static final long serialVersionUID = 806201617L;
/**
* YANG node identifier.
*/
......@@ -99,17 +101,17 @@ public class YangUses
/**
* Effective list of nodes of grouping that needs to replicated at YANG uses.
*/
List<YangNode> resolvedGroupingNodes;
private List<YangNode> resolvedGroupingNodes;
/**
* Effective list of leaves of grouping that needs to replicated at YANG uses.
*/
List<List<YangLeaf>> resolvedGroupingLeaves;
private List<List<YangLeaf>> resolvedGroupingLeaves;
/**
* Effective list of leaf lists of grouping that needs to replicated at YANG uses.
*/
List<List<YangLeafList>> resolvedGroupingLeafLists;
private List<List<YangLeafList>> resolvedGroupingLeafLists;
/**
* Creates an YANG uses node.
......@@ -313,17 +315,17 @@ public class YangUses
YangNode childInGrouping = referredGrouping.getChild();
while (childInGrouping != null) {
if ((childInGrouping instanceof YangEnumeration)
|| (childInGrouping instanceof YangUnion)
|| (childInGrouping instanceof YangTypeDef)) {
if (childInGrouping instanceof YangEnumeration
|| childInGrouping instanceof YangUnion
|| childInGrouping instanceof YangTypeDef) {
/*
* No need to copy the leaves, union / enum class,
* as these will be generated in the scope of grouping
* No need to copy the leaves, union / enum class, as these will
* be generated in the scope of grouping
*/
childInGrouping = childInGrouping.getNextSibling();
continue;
} else if ((childInGrouping instanceof YangUses)) {
} else if (childInGrouping instanceof YangUses) {
addResolvedUsesInfoOfGrouping((YangUses) childInGrouping,
usesParentLeavesHolder);
} else {
......@@ -341,19 +343,16 @@ public class YangUses
* @param usesHolder holder of uses
*/
private void addResolvedUsesInfoOfGrouping(YangUses usesInGrouping,
YangLeavesHolder usesHolder) throws DataModelException {
for (YangNode usesResolvedNode :
usesInGrouping.getUsesResolvedNodeList()) {
YangLeavesHolder usesHolder) throws DataModelException {
for (YangNode usesResolvedNode : usesInGrouping.getUsesResolvedNodeList()) {
addNodeOfGrouping(usesResolvedNode);
}
for (List<YangLeaf> leavesList :
usesInGrouping.getUsesResolvedLeavesList()) {
for (List<YangLeaf> leavesList : usesInGrouping.getUsesResolvedLeavesList()) {
addLeavesOfGrouping(cloneLeavesList(leavesList, usesHolder));
}
for (List<YangLeafList> listOfLeafLists :
usesInGrouping.getUsesResolvedListOfLeafList()) {
for (List<YangLeafList> listOfLeafLists : usesInGrouping.getUsesResolvedListOfLeafList()) {
addListOfLeafListOfGrouping(
cloneListOfLeafList(listOfLeafLists, usesHolder));
}
......@@ -368,8 +367,8 @@ public class YangUses
* @throws DataModelException a violation in data model rule
*/
private List<YangLeaf> cloneLeavesList(List<YangLeaf> listOfLeaves,
YangLeavesHolder usesParentNode) throws DataModelException {
if ((listOfLeaves == null) || listOfLeaves.size() == 0) {
YangLeavesHolder usesParentNode) throws DataModelException {
if (listOfLeaves == null || listOfLeaves.size() == 0) {
throw new DataModelException("No leaves to clone");
}
......@@ -399,8 +398,8 @@ public class YangUses
* @return cloned list of leaf list
*/
private List<YangLeafList> cloneListOfLeafList(List<YangLeafList> listOfLeafList,
YangLeavesHolder usesParentNode) throws DataModelException {
if ((listOfLeafList == null) || listOfLeafList.size() == 0) {
YangLeavesHolder usesParentNode) throws DataModelException {
if (listOfLeafList == null || listOfLeafList.size() == 0) {
throw new DataModelException("No leaf lists to clone");
}
......@@ -422,7 +421,6 @@ public class YangUses
return newListOfLeafList;
}
@Override
public ResolvableStatus getResolvableStatus() {
return resolvableStatus;
......@@ -449,7 +447,6 @@ public class YangUses
}
}
/**
* Adds the node under grouping to the effective uses resolved info.
*
......
......@@ -18,6 +18,7 @@ package org.onosproject.yangutils.datamodel.utils;
import java.util.List;
import java.util.Set;
import org.onosproject.yangutils.datamodel.CollisionDetector;
import org.onosproject.yangutils.datamodel.ResolvableType;
import org.onosproject.yangutils.datamodel.YangLeaf;
......@@ -29,8 +30,6 @@ import org.onosproject.yangutils.datamodel.YangResolutionInfo;
import org.onosproject.yangutils.datamodel.YangRpc;
import org.onosproject.yangutils.datamodel.YangType;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
/**
* Represents utilities for data model tree.
......@@ -177,7 +176,7 @@ public final class DataModelUtils {
* @throws DataModelException a violation of data model rules
*/
public static void resolveLinkingForResolutionList(List<YangResolutionInfo> resolutionList,
YangReferenceResolver dataModelRootNode)
YangReferenceResolver dataModelRootNode)
throws DataModelException {
for (YangResolutionInfo resolutionInfo : resolutionList) {
......@@ -193,11 +192,11 @@ public final class DataModelUtils {
* @throws DataModelException a violation of data model rules
*/
public static void linkInterFileReferences(List<YangResolutionInfo> resolutionList,
YangReferenceResolver dataModelRootNode)
YangReferenceResolver dataModelRootNode)
throws DataModelException {
/*
* Run through the resolution list, find type/uses referring to
* inter file typedef/grouping, ask for linking.
* Run through the resolution list, find type/uses referring to inter
* file typedef/grouping, ask for linking.
*/
for (YangResolutionInfo resolutionInfo : resolutionList) {
resolutionInfo.linkInterFile(dataModelRootNode);
......@@ -240,4 +239,20 @@ public final class DataModelUtils {
}
return null;
}
/**
* Returns the contained data model parent node.
*
* @param currentNode current node which parent contained node is required
* @return parent node in which the current node is an attribute
*/
public static YangNode getParentNodeInGenCode(YangNode currentNode) {
/*
* TODO: recursive parent lookup to support choice/augment/uses. TODO:
* need to check if this needs to be updated for
* choice/case/augment/grouping
*/
return currentNode.getParent();
}
}
......
......@@ -14,10 +14,9 @@
* limitations under the License.
*/
package org.onosproject.yangutils.parser;
package org.onosproject.yangutils.datamodel.utils;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.utils.YangConstructType;
/**
* Abstraction of an entity which process the data of lexer's parse tree.
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.onosproject.yangutils.linker;
package org.onosproject.yangutils.datamodel.utils;
/**
* Represents the status of resolvable entity.
......
......@@ -16,14 +16,6 @@
package org.onosproject.yangutils.datamodel.utils;
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.utils.YangConstructType;
import org.onosproject.yangutils.datamodel.utils.builtindatatype.YangBuiltInDataTypeInfo;
import static org.onosproject.yangutils.datamodel.YangDataTypes.DECIMAL64;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT16;
import static org.onosproject.yangutils.datamodel.YangDataTypes.INT32;
......@@ -33,12 +25,18 @@ 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.utils.UtilConstants.ADD;
import static org.onosproject.yangutils.utils.UtilConstants.EMPTY_STRING;
import static org.onosproject.yangutils.utils.YangConstructType.LENGTH_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.RANGE_DATA;
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;
/**
* Represents restriction resolver which provide common utility used by parser
* and during linking for restriction resolution.
......@@ -46,6 +44,8 @@ import static org.onosproject.yangutils.datamodel.utils.builtindatatype.BuiltInT
public final class RestrictionResolver {
private static final String PIPE = "|";
private static final String ADD = "+";
private static final String EMPTY_STRING = "";
private static final String INTERVAL = "..";
private static final int MAX_RANGE_BOUNDARY = 2;
private static final int MIN_RANGE_BOUNDARY = 1;
......@@ -71,9 +71,9 @@ public final class RestrictionResolver {
* @throws DataModelException a violation in data model rule
*/
public static YangRangeRestriction processRangeRestriction(YangRangeRestriction refRangeRestriction,
int lineNumber, int charPositionInLine,
boolean hasReferredRestriction,
String curRangeString, YangDataTypes effectiveType)
int lineNumber, int charPositionInLine,
boolean hasReferredRestriction,
String curRangeString, YangDataTypes effectiveType)
throws DataModelException {
YangBuiltInDataTypeInfo<?> startValue;
YangBuiltInDataTypeInfo<?> endValue;
......@@ -157,9 +157,9 @@ public final class RestrictionResolver {
* @throws DataModelException a violation in data model rule
*/
public static YangRangeRestriction processLengthRestriction(YangRangeRestriction refLengthRestriction,
int lineNumber, int charPositionInLine,
boolean hasReferredRestriction,
String curLengthString) throws DataModelException {
int lineNumber, int charPositionInLine,
boolean hasReferredRestriction,
String curLengthString) throws DataModelException {
YangBuiltInDataTypeInfo<?> startValue;
YangBuiltInDataTypeInfo<?> endValue;
......@@ -238,7 +238,7 @@ public final class RestrictionResolver {
* @return true, if data type can have range restrictions, false otherwise
*/
public static boolean isOfRangeRestrictedType(YangDataTypes dataType) {
return (dataType == INT8
return dataType == INT8
|| dataType == INT16
|| dataType == INT32
|| dataType == INT64
......@@ -246,7 +246,7 @@ public final class RestrictionResolver {
|| dataType == UINT16
|| dataType == UINT32
|| dataType == UINT64
|| dataType == DECIMAL64);
|| dataType == DECIMAL64;
}
/**
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.yangutils.utils;
package org.onosproject.yangutils.datamodel.utils;
/**
* Represents ENUM to represent the type of data in parse tree.
......
......@@ -15,12 +15,16 @@
*/
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Factory to create an object of required type.
*/
public final class BuiltInTypeObjectFactory {
public final class BuiltInTypeObjectFactory implements Serializable {
private static final long serialVersionUID = 8006201671L;
/**
* Utility factory class, hence the object creation is forbidden.
......@@ -38,36 +42,36 @@ public final class BuiltInTypeObjectFactory {
* @return the target data type object with the value initialized
*/
public static <T extends YangBuiltInDataTypeInfo<?>> T getDataObjectFromString(String valueInStr,
YangDataTypes builtInType) {
YangDataTypes builtInType) {
switch (builtInType) {
case INT8: {
return (T) new YangInt8(valueInStr);
}
case INT16: {
return (T) new YangInt16(valueInStr);
}
case INT32: {
return (T) new YangInt32(valueInStr);
}
case INT64: {
return (T) new YangInt64(valueInStr);
}
case UINT8: {
return (T) new YangUint8(valueInStr);
}
case UINT16: {
return (T) new YangUint16(valueInStr);
}
case UINT32: {
return (T) new YangUint32(valueInStr);
}
case UINT64: {
return (T) new YangUint64(valueInStr);
}
default: {
throw new DataTypeException("YANG file error : Unsupported data type");
}
case INT8: {
return (T) new YangInt8(valueInStr);
}
case INT16: {
return (T) new YangInt16(valueInStr);
}
case INT32: {
return (T) new YangInt32(valueInStr);
}
case INT64: {
return (T) new YangInt64(valueInStr);
}
case UINT8: {
return (T) new YangUint8(valueInStr);
}
case UINT16: {
return (T) new YangUint16(valueInStr);
}
case UINT32: {
return (T) new YangUint32(valueInStr);
}
case UINT64: {
return (T) new YangUint64(valueInStr);
}
default: {
throw new DataTypeException("YANG file error : Unsupported data type");
}
}
}
......
......@@ -16,13 +16,17 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import java.util.Objects;
import com.google.common.base.MoreObjects;
/**
* Represents binary data type.
*/
public final class YangBinary {
public final class YangBinary implements Serializable {
private static final long serialVersionUID = 8006201670L;
private byte[] byteArray;
......@@ -38,7 +42,7 @@ public final class YangBinary {
* @param bytes byte array
*/
public YangBinary(byte[] bytes) {
this.byteArray = bytes;
byteArray = bytes;
}
/**
......
......@@ -16,13 +16,17 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import java.util.Objects;
import com.google.common.base.MoreObjects;
/**
* Represents bits data type.
*/
public class YangBits {
public class YangBits implements Serializable {
private static final long serialVersionUID = 8006201669L;
private byte[] byteArray;
......@@ -38,7 +42,7 @@ public class YangBits {
* @param bytes byte array
*/
public YangBits(byte[] bytes) {
this.byteArray = bytes;
byteArray = bytes;
}
/**
......
......@@ -16,13 +16,17 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import java.util.Objects;
import com.google.common.base.MoreObjects;
/**
* Represents YANG decimal 64.
*/
public class YangDecimal64 {
public class YangDecimal64 implements Serializable {
private static final long serialVersionUID = 8006201668L;
private int fractionDigit;
......@@ -38,7 +42,7 @@ public class YangDecimal64 {
* @param fractionDigit fraction digit
*/
public YangDecimal64(int fractionDigit) {
this.setFractionDigit(fractionDigit);
setFractionDigit(fractionDigit);
}
/**
......
......@@ -16,15 +16,18 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import org.onosproject.yangutils.datamodel.YangDataTypes;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
* Handles the YANG's int16 data type processing.
*
* int16 represents integer values between -32768 and 32767, inclusively.
*/
public class YangInt16 implements YangBuiltInDataTypeInfo<YangInt16> {
public class YangInt16 implements YangBuiltInDataTypeInfo<YangInt16>, Serializable {
private static final long serialVersionUID = 8006201667L;
/**
* YANG's min keyword.
......
......@@ -16,6 +16,8 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
......@@ -23,7 +25,9 @@ import org.onosproject.yangutils.datamodel.YangDataTypes;
*
* int32 represents integer values between -2147483648 and 2147483647, inclusively.
*/
public class YangInt32 implements YangBuiltInDataTypeInfo<YangInt32> {
public class YangInt32 implements YangBuiltInDataTypeInfo<YangInt32>, Serializable {
private static final long serialVersionUID = 8006201666L;
/**
* YANG's min keyword.
......@@ -72,7 +76,6 @@ public class YangInt32 implements YangBuiltInDataTypeInfo<YangInt32> {
}
}
/**
* Returns YANG's int32 value.
*
......
......@@ -16,6 +16,8 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
......@@ -23,7 +25,9 @@ import org.onosproject.yangutils.datamodel.YangDataTypes;
*
* int8 represents integer values between -9223372036854775808 and 9223372036854775807, inclusively.
*/
public class YangInt64 implements YangBuiltInDataTypeInfo<YangInt64> {
public class YangInt64 implements YangBuiltInDataTypeInfo<YangInt64>, Serializable {
private static final long serialVersionUID = 8006201665L;
/**
* YANG's min keyword.
......@@ -72,7 +76,6 @@ public class YangInt64 implements YangBuiltInDataTypeInfo<YangInt64> {
}
}
/**
* Returns YANG's int64 value.
*
......
......@@ -16,6 +16,8 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
......@@ -23,7 +25,9 @@ import org.onosproject.yangutils.datamodel.YangDataTypes;
*
* int8 represents integer values between -128 and 127, inclusively.
*/
public class YangInt8 implements YangBuiltInDataTypeInfo<YangInt8> {
public class YangInt8 implements YangBuiltInDataTypeInfo<YangInt8>, Serializable {
private static final long serialVersionUID = 8006201664L;
/**
* YANG's min keyword.
......
......@@ -16,6 +16,8 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
......@@ -23,7 +25,9 @@ import org.onosproject.yangutils.datamodel.YangDataTypes;
*
* Uint16 represents integer values between 0 and 65535, inclusively.
*/
public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16> {
public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16>, Serializable {
private static final long serialVersionUID = 8006201663L;
/**
* YANG's min keyword.
......@@ -100,4 +104,3 @@ public class YangUint16 implements YangBuiltInDataTypeInfo<YangUint16> {
}
}
......
......@@ -16,6 +16,8 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
......@@ -23,7 +25,9 @@ import org.onosproject.yangutils.datamodel.YangDataTypes;
*
* Uint32 represents integer values between 0 and 4294967295, inclusively.
*/
public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32> {
public class YangUint32 implements YangBuiltInDataTypeInfo<YangUint32>, Serializable {
private static final long serialVersionUID = 8006201662L;
private static final String MIN_KEYWORD = "min";
private static final String MAX_KEYWORD = "max";
......
......@@ -16,8 +16,10 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.regex.Pattern;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
......@@ -25,7 +27,9 @@ import org.onosproject.yangutils.datamodel.YangDataTypes;
*
* Uint64 represents integer values between 0 and 18446744073709551615, inclusively.
*/
public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64> {
public class YangUint64 implements YangBuiltInDataTypeInfo<YangUint64>, Serializable {
private static final long serialVersionUID = 8006201661L;
/**
* YANG's min keyword.
......
......@@ -16,6 +16,8 @@
package org.onosproject.yangutils.datamodel.utils.builtindatatype;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangDataTypes;
/**
......@@ -23,7 +25,9 @@ import org.onosproject.yangutils.datamodel.YangDataTypes;
*
* Uint8 represents integer values between 0 and 255, inclusively.
*/
public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8> {
public class YangUint8 implements YangBuiltInDataTypeInfo<YangUint8>, Serializable {
private static final long serialVersionUID = 8006201660L;
/**
* YANG's min keyword.
......
<!--
~ 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-yangutils</artifactId>
<version>1.7.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>yangutils-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>onos-yang-utils-plugin</name>
<packaging>maven-plugin</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>yangutils-datamodel</artifactId>
<version>1.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.3.9</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.3.9</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.21.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.3.9</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
<version>3.0-alpha-2</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>3.3.9</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-junit</artifactId>
<version>1.7.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.5.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.5</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>antlr4</goal>
</goals>
</execution>
</executions>
<configuration>
<sourceDirectory>src/main/resources</sourceDirectory>
<outputDirectory>target/generated-sources/org/onosproject/yangutils/parser/antlrgencode</outputDirectory>
<visitor>false</visitor>
<listener>true</listener>
</configuration>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>Deleting auto-generated listener interfaces</id>
<phase>generate-sources</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
<configuration>
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>target</directory>
<followSymlinks>false</followSymlinks>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<exclude>**/generated-sources/org/onosproject/yangutils/parser/antlrgencode/GeneratedYangLexer.java</exclude>
<exclude>**/generated-sources/org/onosproject/yangutils/parser/antlrgencode/GeneratedYang.tokens</exclude>
<exclude>**/generated-sources/org/onosproject/yangutils/parser/antlrgencode/GeneratedYangParser.java</exclude>
<exclude>**/generated-sources/org/onosproject/yangutils/parser/antlrgencode/GeneratedYangLexer.tokens</exclude>
<exclude>**/generated-sources/org/onosproject/yangutils/parser/antlrgencode/YangLexer.java</exclude>
<exclude>**/generated-sources/org/onosproject/yangutils/parser/antlrgencode/YangLexer.tokens</exclude>
</excludes>
</fileset>
</filesets>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/org/onosproject/yangutils/parser/antlrgencode</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>
org.onosproject.yangutils.parser.*
</Export-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.4</version>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -15,6 +15,8 @@
*/
package org.onosproject.yangutils.linker.impl;
import java.io.Serializable;
import org.onosproject.yangutils.datamodel.YangEntityToResolveInfo;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.datamodel.YangType;
......@@ -26,7 +28,9 @@ import org.onosproject.yangutils.linker.exceptions.LinkerException;
*
* @param <T> type of entity being resolved, uses / grouping
*/
public class YangEntityToResolveInfoImpl<T> implements YangEntityToResolveInfo<T> {
public class YangEntityToResolveInfoImpl<T> implements YangEntityToResolveInfo<T>, Serializable {
private static final long serialVersionUID = 806201659L;
// Parsable node for which resolution is to be performed.
private T entityToResolve;
......
......@@ -22,7 +22,8 @@ import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ErrorNode;
import org.antlr.v4.runtime.tree.TerminalNode;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.datamodel.utils.Parsable;
import org.onosproject.yangutils.datamodel.utils.YangConstructType;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangListener;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
import org.onosproject.yangutils.parser.impl.listeners.AugmentListener;
......@@ -75,7 +76,6 @@ import org.onosproject.yangutils.parser.impl.listeners.UnitsListener;
import org.onosproject.yangutils.parser.impl.listeners.UsesListener;
import org.onosproject.yangutils.parser.impl.listeners.ValueListener;
import org.onosproject.yangutils.parser.impl.listeners.VersionListener;
import org.onosproject.yangutils.utils.YangConstructType;
import static org.onosproject.yangutils.utils.UtilConstants.UNSUPPORTED_YANG_CONSTRUCT;
import static org.onosproject.yangutils.utils.UtilConstants.CURRENTLY_UNSUPPORTED;
......
......@@ -25,13 +25,19 @@ import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
import org.onosproject.yangutils.datamodel.YangSubModule;
import org.onosproject.yangutils.datamodel.YangUses;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.datamodel.utils.Parsable;
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.utils.GeneratedLanguage.JAVA_GENERATION;
import static org.onosproject.yangutils.datamodel.utils.YangDataModelFactory.getYangAugmentNode;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.AUGMENT_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.CASE_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DATA_DEF_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.DESCRIPTION_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.REFERENCE_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.STATUS_DATA;
import static org.onosproject.yangutils.datamodel.utils.YangConstructType.WHEN_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.AugmentListenerUtil.generateNameForAugmentNode;
import static org.onosproject.yangutils.parser.impl.parserutils.AugmentListenerUtil.getParentsPrefix;
import static org.onosproject.yangutils.parser.impl.parserutils.AugmentListenerUtil.parserException;
......@@ -51,13 +57,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.get
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateMutuallyExclusiveChilds;
import static org.onosproject.yangutils.utils.YangConstructType.AUGMENT_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.CASE_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.DATA_DEF_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.REFERENCE_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.WHEN_DATA;
import static org.onosproject.yangutils.translator.tojava.YangDataModelFactory.getYangAugmentNode;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......
......@@ -23,6 +23,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.utils.YangConstructType.YANGBASE_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
......@@ -31,7 +32,6 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorTyp
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsEmpty;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.YANGBASE_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.