Bharat saraswal
Committed by Gerrit Code Review

Coding gudilines for class and methods javadocs fixed.

Change-Id: I0153e6391c9ec9eacaac65c3989834b6bf5c65bf
Showing 150 changed files with 1057 additions and 1039 deletions
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.datamodel;
/**
* ENUM to identify the YANG resolution type.
* Represents ENUM to identify the YANG resolution type.
*/
public enum ResolutionType {
/**
......
......@@ -17,29 +17,30 @@ package org.onosproject.yangutils.datamodel;
* Abstraction of error message and application info processing.
*/
public interface YangAppErrorInfo {
/**
* Get the application's error message for data error.
* Returns the application's error message for data error.
*
* @return application's error message for data error.
*/
String getGetErrorMessage();
/**
* Set the application's error message for data error.
* Sets the application's error message for data error.
*
* @param errorMessage application's error message for data error.
*/
void setErrorMessage(String errorMessage);
/**
* Get the application's error tag for data error.
* Returns the application's error tag for data error.
*
* @return application's error tag for data error.
*/
String getGetErrorAppTag();
/**
* Set the application's error tag for data error.
* Sets the application's error tag for data error.
*
* @param errorMessage application's error tag for data error.
*/
......
......@@ -76,7 +76,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
* +--------------+---------+-------------+------------------+
*/
/**
* Data model node to maintain information defined in YANG augment.
* Representation of data model node to maintain information defined in YANG augment.
*/
public class YangAugment extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
......@@ -124,7 +124,7 @@ public class YangAugment extends YangNode
}
/**
* Get the augmented node.
* Returns the augmented node.
*
* @return the augmented node
*/
......@@ -133,7 +133,7 @@ public class YangAugment extends YangNode
}
/**
* Set the augmented node.
* Sets the augmented node.
*
* @param nodeIdentifiers the augmented node
*/
......@@ -142,7 +142,7 @@ public class YangAugment extends YangNode
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -176,7 +176,7 @@ public class YangAugment extends YangNode
}
/**
* Get the list of leaves.
* Returns the list of leaves.
*
* @return the list of leaves
*/
......@@ -186,7 +186,7 @@ public class YangAugment extends YangNode
}
/**
* Set the list of leaves.
* Sets the list of leaves.
*
* @param leafsList the list of leaf to set
*/
......@@ -195,7 +195,7 @@ public class YangAugment extends YangNode
}
/**
* Add a leaf.
* Adds a leaf.
*
* @param leaf the leaf to be added
*/
......@@ -209,7 +209,7 @@ public class YangAugment extends YangNode
}
/**
* Get the list of leaf-list.
* Returns the list of leaf-list.
*
* @return the list of leaf-list
*/
......@@ -219,7 +219,7 @@ public class YangAugment extends YangNode
}
/**
* Set the list of leaf-list.
* Sets the list of leaf-list.
*
* @param listOfLeafList the list of leaf-list to set
*/
......@@ -228,7 +228,7 @@ public class YangAugment extends YangNode
}
/**
* Add a leaf-list.
* Adds a leaf-list.
*
* @param leafList the leaf-list to be added
*/
......@@ -242,7 +242,7 @@ public class YangAugment extends YangNode
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -252,7 +252,7 @@ public class YangAugment extends YangNode
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -262,7 +262,7 @@ public class YangAugment extends YangNode
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -272,7 +272,7 @@ public class YangAugment extends YangNode
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -292,7 +292,7 @@ public class YangAugment extends YangNode
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -302,7 +302,7 @@ public class YangAugment extends YangNode
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -312,7 +312,7 @@ public class YangAugment extends YangNode
}
/**
* Get the target nodes name where the augmentation is being done.
* Returns the target nodes name where the augmentation is being done.
*
* @return target nodes name where the augmentation is being done
*/
......@@ -322,14 +322,13 @@ public class YangAugment extends YangNode
}
/**
* Set the target nodes name where the augmentation is being done.
* Sets the target nodes name where the augmentation is being done.
*
* @param name target nodes name where the augmentation is being done
*/
@Override
public void setName(String name) {
this.name = name;
}
}
......
......@@ -44,7 +44,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
*/
/**
* Maintains the belongs-to data type information.
* Represents the belongs-to data type information.
*/
public class YangBelongsTo implements Parsable {
......@@ -73,7 +73,7 @@ public class YangBelongsTo implements Parsable {
}
/**
* Get the belongs to module name.
* Returns the belongs to module name.
*
* @return the belongs to module name
*/
......@@ -82,7 +82,7 @@ public class YangBelongsTo implements Parsable {
}
/**
* Set the belongs to module name.
* Sets the belongs to module name.
*
* @param belongsToModuleName the belongs to module name to set
*
......@@ -92,7 +92,7 @@ public class YangBelongsTo implements Parsable {
}
/**
* Get the prefix.
* Returns the prefix.
*
* @return the prefix
*/
......@@ -101,7 +101,7 @@ public class YangBelongsTo implements Parsable {
}
/**
* Set the prefix.
* Sets the prefix.
*
* @param prefix the prefix to set
*/
......@@ -120,7 +120,7 @@ public class YangBelongsTo implements Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -130,7 +130,7 @@ public class YangBelongsTo implements Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -16,12 +16,12 @@
package org.onosproject.yangutils.datamodel;
import java.util.Objects;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import java.util.Objects;
/*-
* The "bit" statement, which is a sub-statement to the "type" statement,
* MUST be present if the type is "bits". It is repeatedly used to
......@@ -44,7 +44,7 @@ import java.util.Objects;
*/
/**
* Maintains the bit data type information.
* Represents the bit data type information.
*/
public class YangBit implements YangCommonInfo, Parsable {
......@@ -90,7 +90,7 @@ public class YangBit implements YangCommonInfo, Parsable {
}
/**
* Set the bit name.
* Sets the bit name.
*
* @param bitName the bit name to set
*/
......@@ -109,7 +109,7 @@ public class YangBit implements YangCommonInfo, Parsable {
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -129,7 +129,7 @@ public class YangBit implements YangCommonInfo, Parsable {
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -149,7 +149,7 @@ public class YangBit implements YangCommonInfo, Parsable {
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -168,7 +168,7 @@ public class YangBit implements YangCommonInfo, Parsable {
}
/**
* Set the bit position.
* Sets the bit position.
*
* @param position the position to set
*/
......@@ -188,6 +188,7 @@ public class YangBit implements YangCommonInfo, Parsable {
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
......@@ -204,7 +205,7 @@ public class YangBit implements YangCommonInfo, Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -214,7 +215,7 @@ public class YangBit implements YangCommonInfo, Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -32,7 +32,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
*/
/**
* Maintains the bits data type information.
* Represents the bits data type information.
*/
public class YangBits implements Parsable {
......@@ -43,7 +43,7 @@ public class YangBits implements Parsable {
private String bitsName;
/**
* Create a YANG bits type object.
* Creates a YANG bits type object.
*/
public YangBits() {
setBitSet(new HashSet<YangBit>());
......@@ -59,7 +59,7 @@ public class YangBits implements Parsable {
}
/**
* Set the bit set.
* Sets the bit set.
*
* @param bitSet the bit set
*/
......@@ -68,7 +68,7 @@ public class YangBits implements Parsable {
}
/**
* Add bit info.
* Adds bit info.
*
* @param bitInfo the bit information to be added
* @throws DataModelException due to violation in data model rules
......@@ -100,7 +100,7 @@ public class YangBits implements Parsable {
}
/**
* Set bits name.
* Sets bits name.
*
* @param bitsName bit name to be set
*/
......@@ -109,7 +109,7 @@ public class YangBits implements Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -119,7 +119,7 @@ public class YangBits implements Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -89,7 +89,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.CASE_DATA;
* +--------------+---------+-------------+------------------+
*/
/**
* Data model node to maintain information defined in YANG case.
* Represents data model node to maintain information defined in YANG case.
*/
public class YangCase extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
......@@ -127,14 +127,14 @@ public class YangCase extends YangNode
private YangStatusType status;
/**
* Create a choice node.
* Creates a choice node.
*/
public YangCase() {
super(YangNodeType.CASE_NODE);
}
/**
* Get the case name.
* Returns the case name.
*
* @return case name
*/
......@@ -144,7 +144,7 @@ public class YangCase extends YangNode
}
/**
* Set the case name.
* Sets the case name.
*
* @param name case name
*/
......@@ -154,7 +154,7 @@ public class YangCase extends YangNode
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -164,7 +164,7 @@ public class YangCase extends YangNode
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -174,7 +174,7 @@ public class YangCase extends YangNode
}
/**
* Get the list of leaves.
* Returns the list of leaves.
*
* @return the list of leaves
*/
......@@ -184,7 +184,7 @@ public class YangCase extends YangNode
}
/**
* Set the list of leaves.
* Sets the list of leaves.
*
* @param leafsList the list of leaf to set
*/
......@@ -193,7 +193,7 @@ public class YangCase extends YangNode
}
/**
* Add a leaf.
* Adds a leaf.
*
* @param leaf the leaf to be added
*/
......@@ -207,7 +207,7 @@ public class YangCase extends YangNode
}
/**
* Get the list of leaf-list.
* Returns the list of leaf-list.
*
* @return the list of leaf-list
*/
......@@ -217,7 +217,7 @@ public class YangCase extends YangNode
}
/**
* Set the list of leaf-list.
* Sets the list of leaf-list.
*
* @param listOfLeafList the list of leaf-list to set
*/
......@@ -226,7 +226,7 @@ public class YangCase extends YangNode
}
/**
* Add a leaf-list.
* Adds a leaf-list.
*
* @param leafList the leaf-list to be added
*/
......@@ -240,7 +240,7 @@ public class YangCase extends YangNode
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -250,7 +250,7 @@ public class YangCase extends YangNode
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -260,7 +260,7 @@ public class YangCase extends YangNode
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -270,7 +270,7 @@ public class YangCase extends YangNode
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -290,7 +290,7 @@ public class YangCase extends YangNode
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -300,7 +300,7 @@ public class YangCase extends YangNode
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -57,7 +57,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.CHOICE_DATA;
* +--------------+---------+-------------+------------------+
*/
/**
* Data model node to maintain information defined in YANG choice.
* Represents data model node to maintain information defined in YANG choice.
*/
public class YangChoice extends YangNode implements YangCommonInfo, Parsable, CollisionDetector {
......@@ -141,7 +141,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Get the choice name.
* Returns the choice name.
*
* @return choice name
*/
......@@ -151,7 +151,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Set the choice name.
* Sets the choice name.
*
* @param name choice name
*/
......@@ -161,7 +161,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Get config flag.
* Returns config flag.
*
* @return the config flag
*/
......@@ -170,7 +170,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Set config flag.
* Sets config flag.
*
* @param isCfg the config flag
*/
......@@ -179,7 +179,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Get the default case.
* Returns the default case.
*
* @return the default case
*/
......@@ -188,7 +188,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Set the default case.
* Sets the default case.
*
* @param defaultCase the default case to set
*/
......@@ -197,7 +197,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Get the mandatory status.
* Returns the mandatory status.
*
* @return the mandatory status
*/
......@@ -206,7 +206,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Set the mandatory status.
* Sets the mandatory status.
*
* @param mandatory the mandatory status
*/
......@@ -215,7 +215,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -225,7 +225,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -235,7 +235,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -245,7 +245,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -255,7 +255,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -265,7 +265,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -285,7 +285,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -295,7 +295,7 @@ public class YangChoice extends YangNode implements YangCommonInfo, Parsable, Co
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -85,7 +85,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
/**
* Data model node to maintain information defined in YANG container.
* Represents data model node to maintain information defined in YANG container.
*/
public class YangContainer extends YangNode implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
......@@ -138,7 +138,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the YANG name of container.
* Returns the YANG name of container.
*
* @return the name of container as defined in YANG file
*/
......@@ -148,7 +148,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the YANG name of container.
* Sets the YANG name of container.
*
* @param name the name of container as defined in YANG file
*/
......@@ -158,7 +158,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the config flag.
* Returns the config flag.
*
* @return the isConfig
*/
......@@ -167,7 +167,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the config flag.
* Sets the config flag.
*
* @param isCfg the config flag
*/
......@@ -176,7 +176,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -186,7 +186,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -196,7 +196,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the list of leaves.
* Returns the list of leaves.
*
* @return the list of leaves
*/
......@@ -206,7 +206,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the list of leaves.
* Sets the list of leaves.
*
* @param leafsList the list of leaf to set
*/
......@@ -215,12 +215,13 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Add a leaf.
* Adds a leaf.
*
* @param leaf the leaf to be added
*/
@Override
public void addLeaf(YangLeaf leaf) {
if (getListOfLeaf() == null) {
setListOfLeaf(new LinkedList<YangLeaf>());
}
......@@ -229,7 +230,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the list of leaf-list.
* Returns the list of leaf-list.
*
* @return the list of leaf-list
*/
......@@ -239,7 +240,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the list of leaf-list.
* Sets the list of leaf-list.
*
* @param listOfLeafList the list of leaf-list to set
*/
......@@ -248,12 +249,13 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Add a leaf-list.
* Adds a leaf-list.
*
* @param leafList the leaf-list to be added
*/
@Override
public void addLeafList(YangLeafList leafList) {
if (getListOfLeafList() == null) {
setListOfLeafList(new LinkedList<YangLeafList>());
}
......@@ -262,7 +264,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the presence string if present.
* Returns the presence string if present.
*
* @return the presence
*/
......@@ -271,7 +273,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the presence string.
* Sets the presence string.
*
* @param presence the presence flag
*/
......@@ -280,7 +282,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -290,7 +292,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -300,7 +302,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -310,7 +312,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -330,7 +332,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -340,7 +342,7 @@ public class YangContainer extends YangNode implements YangLeavesHolder, YangCom
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.datamodel;
/**
* ENUM to identify the YANG data type.
* Represents ENUM to identify the YANG data type.
*/
public enum YangDataTypes {
/**
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.datamodel;
/**
* Maintains the derived information.
* Represents the derived information.
*
* @param <T> extended information.
*/
......@@ -52,7 +52,7 @@ public class YangDerivedInfo<T> {
}
/**
* Set the referred typedef reference.
* Sets the referred typedef reference.
*
* @param referredTypeDef referred typedef reference
*/
......@@ -70,7 +70,7 @@ public class YangDerivedInfo<T> {
}
/**
* Set resolved extended information after successful linking.
* Sets resolved extended information after successful linking.
*
* @param resolvedExtendedInfo resolved extended information
*/
......@@ -88,7 +88,7 @@ public class YangDerivedInfo<T> {
}
/**
* Set extended information.
* Sets extended information.
*
* @param extendedInfo extended information
*/
......
......@@ -21,8 +21,9 @@ package org.onosproject.yangutils.datamodel;
* parsing and translator processing of description.
*/
public interface YangDesc {
/**
* Get the description of YANG entity.
* Returns the description of YANG entity.
*
* @return the description of YANG entity.
*/
......
......@@ -16,12 +16,12 @@
package org.onosproject.yangutils.datamodel;
import java.util.Objects;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.utils.YangConstructType;
import java.util.Objects;
/*-
* The "ENUM" statement, which is a sub-statement to the "type"
* statement, MUST be present if the type is "enumeration". It is
......@@ -48,7 +48,7 @@ import java.util.Objects;
*/
/**
* Maintains the ENUM data type information.
* Represents the ENUM data type information.
*/
public class YangEnum implements YangCommonInfo, Parsable {
......@@ -85,7 +85,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Get the named value.
* Returns the named value.
*
* @return the named value
*/
......@@ -94,7 +94,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Set the named value.
* Sets the named value.
*
* @param namedValue the named value to set
*/
......@@ -103,7 +103,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -113,7 +113,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -123,7 +123,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -133,7 +133,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -143,7 +143,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -153,7 +153,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -163,7 +163,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Get the value.
* Returns the value.
*
* @return the value
*/
......@@ -172,7 +172,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Set the value.
* Sets the value.
*
* @param value the value to set
*/
......@@ -208,7 +208,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -218,7 +218,7 @@ public class YangEnum implements YangCommonInfo, Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -29,7 +29,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
*/
/**
* Maintains the enumeration data type information.
* Represents the enumeration data type information.
*/
public class YangEnumeration implements Parsable {
......@@ -47,7 +47,7 @@ public class YangEnumeration implements Parsable {
}
/**
* Get the ENUM set.
* Returns the ENUM set.
*
* @return the ENUM set
*/
......@@ -56,7 +56,7 @@ public class YangEnumeration implements Parsable {
}
/**
* Set the ENUM set.
* Sets the ENUM set.
*
* @param enumSet the ENUM set to set
*/
......@@ -65,7 +65,7 @@ public class YangEnumeration implements Parsable {
}
/**
* Add ENUM information.
* Adds ENUM information.
*
* @param enumInfo the ENUM information to be added
* @throws DataModelException due to violation in data model rules
......@@ -86,7 +86,7 @@ public class YangEnumeration implements Parsable {
}
/**
* Set the enumeration name.
* Sets the enumeration name.
*
* @param enumerationName enumeration name
*/
......@@ -105,7 +105,7 @@ public class YangEnumeration implements Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -115,7 +115,7 @@ public class YangEnumeration implements Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -17,6 +17,7 @@ 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;
......@@ -74,7 +75,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
/**
* Data model node to maintain information defined in YANG grouping.
* Represents data model node to maintain information defined in YANG grouping.
*/
public class YangGrouping extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
......@@ -119,7 +120,7 @@ public class YangGrouping extends YangNode
}
/**
* Get YANG grouping name.
* Returns YANG grouping name.
*
* @return YANG grouping name
*/
......@@ -129,7 +130,7 @@ public class YangGrouping extends YangNode
}
/**
* Set YANG grouping name.
* Sets YANG grouping name.
*
* @param name YANG grouping name
*/
......@@ -139,7 +140,7 @@ public class YangGrouping extends YangNode
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -149,7 +150,7 @@ public class YangGrouping extends YangNode
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -159,7 +160,7 @@ public class YangGrouping extends YangNode
}
/**
* Get the list of leaves.
* Returns the list of leaves.
*
* @return the list of leaves
*/
......@@ -169,7 +170,7 @@ public class YangGrouping extends YangNode
}
/**
* Set the list of leaves.
* Sets the list of leaves.
*
* @param leafsList the list of leaf to set
*/
......@@ -178,7 +179,7 @@ public class YangGrouping extends YangNode
}
/**
* Add a leaf.
* Adds a leaf.
*
* @param leaf the leaf to be added
*/
......@@ -188,7 +189,7 @@ public class YangGrouping extends YangNode
}
/**
* Get the list of leaf-list.
* Returns the list of leaf-list.
*
* @return the list of leaf-list
*/
......@@ -198,7 +199,7 @@ public class YangGrouping extends YangNode
}
/**
* Set the list of leaf-list.
* Sets the list of leaf-list.
*
* @param listOfLeafList the list of leaf-list to set
*/
......@@ -207,7 +208,7 @@ public class YangGrouping extends YangNode
}
/**
* Add a leaf-list.
* Adds a leaf-list.
*
* @param leafList the leaf-list to be added
*/
......@@ -217,7 +218,7 @@ public class YangGrouping extends YangNode
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -227,7 +228,7 @@ public class YangGrouping extends YangNode
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -237,7 +238,7 @@ public class YangGrouping extends YangNode
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -247,7 +248,7 @@ public class YangGrouping extends YangNode
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -267,7 +268,7 @@ public class YangGrouping extends YangNode
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -277,7 +278,7 @@ public class YangGrouping extends YangNode
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -299,7 +300,6 @@ public class YangGrouping extends YangNode
*/
@Override
public void detectCollidingChild(String identifierName, YangConstructType dataType) throws DataModelException {
// Asks helper to detect colliding child.
detectCollidingChildUtil(identifierName, dataType, this);
}
......
......@@ -60,7 +60,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
* +---------------+---------+-------------+------------------+
*/
/**
* Maintains the information about the imported modules.
* Represents the information about the imported modules.
*/
public class YangImport implements Parsable {
......@@ -90,14 +90,14 @@ public class YangImport implements Parsable {
private String revision;
/**
* Default constructor.
* Creates a YANG import.
*/
public YangImport() {
}
/**
* Get the imported module name.
* Returns the imported module name.
*
* @return the module name
*/
......@@ -106,7 +106,7 @@ public class YangImport implements Parsable {
}
/**
* Set module name.
* Sets module name.
*
* @param moduleName the module name to set
*/
......@@ -115,7 +115,7 @@ public class YangImport implements Parsable {
}
/**
* Get the prefix used to identify the entities from the imported module.
* Returns the prefix used to identify the entities from the imported module.
*
* @return the prefix used to identify the entities from the imported
* module
......@@ -125,7 +125,7 @@ public class YangImport implements Parsable {
}
/**
* Set prefix identifier.
* Sets prefix identifier.
*
* @param prefixId set the prefix identifier of the imported module
*/
......@@ -134,7 +134,7 @@ public class YangImport implements Parsable {
}
/**
* Get the revision of the imported module.
* Returns the revision of the imported module.
*
* @return the revision of the imported module
*/
......@@ -143,7 +143,7 @@ public class YangImport implements Parsable {
}
/**
* Set the revision of the imported module.
* Sets the revision of the imported module.
*
* @param rev set the revision of the imported module
*/
......@@ -162,7 +162,7 @@ public class YangImport implements Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -173,7 +173,7 @@ public class YangImport implements Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -193,7 +193,7 @@ public class YangImport implements Parsable {
}
/**
* Set the dresolution information node.
* Sets the dresolution information node.
*
* @param resolutionInfoNode the resolution information node
*/
......
......@@ -34,8 +34,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
* +---------------+---------+-------------+------------------+
*/
/**
* Maintains the information about the included sub-modules.
*
* Represents the information about the included sub-modules.
*/
public class YangInclude implements Parsable {
......@@ -56,13 +55,13 @@ public class YangInclude implements Parsable {
private HasResolutionInfo resolutionInfoNode;
/**
* Default constructor.
* Creates a YANG include.
*/
public YangInclude() {
}
/**
* Get the name of included sub-module.
* Returns the name of included sub-module.
*
* @return the sub-module name
*/
......@@ -71,7 +70,7 @@ public class YangInclude implements Parsable {
}
/**
* Set the name of included sub-modules.
* Sets the name of included sub-modules.
*
* @param subModuleName the sub-module name to set
*/
......@@ -80,7 +79,7 @@ public class YangInclude implements Parsable {
}
/**
* Get the revision.
* Returns the revision.
*
* @return the revision
*/
......@@ -89,7 +88,7 @@ public class YangInclude implements Parsable {
}
/**
* Set the revision.
* Sets the revision.
*
* @param revision the revision to set
*/
......@@ -108,7 +107,7 @@ public class YangInclude implements Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -119,7 +118,7 @@ public class YangInclude implements Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -139,7 +138,7 @@ public class YangInclude implements Parsable {
}
/**
* Set the dresolution information node.
* Sets the dresolution information node.
*
* @param resolutionInfoNode the resolution information node
*/
......
......@@ -18,6 +18,7 @@ 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;
......@@ -65,7 +66,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
/**
* Data model node to maintain information defined in YANG input.
* Represents data model node to maintain information defined in YANG input.
*/
public class YangInput extends YangNode implements YangLeavesHolder, Parsable, CollisionDetector {
......
......@@ -54,8 +54,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
* +--------------+---------+-------------+------------------+
*/
/**
* Leaf data represented in YANG.
*
* Represents leaf data represented in YANG.
*/
public class YangLeaf implements YangCommonInfo, Parsable {
......@@ -100,13 +99,13 @@ public class YangLeaf implements YangCommonInfo, Parsable {
private YangType<?> dataType;
/**
* Default constructor to create a YANG leaf.
* Creates a YANG leaf.
*/
public YangLeaf() {
}
/**
* Get the name of leaf.
* Returns the name of leaf.
*
* @return the leaf name
*/
......@@ -115,7 +114,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set the name of leaf.
* Sets the name of leaf.
*
* @param leafName the leaf name to set
*/
......@@ -124,7 +123,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Get the config flag.
* Returns the config flag.
*
* @return if config flag
*/
......@@ -133,7 +132,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set the config flag.
* Sets the config flag.
*
* @param isCfg the flag value to set
*/
......@@ -142,7 +141,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -152,7 +151,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -162,7 +161,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Get if the leaf is mandatory.
* Returns if the leaf is mandatory.
*
* @return if leaf is mandatory
*/
......@@ -171,7 +170,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set if the leaf is mandatory.
* Sets if the leaf is mandatory.
*
* @param isReq if the leaf is mandatory
*/
......@@ -180,7 +179,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -190,7 +189,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -200,7 +199,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -210,7 +209,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -220,7 +219,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Get the units.
* Returns the units.
*
* @return the units
*/
......@@ -229,7 +228,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set the units.
* Sets the units.
*
* @param units the units to set
*/
......@@ -238,7 +237,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Get the data type.
* Returns the data type.
*
* @return the data type
*/
......@@ -247,7 +246,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Set the data type.
* Sets the data type.
*
* @param dataType the data type to set
*/
......@@ -266,7 +265,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -277,7 +276,7 @@ public class YangLeaf implements YangCommonInfo, Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -50,7 +50,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
* +--------------+---------+-------------+------------------+
*/
/**
* Leaf-list data represented in YANG.
* Represents leaf-list data represented in YANG.
*/
public class YangLeafList implements YangCommonInfo, Parsable {
......@@ -122,13 +122,13 @@ public class YangLeafList implements YangCommonInfo, Parsable {
private YangType<?> dataType;
/**
* Default Constructor to create a YANG leaf-list.
* Creates a YANG leaf-list.
*/
public YangLeafList() {
}
/**
* Get the leaf-list name.
* Returns the leaf-list name.
*
* @return the leaf-list name
*/
......@@ -137,7 +137,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the leaf-list name.
* Sets the leaf-list name.
*
* @param leafListName the leaf-list name to set
*/
......@@ -146,7 +146,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the config flag.
* Returns the config flag.
*
* @return the config flag
*/
......@@ -155,7 +155,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the config flag.
* Sets the config flag.
*
* @param isCfg the config flag
*/
......@@ -164,7 +164,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -174,7 +174,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -184,7 +184,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the max elements no.
* Returns the max elements no.
*
* @return the max elements no
*/
......@@ -193,7 +193,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the max elements no.
* Sets the max elements no.
*
* @param maxElelements max elements no
*/
......@@ -202,7 +202,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the min elements no.
* Returns the min elements no.
*
* @return the min elements no
*/
......@@ -211,7 +211,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the min elements no.
* Sets the min elements no.
*
* @param minElements the min elements no
*/
......@@ -220,7 +220,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -230,7 +230,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -240,7 +240,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -250,7 +250,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -260,7 +260,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the units.
* Returns the units.
*
* @return the units
*/
......@@ -269,7 +269,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the units.
* Sets the units.
*
* @param units the units to set
*/
......@@ -278,7 +278,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Get the data type.
* Returns the data type.
*
* @return the data type
*/
......@@ -287,7 +287,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Set the data type.
* Sets the data type.
*
* @param dataType the data type to set
*/
......@@ -306,7 +306,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -317,7 +317,7 @@ public class YangLeafList implements YangCommonInfo, Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
/*Copyright 2016.year 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
/*
* Copyright 2016 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.
*/
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;
import java.util.List;
......@@ -23,7 +26,7 @@ import java.util.List;
public interface YangLeavesHolder {
/**
* Get the list of leaves from data holder like container / list.
* Returns the list of leaves from data holder like container / list.
*
* @return the list of leaves.
*/
......@@ -37,7 +40,7 @@ public interface YangLeavesHolder {
void addLeaf(YangLeaf leaf);
/**
* Get the list of leaf-list from data holder like container / list.
* Returns the list of leaf-list from data holder like container / list.
*
* @return the list of leaf-list.
*/
......
......@@ -65,7 +65,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
/**
* List data represented in YANG.
* Represents list data represented in YANG.
*/
public class YangList extends YangNode
implements YangLeavesHolder, YangCommonInfo, Parsable, CollisionDetector {
......@@ -166,14 +166,14 @@ public class YangList extends YangNode
private YangStatusType status = YangStatusType.CURRENT;
/**
* Constructor.
* Creates a YANG list object.
*/
public YangList() {
super(YangNodeType.LIST_NODE);
}
/**
* Get the YANG list name.
* Returns the YANG list name.
*
* @return YANG list name
*/
......@@ -183,7 +183,7 @@ public class YangList extends YangNode
}
/**
* Set the YANG list name.
* Sets the YANG list name.
*
* @param name YANG list name
*/
......@@ -193,7 +193,7 @@ public class YangList extends YangNode
}
/**
* Get the config flag.
* Returns the config flag.
*
* @return the isConfig
*/
......@@ -202,7 +202,7 @@ public class YangList extends YangNode
}
/**
* Set the config flag.
* Sets the config flag.
*
* @param isCfg the config flag
*/
......@@ -211,7 +211,7 @@ public class YangList extends YangNode
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -221,7 +221,7 @@ public class YangList extends YangNode
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -231,7 +231,7 @@ public class YangList extends YangNode
}
/**
* Get the list of key field names.
* Returns the list of key field names.
*
* @return the list of key field names
*/
......@@ -240,7 +240,7 @@ public class YangList extends YangNode
}
/**
* Set the list of key field names.
* Sets the list of key field names.
*
* @param keyList the list of key field names
*/
......@@ -249,7 +249,7 @@ public class YangList extends YangNode
}
/**
* Add a key field name.
* Adds a key field name.
*
* @param key key field name.
* @throws DataModelException a violation of data model rules
......@@ -268,7 +268,7 @@ public class YangList extends YangNode
}
/**
* Get the list of leaves.
* Returns the list of leaves.
*
* @return the list of leaves
*/
......@@ -278,7 +278,7 @@ public class YangList extends YangNode
}
/**
* Set the list of leaves.
* Sets the list of leaves.
*
* @param leafsList the list of leaf to set
*/
......@@ -287,7 +287,7 @@ public class YangList extends YangNode
}
/**
* Add a leaf.
* Adds a leaf.
*
* @param leaf the leaf to be added
*/
......@@ -301,7 +301,7 @@ public class YangList extends YangNode
}
/**
* Get the list of leaf-list.
* Returns the list of leaf-list.
*
* @return the list of leaf-list
*/
......@@ -311,7 +311,7 @@ public class YangList extends YangNode
}
/**
* Set the list of leaf-list.
* Sets the list of leaf-list.
*
* @param listOfLeafList the list of leaf-list to set
*/
......@@ -320,7 +320,7 @@ public class YangList extends YangNode
}
/**
* Add a leaf-list.
* Adds a leaf-list.
*
* @param leafList the leaf-list to be added
*/
......@@ -334,7 +334,7 @@ public class YangList extends YangNode
}
/**
* Get the max elements.
* Returns the max elements.
*
* @return the max elements
*/
......@@ -343,7 +343,7 @@ public class YangList extends YangNode
}
/**
* Set the max elements.
* Sets the max elements.
*
* @param max the max elements
*/
......@@ -352,7 +352,7 @@ public class YangList extends YangNode
}
/**
* Get the minimum elements.
* Returns the minimum elements.
*
* @return the minimum elements
*/
......@@ -361,7 +361,7 @@ public class YangList extends YangNode
}
/**
* Set the minimum elements.
* Sets the minimum elements.
*
* @param minElements the minimum elements
*/
......@@ -370,7 +370,7 @@ public class YangList extends YangNode
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -380,7 +380,7 @@ public class YangList extends YangNode
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -390,7 +390,7 @@ public class YangList extends YangNode
}
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
......@@ -400,7 +400,7 @@ public class YangList extends YangNode
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -420,7 +420,7 @@ public class YangList extends YangNode
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -430,7 +430,7 @@ public class YangList extends YangNode
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -17,6 +17,7 @@ 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;
......@@ -65,7 +66,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.resolveLi
*/
/**
* Data model node to maintain information defined in YANG module.
* Represents data model node to maintain information defined in YANG module.
*/
public class YangModule extends YangNode
implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, HasResolutionInfo {
......@@ -188,7 +189,7 @@ public class YangModule extends YangNode
private List<YangResolutionInfo> unresolvedResolutionList;
/**
* Create a YANG node of module type.
* Creates a YANG node of module type.
*/
public YangModule() {
......@@ -201,7 +202,7 @@ public class YangModule extends YangNode
}
/**
* Get name of the module.
* Returns name of the module.
*
* @return module name
*/
......@@ -211,7 +212,7 @@ public class YangModule extends YangNode
}
/**
* Set module name.
* Sets module name.
*
* @param moduleName module name
*/
......@@ -221,7 +222,7 @@ public class YangModule extends YangNode
}
/**
* Get the contact details of the module owner.
* Returns the contact details of the module owner.
*
* @return the contact details of YANG owner
*/
......@@ -230,7 +231,7 @@ public class YangModule extends YangNode
}
/**
* Set the contact details of the module owner.
* Sets the contact details of the module owner.
*
* @param contact the contact details of YANG owner
*/
......@@ -239,7 +240,7 @@ public class YangModule extends YangNode
}
/**
* Get the description of module.
* Returns the description of module.
*
* @return the description of YANG module
*/
......@@ -249,7 +250,7 @@ public class YangModule extends YangNode
}
/**
* Set the description of module.
* Sets the description of module.
*
* @param description set the description of YANG module
*/
......@@ -259,7 +260,7 @@ public class YangModule extends YangNode
}
/**
* Get the list of imported modules.
* Returns the list of imported modules.
*
* @return the list of imported modules
*/
......@@ -268,7 +269,7 @@ public class YangModule extends YangNode
}
/**
* Add the imported module information to the import list.
* Adds the imported module information to the import list.
*
* @param importedModule module being imported
*/
......@@ -282,7 +283,7 @@ public class YangModule extends YangNode
}
/**
* Get the list of included sub modules.
* Returns the list of included sub modules.
*
* @return the included list of sub modules
*/
......@@ -291,7 +292,7 @@ public class YangModule extends YangNode
}
/**
* Add the included sub module information to the include list.
* Adds the included sub module information to the include list.
*
* @param includeModule submodule being included
*/
......@@ -305,7 +306,7 @@ public class YangModule extends YangNode
}
/**
* Get the list of leaves in module.
* Returns the list of leaves in module.
*
* @return the list of leaves
*/
......@@ -315,7 +316,7 @@ public class YangModule extends YangNode
}
/**
* Add a leaf in module.
* Adds a leaf in module.
*
* @param leaf the leaf to be added
*/
......@@ -325,7 +326,7 @@ public class YangModule extends YangNode
}
/**
* Get the list of leaf-list from module.
* Returns the list of leaf-list from module.
*
* @return the list of leaf-list
*/
......@@ -335,7 +336,7 @@ public class YangModule extends YangNode
}
/**
* Add a leaf-list in module.
* Adds a leaf-list in module.
*
* @param leafList the leaf-list to be added
*/
......@@ -345,7 +346,7 @@ public class YangModule extends YangNode
}
/**
* Get the name space of module elements.
* Returns the name space of module elements.
*
* @return the nameSpace
*/
......@@ -354,7 +355,7 @@ public class YangModule extends YangNode
}
/**
* Set the name space of module elements.
* Sets the name space of module elements.
*
* @param nameSpace the nameSpace to set
*/
......@@ -363,7 +364,7 @@ public class YangModule extends YangNode
}
/**
* Get the modules organization.
* Returns the modules organization.
*
* @return the organization
*/
......@@ -372,7 +373,7 @@ public class YangModule extends YangNode
}
/**
* Set the modules organization.
* Sets the modules organization.
*
* @param org the organization to set
*/
......@@ -381,7 +382,7 @@ public class YangModule extends YangNode
}
/**
* Get the prefix.
* Returns the prefix.
*
* @return the prefix
*/
......@@ -390,7 +391,7 @@ public class YangModule extends YangNode
}
/**
* Set the prefix.
* Sets the prefix.
*
* @param prefix the prefix to set
*/
......@@ -407,7 +408,7 @@ public class YangModule extends YangNode
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -417,7 +418,7 @@ public class YangModule extends YangNode
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -427,7 +428,7 @@ public class YangModule extends YangNode
}
/**
* Get the revision.
* Returns the revision.
*
* @return the revision
*/
......@@ -436,7 +437,7 @@ public class YangModule extends YangNode
}
/**
* Set the revision.
* Sets the revision.
*
* @param revision the revision to set
*/
......@@ -445,7 +446,7 @@ public class YangModule extends YangNode
}
/**
* Get the version.
* Returns the version.
*
* @return the version
*/
......@@ -454,7 +455,7 @@ public class YangModule extends YangNode
}
/**
* Set the version.
* Sets the version.
*
* @param version the version to set
*/
......@@ -473,7 +474,7 @@ public class YangModule extends YangNode
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -486,7 +487,7 @@ public class YangModule extends YangNode
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -44,7 +44,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
*/
/**
* Maintain information defined in YANG must.
* Represents information defined in YANG must.
*/
public class YangMust implements YangDesc, YangReference, Parsable {
......@@ -64,13 +64,13 @@ public class YangMust implements YangDesc, YangReference, Parsable {
private String reference;
/**
* Create a YANG must restriction.
* Creates a YANG must restriction.
*/
public YangMust() {
}
/**
* Get the constraint.
* Returns the constraint.
*
* @return the constraint
*/
......@@ -79,7 +79,7 @@ public class YangMust implements YangDesc, YangReference, Parsable {
}
/**
* Set the constraint.
* Sets the constraint.
*
* @param constratint the constraint to set
*/
......@@ -88,7 +88,7 @@ public class YangMust implements YangDesc, YangReference, Parsable {
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -98,7 +98,7 @@ public class YangMust implements YangDesc, YangReference, Parsable {
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -108,7 +108,7 @@ public class YangMust implements YangDesc, YangReference, Parsable {
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -118,7 +118,7 @@ public class YangMust implements YangDesc, YangReference, Parsable {
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -138,7 +138,7 @@ public class YangMust implements YangDesc, YangReference, Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -148,7 +148,7 @@ public class YangMust implements YangDesc, YangReference, Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -30,20 +30,20 @@ import org.onosproject.yangutils.utils.YangConstructType;
*/
/**
* Name space to be used for the XML data tree.
* Represents name space to be used for the XML data tree.
*/
public class YangNameSpace implements Parsable {
private String uri;
/**
* Default constructor.
* Creats a YANG name space object.
*/
public YangNameSpace() {
}
/**
* Get the name space URI.
* Returns the name space URI.
*
* @return the URI
*/
......@@ -52,7 +52,7 @@ public class YangNameSpace implements Parsable {
}
/**
* Set the name space URI.
* Sets the name space URI.
*
* @param uri the URI to set
*/
......@@ -71,24 +71,22 @@ public class YangNameSpace implements Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
@Override
public void validateDataOnEntry() throws DataModelException {
// TODO auto-generated method stub, to be implemented by parser
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
@Override
public void validateDataOnExit() throws DataModelException {
// TODO auto-generated method stub, to be implemented by parser
}
}
......
......@@ -18,7 +18,7 @@ package org.onosproject.yangutils.datamodel;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
/**
* Base class of a node in data model tree.
* Represents base class of a node in data model tree.
*/
public abstract class YangNode {
......@@ -48,21 +48,21 @@ public abstract class YangNode {
private YangNode previousSibling;
/**
* Get the nodes name.
* Returns the nodes name.
*
* @return nodes name
*/
public abstract String getName();
/**
* Set the nodes name.
* Sets the nodes name.
*
* @param name nodes name
*/
public abstract void setName(String name);
/**
* Default constructor is made private to ensure node type is always set.
* Creates a YANG node object.
*/
@SuppressWarnings("unused")
private YangNode() {
......@@ -70,7 +70,7 @@ public abstract class YangNode {
}
/**
* Create a specific type of node.
* Creates a specific type of node.
*
* @param type of YANG node
*/
......@@ -79,7 +79,7 @@ public abstract class YangNode {
}
/**
* Get the node type.
* Returns the node type.
*
* @return node type
*/
......@@ -88,7 +88,7 @@ public abstract class YangNode {
}
/**
* Set the node type.
* Sets the node type.
*
* @param nodeType type of node
*/
......@@ -97,7 +97,7 @@ public abstract class YangNode {
}
/**
* Get the parent of node.
* Returns the parent of node.
*
* @return parent of node
*/
......@@ -106,7 +106,7 @@ public abstract class YangNode {
}
/**
* Set the parent of node.
* Sets the parent of node.
*
* @param parent node
*/
......@@ -115,7 +115,7 @@ public abstract class YangNode {
}
/**
* Get the first child of node.
* Returns the first child of node.
*
* @return first child of node
*/
......@@ -124,7 +124,7 @@ public abstract class YangNode {
}
/**
* Set the first instance of a child node.
* Sets the first instance of a child node.
*
* @param child is only child to be set
*/
......@@ -133,7 +133,7 @@ public abstract class YangNode {
}
/**
* Get the next sibling of node.
* Returns the next sibling of node.
*
* @return next sibling of node
*/
......@@ -142,7 +142,7 @@ public abstract class YangNode {
}
/**
* Set the next sibling of node.
* Sets the next sibling of node.
*
* @param sibling YANG node
*/
......@@ -151,7 +151,7 @@ public abstract class YangNode {
}
/**
* Get the previous sibling.
* Returns the previous sibling.
*
* @return previous sibling node
*/
......@@ -160,7 +160,7 @@ public abstract class YangNode {
}
/**
* Set the previous sibling.
* Sets the previous sibling.
*
* @param previousSibling points to predecessor sibling
*/
......@@ -169,7 +169,7 @@ public abstract class YangNode {
}
/**
* Add a child node, the children sibling list will be sorted based on node
* Adds a child node, the children sibling list will be sorted based on node
* type.
*
* @param newChild refers to a child to be added
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.datamodel;
/**
* YANG node identifier which is a combination of prefix and name.
* Represents YANG node identifier which is a combination of prefix and name.
*/
public class YangNodeIdentifier {
......@@ -43,7 +43,7 @@ public class YangNodeIdentifier {
}
/**
* Set name of the node identifier.
* Sets name of the node identifier.
*
* @param name name of the node identifier
*/
......@@ -61,7 +61,7 @@ public class YangNodeIdentifier {
}
/**
* Set prefix of the node identifier.
* Sets prefix of the node identifier.
*
* @param prefix prefix of the node identifier
*/
......
......@@ -16,7 +16,7 @@
package org.onosproject.yangutils.datamodel;
/**
* Node type in data model tree corresponding to YANG schema.
* Represents node type in data model tree corresponding to YANG schema.
*/
public enum YangNodeType {
/**
......
......@@ -18,6 +18,7 @@ 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;
......@@ -71,10 +72,10 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
/**
* Data model node to maintain information defined in YANG notification.
* Represents data model node to maintain information defined in YANG notification.
*/
public class YangNotification extends YangNode implements YangLeavesHolder, YangCommonInfo, Parsable,
CollisionDetector {
CollisionDetector {
/**
* Name of the notification.
......
......@@ -18,6 +18,7 @@ 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;
......@@ -64,7 +65,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
/**
* Data model node to maintain information defined in YANG output.
* Represents data model node to maintain information defined in YANG output.
*/
public class YangOutput extends YangNode implements YangLeavesHolder, Parsable, CollisionDetector {
......
......@@ -47,7 +47,7 @@ import java.util.List;
* +---------------+---------+-------------+
*/
/**
* Pattern restriction information. The regular expression restriction on string
* Represents pattern restriction information. The regular expression restriction on string
* data type.
*/
public class YangPatternRestriction {
......@@ -63,14 +63,14 @@ public class YangPatternRestriction {
private List<String> basePattern;
/**
* Default constructor.
* Creates a YANG pattern restriction object.
*/
public YangPatternRestriction() {
setPatternList(new LinkedList<String>());
}
/**
* Get the pattern restriction defined for the current type.
* Returns the pattern restriction defined for the current type.
*
* @return pattern restriction defined for the current type.
*/
......@@ -79,7 +79,7 @@ public class YangPatternRestriction {
}
/**
* Set the pattern restriction defined for the current type.
* Sets the pattern restriction defined for the current type.
*
* @param pattern pattern restriction defined for the current type..
*/
......@@ -88,7 +88,7 @@ public class YangPatternRestriction {
}
/**
* Add a new pattern to the list of pattern restriction.
* Adds a new pattern to the list of pattern restriction.
*
* @param newPattern pattern restriction.
*/
......@@ -97,7 +97,7 @@ public class YangPatternRestriction {
}
/**
* Get the pattern restriction defined in base type.
* Returns the pattern restriction defined in base type.
*
* @return pattern restriction defined in base type.
*/
......@@ -106,7 +106,7 @@ public class YangPatternRestriction {
}
/**
* Set the pattern restriction defined in base type.
* Sets the pattern restriction defined in base type.
*
* @param basePattern pattern restriction defined in base type.
*/
......
......@@ -14,7 +14,7 @@ limitations under the License.*/
package org.onosproject.yangutils.datamodel;
/**
* Single interval information of a range.
* Represents single interval information of a range.
*
* @param <T> range type based on the data type.
*/
......@@ -31,13 +31,13 @@ public class YangRangeInterval<T extends Comparable<T>> {
private T endValue;
/**
* Default constructor.
* Creates YANG range interval object.
*/
public YangRangeInterval() {
}
/**
* Get the starting value of the range interval.
* Returns the starting value of the range interval.
*
* @return the starting value of the range interval.
*/
......@@ -46,7 +46,7 @@ public class YangRangeInterval<T extends Comparable<T>> {
}
/**
* Set the starting value of the range interval.
* Sets the starting value of the range interval.
*
* @param startValue the starting value of the range interval.
*/
......@@ -55,7 +55,7 @@ public class YangRangeInterval<T extends Comparable<T>> {
}
/**
* Get the last value of the range interval.
* Returns the last value of the range interval.
*
* @return last value of the range interval.
*/
......@@ -64,7 +64,7 @@ public class YangRangeInterval<T extends Comparable<T>> {
}
/**
* Set the last value of the range interval.
* Sets the last value of the range interval.
*
* @param endValue last value of the range interval.
*/
......
......@@ -48,7 +48,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
* for the type being restricted, respectively.
*/
/**
* Ascending range restriction information.
* Represents ascending range restriction information.
*
* @param <T> range type (data type)
*/
......@@ -81,35 +81,34 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
private String description;
/**
* Default constructor.
* Creates YANG range restriction object.
*/
public YangRangeRestriction() {
}
/**
* Get the list of range interval restriction in ascending order.
* Returns the list of range interval restriction in ascending order.
*
* @return list of range interval restriction in ascending order.
* @return list of range interval restriction in ascending order
*/
public List<YangRangeInterval<T>> getAscendingRangeIntervals() {
return ascendingRangeIntervals;
}
/**
* Set the list of range interval restriction in ascending order.
* Sets the list of range interval restriction in ascending order.
*
* @param rangeList list of range interval restriction in ascending order.
* @param rangeList list of range interval restriction in ascending order
*/
private void setAscendingRangeIntervals(List<YangRangeInterval<T>> rangeList) {
ascendingRangeIntervals = rangeList;
}
/**
* Get the minimum valid value as per the restriction.
* Returns the minimum valid value as per the restriction.
*
* @throws DataModelException data model exception for minimum restriction.
*
* @return minimum restricted value.
* @throws DataModelException data model exception for minimum restriction
* @return minimum restricted value
*/
public T getMinRestrictedvalue() throws DataModelException {
if (getAscendingRangeIntervals() == null) {
......@@ -122,11 +121,10 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Get the maximum valid value as per the restriction.
*
* @throws DataModelException data model exception for maximum restriction.
* Returns the maximum valid value as per the restriction.
*
* @return minimum maximum value.
* @throws DataModelException data model exception for maximum restriction
* @return minimum maximum value
*/
public T getMaxRestrictedvalue() throws DataModelException {
if (getAscendingRangeIntervals() == null) {
......@@ -140,11 +138,11 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Add new interval to extend its range in the last. i.e. newly added
* Adds new interval to extend its range in the last. i.e. newly added
* interval needs to be bigger than the biggest interval in the list.
*
* @param newInterval restricted length interval.
* @throws DataModelException data model exception for range restriction.
* @param newInterval restricted length interval
* @throws DataModelException data model exception for range restriction
*/
public void addRangeRestrictionInterval(YangRangeInterval<T> newInterval) throws DataModelException {
......@@ -173,9 +171,9 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Get the textual reference of the length restriction.
* Returns the textual reference of the length restriction.
*
* @return textual reference of the length restriction.
* @return textual reference of the length restriction
*/
@Override
public String getReference() {
......@@ -183,9 +181,9 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Set the textual reference of the length restriction.
* Sets the textual reference of the length restriction.
*
* @param ref textual reference of the length restriction.
* @param ref textual reference of the length restriction
*/
@Override
public void setReference(String ref) {
......@@ -193,9 +191,9 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Get the description of the length restriction.
* Returns the description of the length restriction.
*
* @return description of the length restriction.
* @return description of the length restriction
*/
@Override
public String getDescription() {
......@@ -203,9 +201,9 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Set the description of the length restriction.
* Sets the description of the length restriction.
*
* @param desc description of the length restriction.
* @param desc description of the length restriction
*/
@Override
public void setDescription(String desc) {
......@@ -214,9 +212,9 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Get application's error message, to be used for data error.
* Returns application's error message, to be used for data error.
*
* @return Application's error message, to be used for data error.
* @return Application's error message, to be used for data error
*/
@Override
public String getGetErrorMessage() {
......@@ -224,9 +222,9 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Set Application's error message, to be used for data error.
* Sets Application's error message, to be used for data error.
*
* @param errMsg Application's error message, to be used for data error.
* @param errMsg Application's error message, to be used for data error
*/
@Override
public void setErrorMessage(String errMsg) {
......@@ -235,9 +233,9 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Get application's error tag, to be used for data error.
* Returns application's error tag, to be used for data error.
*
* @return application's error tag, to be used for data error.
* @return application's error tag, to be used for data error
*/
@Override
public String getGetErrorAppTag() {
......@@ -245,7 +243,7 @@ public class YangRangeRestriction<T extends Comparable<T>> implements YangDesc,
}
/**
* Set application's error tag, to be used for data error.
* Sets application's error tag, to be used for data error.
*
* @param errTag application's error tag, to be used for data error.
*/
......
......@@ -20,17 +20,18 @@ package org.onosproject.yangutils.datamodel;
* parsing and translator processing of reference.
*/
public interface YangReference {
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference.
* @return the reference
*/
String getReference();
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set.
* @param reference the reference to set
*/
void setReference(String reference);
......
......@@ -17,10 +17,11 @@
package org.onosproject.yangutils.datamodel;
import java.util.Stack;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
/**
* Resolution object which will be resolved by linker.
* Represents resolution object which will be resolved by linker.
*/
public class YangResolutionInfo<T> {
......@@ -43,8 +44,8 @@ public class YangResolutionInfo<T> {
private boolean isResolved;
/*
* Stack for type/uses is maintained for hierarchical references, this
* is used during resolution.
* Stack for type/uses is maintained for hierarchical references, this is
* used during resolution.
*/
private Stack<T> partialResolvedStack;
......@@ -72,8 +73,8 @@ public class YangResolutionInfo<T> {
* @param charPositionInLine error character position in line
*/
public YangResolutionInfo(T dataNode, ResolutionType resolutionType,
YangNode holderNode, String prefix, int lineNumber,
int charPositionInLine) {
YangNode holderNode, String prefix, int lineNumber,
int charPositionInLine) {
this.setHolderOfEntityToResolve(holderNode);
this.setEntityToResolve(dataNode);
this.setPrefix(prefix);
......@@ -92,8 +93,8 @@ public class YangResolutionInfo<T> {
* @param charPositionInLine error character position in line
*/
public YangResolutionInfo(T dataNode, ResolutionType resolutionType,
YangNode holderNode, int lineNumber,
int charPositionInLine) {
YangNode holderNode, int lineNumber,
int charPositionInLine) {
this.setHolderOfEntityToResolve(holderNode);
this.setEntityToResolve(dataNode);
this.setLineNumber(lineNumber);
......@@ -106,7 +107,7 @@ public class YangResolutionInfo<T> {
* @param resolutionInfoNodePrefix module/sub-module prefix
* @throws DataModelException DataModelException a violation of data model rules
*/
public void resolveLinkingForResolutionInfo(String resolutionInfoNodePrefix) throws DataModelException {
public void resolveLinkingForResolutionInfo(String resolutionInfoNodePrefix) throws DataModelException {
this.resolutionInfoRootNodePrefix = resolutionInfoNodePrefix;
......@@ -177,8 +178,8 @@ public class YangResolutionInfo<T> {
}
if (isMoreReferenceDetected) {
/*
* If more reference are present, tree traversal must start
* from first child again, to check the availability of
* If more reference are present, tree traversal must start from
* first child again, to check the availability of
* typedef/grouping.
*/
node = parentNode.getChild();
......@@ -197,14 +198,14 @@ public class YangResolutionInfo<T> {
* @return flag to indicate whether resolution is done
* @throws DataModelException a violation of data model rules
*/
private boolean resolveLinkingForNode(YangNode node, YangNode parentNode) throws
DataModelException {
private boolean resolveLinkingForNode(YangNode node, YangNode parentNode) throws DataModelException {
/*
* Check if name of node name matches with the entity name
* under resolution.
* Check if name of node name matches with the entity name under
* resolution.
*/
if (isNodeNameSameAsResolutionInfoName(node)) {
// Add reference of entity to the node under resolution.
// Adds reference of entity to the node under resolution.
addReferredEntityLink(node);
// Check if referred entity has further reference to uses/type.
if (!(isMoreReferencePresent(node))) {
......@@ -212,7 +213,7 @@ public class YangResolutionInfo<T> {
resolveStackAndAddToStack(node);
return true;
} else {
// Add referred type/uses to the stack.
// Adds referred type/uses to the stack.
addToPartialResolvedStack(node);
/*
* Check whether referred type is resolved, partially resolved
......@@ -230,25 +231,25 @@ public class YangResolutionInfo<T> {
updateResolutionTypeToPartial();
return true;
} else {
/*
* Check if prefix is present to find that the derived
* reference is for intra file or inter file, if it's
* inter-file return and stop further processing.
*/
/*
* Check if prefix is present to find that the derived
* reference is for intra file or inter file, if it's
* inter-file return and stop further processing.
*/
if (isExternalPrefixPresent(node)) {
/*
* Update the resolution type to partially resolved for all
* type/uses in stack
* Update the resolution type to partially resolved for
* all type/uses in stack
*/
updateResolutionTypeToPartial();
return true;
} else {
/*
* If prefix is not present it indicates intra-file
* dependency in this case set the node back to first
* child, as referred entity may appear in any order
* and continue with the resolution.
*/
/*
* If prefix is not present it indicates intra-file
* dependency in this case set the node back to first
* child, as referred entity may appear in any order and
* continue with the resolution.
*/
isMoreReferenceDetected = true;
return false;
}
......@@ -265,26 +266,26 @@ public class YangResolutionInfo<T> {
*/
private void updateResolutionTypeToPartial() throws DataModelException {
// For all entries in stack calls for the resolution in type/uses.
for (T entity:getPartialResolvedStack()) {
for (T entity : getPartialResolvedStack()) {
if (!(entity instanceof Resolvable)) {
throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
}
if (((Resolvable) entity).getResolvableStatus() == ResolvableStatus.UNRESOLVED) {
// Set the resolution status in inside the type/uses.
// Sets the resolution status in inside the type/uses.
((Resolvable) entity).setResolvableStatus(ResolvableStatus.PARTIALLY_RESOLVED);
}
}
}
/**
* Add referred type/uses to the stack and resolve the stack.
* Adds referred type/uses to the stack and resolve the stack.
*
* @param node typedef/grouping node
* @throws DataModelException a violation of data model rules
*/
private void resolveStackAndAddToStack(YangNode node) throws DataModelException {
if (getEntityToResolve() instanceof YangType) {
// Add to the stack only for YANG typedef.
// Adds to the stack only for YANG typedef.
getPartialResolvedStack().push((T) ((YangTypeDef) node).getDataType());
}
// Don't add to stack in case of YANG grouping.
......@@ -303,13 +304,13 @@ public class YangResolutionInfo<T> {
/*
* Checks if type is partially resolved.
*/
if (((YangType) getPartialResolvedStack().peek()).getResolvableStatus() ==
ResolvableStatus.PARTIALLY_RESOLVED) {
if (((YangType) getPartialResolvedStack().peek())
.getResolvableStatus() == ResolvableStatus.PARTIALLY_RESOLVED) {
return true;
}
} else if (getPartialResolvedStack().peek() instanceof YangUses) {
if (((YangUses) getPartialResolvedStack().peek()).getResolvableStatus() ==
ResolvableStatus.PARTIALLY_RESOLVED) {
if (((YangUses) getPartialResolvedStack().peek())
.getResolvableStatus() == ResolvableStatus.PARTIALLY_RESOLVED) {
return true;
}
}
......@@ -326,13 +327,11 @@ public class YangResolutionInfo<T> {
/*
* Checks if type is partially resolved.
*/
if (((YangType) getPartialResolvedStack().peek()).getResolvableStatus() ==
ResolvableStatus.RESOLVED) {
if (((YangType) getPartialResolvedStack().peek()).getResolvableStatus() == ResolvableStatus.RESOLVED) {
return true;
}
} else if (getPartialResolvedStack().peek() instanceof YangUses) {
if (((YangUses) getPartialResolvedStack().peek()).getResolvableStatus() ==
ResolvableStatus.RESOLVED) {
if (((YangUses) getPartialResolvedStack().peek()).getResolvableStatus() == ResolvableStatus.RESOLVED) {
return true;
}
}
......@@ -361,7 +360,6 @@ public class YangResolutionInfo<T> {
return false;
}
/**
* Check if node name is same as name in resolution info, i.e. name of
* typedef/grouping is same as name of type/uses.
......@@ -387,7 +385,7 @@ public class YangResolutionInfo<T> {
}
/**
* Add reference of grouping/typedef in uses/type.
* Adds reference of grouping/typedef in uses/type.
*
* @param node grouping/typedef node
* @throws DataModelException a violation of data model rules
......@@ -457,30 +455,30 @@ public class YangResolutionInfo<T> {
*/
private void resolveCompleteStack() throws DataModelException {
// For all entries in stack calls for the resolution in type/uses.
for (T entity:getPartialResolvedStack()) {
for (T entity : getPartialResolvedStack()) {
if (!(entity instanceof Resolvable)) {
throw new DataModelException("Data Model Exception: Entity to resolved is other than type/uses");
}
((Resolvable) entity).resolve();
// Set the resolution status in inside the type/uses.
// Sets the resolution status in inside the type/uses.
((Resolvable) entity).setResolvableStatus(ResolvableStatus.RESOLVED);
}
/*
* Set the resolution status in resolution info present in resolution
* Sets the resolution status in resolution info present in resolution
* list.
*/
setIsResolved(true);
}
/**
* Add to partial resolved stack.
* Adds to partial resolved stack.
*
* @param node grouping/typedef node
* @throws DataModelException a violation of data model rules
*/
private void addToPartialResolvedStack(YangNode node) throws DataModelException {
if (getPartialResolvedStack().peek() instanceof YangType) {
// Add to the stack only for YANG typedef.
// Adds to the stack only for YANG typedef.
getPartialResolvedStack().push((T) ((YangTypeDef) node).getDataType());
} else if (getPartialResolvedStack().peek() instanceof YangUses) {
getPartialResolvedStack().push((T) getUsesInGrouping(node));
......@@ -522,7 +520,7 @@ public class YangResolutionInfo<T> {
}
/**
* Set prefix of imported module.
* Sets prefix of imported module.
*
* @param prefix of imported module
*/
......@@ -540,7 +538,7 @@ public class YangResolutionInfo<T> {
}
/**
* Set parsable entity to be resolved.
* Sets parsable entity to be resolved.
*
* @param entityToResolve YANG entity to be resolved
*/
......@@ -558,7 +556,7 @@ public class YangResolutionInfo<T> {
}
/**
* Set parent YANG node holder for the entity to be resolved.
* Sets parent YANG node holder for the entity to be resolved.
*
* @param holderOfEntityToResolve parent YANG node holder
*/
......@@ -576,7 +574,7 @@ public class YangResolutionInfo<T> {
}
/**
* Set error position.
* Sets error position.
*
* @param charPosition position of error
*/
......@@ -594,7 +592,7 @@ public class YangResolutionInfo<T> {
}
/**
* Set error character position in line.
* Sets error character position in line.
*
* @param lineNumber error character position in line
*/
......@@ -612,7 +610,7 @@ public class YangResolutionInfo<T> {
}
/**
* Set status of resolution.
* Sets status of resolution.
*
* @param isResolved resolution status
*/
......@@ -630,7 +628,7 @@ public class YangResolutionInfo<T> {
}
/**
* Set stack of YANG type with partially resolved YANG construct hierarchy.
* Sets stack of YANG type with partially resolved YANG construct hierarchy.
*
* @param partialResolvedStack partial resolved YANG construct stack
*/
......
......@@ -40,7 +40,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
* +--------------+---------+-------------+------------------+
*/
/**
* Maintains the information about the revision.
* Represents the information about the revision.
*/
public class YangRevision implements YangDesc, YangReference, Parsable {
......@@ -60,13 +60,13 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
private String reference;
/**
* Default constructor.
* Creates a YANG revision object.
*/
public YangRevision() {
}
/**
* Get the revision date.
* Returns the revision date.
*
* @return the revision date
*/
......@@ -75,7 +75,7 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
}
/**
* Set the revision date.
* Sets the revision date.
*
* @param revDate the revision date to set
*/
......@@ -84,7 +84,7 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -94,7 +94,7 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -104,7 +104,7 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -114,7 +114,7 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -134,7 +134,7 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -145,7 +145,7 @@ public class YangRevision implements YangDesc, YangReference, Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -54,10 +54,10 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.detectCol
*/
/**
* Data model node to maintain information defined in YANG rpc.
* Represents data model node to maintain information defined in YANG rpc.
*/
public class YangRpc extends YangNode implements YangCommonInfo, Parsable,
CollisionDetector {
CollisionDetector {
/**
* Name of the rpc.
......
......@@ -18,15 +18,16 @@ package org.onosproject.yangutils.datamodel;
* translator processing of status.
*/
public interface YangStatus {
/**
* Get the status.
* Returns the status.
*
* @return the status
*/
YangStatusType getStatus();
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......
......@@ -25,7 +25,7 @@ import java.math.BigInteger;
*
*/
/**
* The restriction for string data type.
* Represents the restriction for string data type.
*/
public class YangStringRestriction {
......@@ -75,51 +75,51 @@ public class YangStringRestriction {
private YangPatternRestriction patternRestriction;
/**
* Default constructor.
* Creates a YANG string restriction object.
*/
public YangStringRestriction() {
}
/**
* Get the length restriction on the string data.
* Returns the length restriction on the string data.
*
* @return length restriction on the string data.
* @return length restriction on the string data
*/
public YangRangeRestriction<BigInteger> getLengthRestriction() {
return lengthRestriction;
}
/**
* Set the length restriction on the string data.
* Sets the length restriction on the string data.
*
* @param lengthRestriction length restriction on the string data.
* @param lengthRestriction length restriction on the string data
*/
public void setLengthRestriction(YangRangeRestriction<BigInteger> lengthRestriction) {
this.lengthRestriction = lengthRestriction;
}
/**
* Get the pattern restriction for the type.
* Returns the pattern restriction for the type.
*
* @return pattern restriction for the type.
* @return pattern restriction for the type
*/
public YangPatternRestriction getPatternRestriction() {
return patternRestriction;
}
/**
* Set the pattern restriction for the type.
* Sets the pattern restriction for the type.
*
* @param patternRestriction pattern restriction for the type.
* @param patternRestriction pattern restriction for the type
*/
private void setPatternRestriction(YangPatternRestriction patternRestriction) {
this.patternRestriction = patternRestriction;
}
/**
* Add a new pattern restriction for the type.
* Adds a new pattern restriction for the type.
*
* @param newPattern new pattern restriction for the type.
* @param newPattern new pattern restriction for the type
*/
public void addPattern(String newPattern) {
if (getPatternRestriction() == null) {
......
......@@ -17,6 +17,7 @@ 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;
......@@ -72,7 +73,7 @@ import static org.onosproject.yangutils.datamodel.utils.DataModelUtils.resolveLi
* +--------------+---------+-------------+------------------+
*/
/**
* Data model node to maintain information defined in YANG sub-module.
* Represents data model node to maintain information defined in YANG sub-module.
*/
public class YangSubModule extends YangNode
implements YangLeavesHolder, YangDesc, YangReference, Parsable, CollisionDetector, HasResolutionInfo {
......@@ -183,7 +184,7 @@ public class YangSubModule extends YangNode
*/
private List<YangResolutionInfo> unresolvedResolutionList;
/**
* Create a sub module node.
* Creates a sub module node.
*/
public YangSubModule() {
super(YangNodeType.SUB_MODULE_NODE);
......@@ -195,7 +196,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the YANG name of the sub module.
* Returns the YANG name of the sub module.
*
* @return YANG name of the sub module
*/
......@@ -205,7 +206,7 @@ public class YangSubModule extends YangNode
}
/**
* Set YANG name of the sub module.
* Sets YANG name of the sub module.
*
* @param subModuleName YANG name of the sub module
*/
......@@ -215,7 +216,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the module info.
* Returns the module info.
*
* @return the belongs to info
*/
......@@ -224,7 +225,7 @@ public class YangSubModule extends YangNode
}
/**
* Set the module info.
* Sets the module info.
*
* @param belongsTo module info to set
*/
......@@ -233,7 +234,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the contact.
* Returns the contact.
*
* @return the contact
*/
......@@ -242,7 +243,7 @@ public class YangSubModule extends YangNode
}
/**
* Set the contact.
* Sets the contact.
*
* @param contact the contact to set
*/
......@@ -251,7 +252,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the description.
* Returns the description.
*
* @return the description
*/
......@@ -261,7 +262,7 @@ public class YangSubModule extends YangNode
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -271,7 +272,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the list of imported modules.
* Returns the list of imported modules.
*
* @return the list of imported modules
*/
......@@ -280,7 +281,7 @@ public class YangSubModule extends YangNode
}
/**
* Add the imported module information to the import list.
* Adds the imported module information to the import list.
*
* @param importedModule module being imported
*/
......@@ -294,7 +295,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the list of included sub modules.
* Returns the list of included sub modules.
*
* @return the included list of sub modules
*/
......@@ -303,7 +304,7 @@ public class YangSubModule extends YangNode
}
/**
* Add the included sub module information to the include list.
* Returns the included sub module information to the include list.
*
* @param includeModule submodule being included
*/
......@@ -335,7 +336,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the list of leaves.
* Returns the list of leaves.
*
* @return the list of leaves
*/
......@@ -345,7 +346,7 @@ public class YangSubModule extends YangNode
}
/**
* Add a leaf.
* Adds a leaf.
*
* @param leaf the leaf to be added
*/
......@@ -355,7 +356,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the list of leaf-list.
* Returns the list of leaf-list.
*
* @return the list of leaf-list
*/
......@@ -365,7 +366,7 @@ public class YangSubModule extends YangNode
}
/**
* Add a leaf-list.
* Adds a leaf-list.
*
* @param leafList the leaf-list to be added
*/
......@@ -375,7 +376,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the sub-modules organization.
* Returns the sub-modules organization.
*
* @return the organization
*/
......@@ -384,7 +385,7 @@ public class YangSubModule extends YangNode
}
/**
* Set the sub-modules organization.
* Sets the sub-modules organization.
*
* @param org the organization to set
*/
......@@ -393,7 +394,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the textual reference.
* Returns the textual reference.
*
* @return the reference
*/
......@@ -403,7 +404,7 @@ public class YangSubModule extends YangNode
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -413,7 +414,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the revision.
* Returns the revision.
*
* @return the revision
*/
......@@ -422,7 +423,7 @@ public class YangSubModule extends YangNode
}
/**
* Set the revision.
* Sets the revision.
*
* @param revision the revision to set
*/
......@@ -431,7 +432,7 @@ public class YangSubModule extends YangNode
}
/**
* Get the version.
* Returns the version.
*
* @return the version
*/
......@@ -440,7 +441,7 @@ public class YangSubModule extends YangNode
}
/**
* Set the version.
* Sets the version.
*
* @param version the version to set
*/
......@@ -459,7 +460,7 @@ public class YangSubModule extends YangNode
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -469,7 +470,7 @@ public class YangSubModule extends YangNode
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -45,7 +45,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
*/
/**
* Maintains the data type information.
* Represents the data type information.
*
* @param <T> YANG data type info
*/
......@@ -94,7 +94,7 @@ public class YangType<T> implements Parsable, Resolvable {
private ResolvableStatus resolvableStatus;
/**
* Default constructor.
* Creates a YANG type object.
*/
public YangType() {
......@@ -112,7 +112,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set prefix associated with data type name.
* Sets prefix associated with data type name.
*
* @param prefix prefix associated with data type name
*/
......@@ -121,7 +121,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Get the name of data type.
* Returns the name of data type.
*
* @return the name of data type
*/
......@@ -130,7 +130,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set the name of the data type.
* Sets the name of the data type.
*
* @param typeName the name to set
*/
......@@ -139,7 +139,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Get the Java package where the type is defined.
* Returns the Java package where the type is defined.
*
* @return Java package where the type is defined
*/
......@@ -148,7 +148,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set Java package where the type is defined.
* Sets Java package where the type is defined.
*
* @param javaPackage Java package where the type is defined
*/
......@@ -157,7 +157,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Get the type of data.
* Returns the type of data.
*
* @return the data type
*/
......@@ -166,7 +166,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set the type of data.
* Sets the type of data.
*
* @param dataType data type
*/
......@@ -175,7 +175,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Get the data type meta data.
* Returns the data type meta data.
*
* @return the data type meta data
*/
......@@ -184,7 +184,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set the data type meta data.
* Sets the data type meta data.
*
* @param dataTypeInfo the meta data to set
*/
......@@ -202,7 +202,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set node identifier.
* Sets node identifier.
*
* @param nodeIdentifier the node identifier
*/
......@@ -220,7 +220,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set effective built-in type.
* Sets effective built-in type.
*
* @param effectiveBuiltInType effective built-in type
*/
......@@ -238,7 +238,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Set effective pattern restriction.
* Sets effective pattern restriction.
*
* @param effectivePatternRestriction effective pattern restriction
*/
......@@ -257,7 +257,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -268,7 +268,7 @@ public class YangType<T> implements Parsable, Resolvable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......
......@@ -49,7 +49,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
* +--------------+---------+-------------+------------------+
*/
/**
* Data model node to maintain information defined in YANG typedef.
* Represents data model node to maintain information defined in YANG typedef.
*/
public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
......@@ -90,7 +90,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
private String units;
/**
* Create a typedef node.
* Creates a typedef node.
*/
public YangTypeDef() {
super(YangNodeType.TYPEDEF_NODE);
......@@ -106,7 +106,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Set the default value.
* Sets the default value.
*
* @param defaultValueInString the default value
*/
......@@ -125,7 +125,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -145,7 +145,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -165,7 +165,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -184,7 +184,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Set the data type.
* Sets the data type.
*
* @param dataType the data type
*/
......@@ -202,7 +202,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Set the unit.
* Sets the unit.
*
* @param units the units to set
*/
......@@ -221,7 +221,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -231,7 +231,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -251,7 +251,7 @@ public class YangTypeDef extends YangNode implements YangCommonInfo, Parsable {
}
/**
* Set YANG name of the typedef.
* Sets YANG name of the typedef.
*
* @param name YANG name of the typedef
*/
......
......@@ -16,13 +16,13 @@
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 java.util.LinkedList;
import java.util.List;
/*
* Reference RFC 6020.
*
......@@ -46,7 +46,7 @@ import java.util.List;
*/
/**
* Data model node to maintain information defined in YANG union.
* Represents data model node to maintain information defined in YANG union.
*/
public class YangUnion implements Parsable {
......@@ -57,7 +57,7 @@ public class YangUnion implements Parsable {
private String unionName;
/**
* Create a YANG union node.
* Creates a YANG union node.
*/
public YangUnion() {
typeList = new LinkedList<>();
......@@ -82,7 +82,7 @@ public class YangUnion implements Parsable {
}
/**
* Set the list of YANG type.
* Sets the list of YANG type.
*
* @param typeList list of YANG type.
*/
......@@ -91,7 +91,7 @@ public class YangUnion implements Parsable {
}
/**
* Add YANG type to type list.
* Adds YANG type to type list.
*
* @param yangType YANG type to be added to list
* @throws DataModelException union member type must not be one of the
......@@ -106,7 +106,7 @@ public class YangUnion implements Parsable {
}
/**
* Set the union name.
* Sets the union name.
*
* @param unionName name of the union.
*/
......
......@@ -49,8 +49,7 @@ import org.onosproject.yangutils.utils.YangConstructType;
* +--------------+---------+-------------+------------------+
*/
/**
* Data model node to maintain information defined in YANG uses.
*
* Represents data model node to maintain information defined in YANG uses.
*/
public class YangUses extends YangNode implements YangCommonInfo, Parsable, Resolvable {
......@@ -88,7 +87,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
private ResolvableStatus resolvableStatus;
/**
* Create an YANG uses node.
* Creates an YANG uses node.
*/
public YangUses() {
super(YangNodeType.USES_NODE);
......@@ -106,7 +105,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
}
/**
* Set the referred group.
* Sets the referred group.
*
* @param refGroup the referred group
*/
......@@ -125,7 +124,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
}
/**
* Set the description.
* Sets the description.
*
* @param description set the description
*/
......@@ -145,7 +144,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
}
/**
* Set the textual reference.
* Sets the textual reference.
*
* @param reference the reference to set
*/
......@@ -165,7 +164,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
}
/**
* Set the status.
* Sets the status.
*
* @param status the status to set
*/
......@@ -185,7 +184,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
}
/**
* Validate the data on entering the corresponding parse tree node.
* Validates the data on entering the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -195,7 +194,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
}
/**
* Validate the data on exiting the corresponding parse tree node.
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
......@@ -224,7 +223,7 @@ public class YangUses extends YangNode implements YangCommonInfo, Parsable, Reso
}
/**
* Set node identifier.
* Sets node identifier.
*
* @param nodeIdentifier the node identifier
*/
......
......@@ -16,7 +16,7 @@
package org.onosproject.yangutils.datamodel.exceptions;
/**
* Base class for exceptions in data model operations.
* Represents base class for exceptions in data model operations.
*/
public class DataModelException extends Exception {
......@@ -25,7 +25,7 @@ public class DataModelException extends Exception {
private int charPositionInLine;
/**
* Constructor to create a data model exception with message.
* Creates a data model exception with message.
*
* @param message the detail of exception in string
*/
......@@ -34,7 +34,7 @@ public class DataModelException extends Exception {
}
/**
* Constructor to create exception from message and cause.
* Creates exception from message and cause.
*
* @param message the detail of exception in string
* @param cause underlying cause of the error
......@@ -44,7 +44,7 @@ public class DataModelException extends Exception {
}
/**
* Constructor to create exception from cause.
* Creates exception from cause.
*
* @param cause underlying cause of the error
*/
......
......@@ -17,6 +17,7 @@
package org.onosproject.yangutils.datamodel.utils;
import java.util.List;
import org.onosproject.yangutils.datamodel.CollisionDetector;
import org.onosproject.yangutils.datamodel.HasResolutionInfo;
import org.onosproject.yangutils.datamodel.YangLeaf;
......@@ -28,7 +29,7 @@ import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.utils.YangConstructType;
/**
* Utilities for data model tree.
* Represents utilities for data model tree.
*/
public final class DataModelUtils {
......@@ -49,6 +50,7 @@ public final class DataModelUtils {
*/
public static void detectCollidingChildUtil(String identifierName, YangConstructType dataType, YangNode node)
throws DataModelException {
if (dataType == YangConstructType.LEAF_DATA) {
YangLeavesHolder leavesHolder = (YangLeavesHolder) node;
if (leavesHolder.getListOfLeaf() != null) {
......@@ -78,8 +80,9 @@ public final class DataModelUtils {
* checked
* @throws DataModelException a violation of data model rules
*/
private static void detectCollidingLeaf(YangLeavesHolder leavesHolder, String identifierName) throws
DataModelException {
private static void detectCollidingLeaf(YangLeavesHolder leavesHolder, String identifierName)
throws DataModelException {
for (YangLeaf leaf : leavesHolder.getListOfLeaf()) {
if (leaf.getLeafName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate input identifier detected, same as leaf \""
......@@ -96,8 +99,9 @@ public final class DataModelUtils {
* checked
* @throws DataModelException a violation of data model rules
*/
private static void detectCollidingLeafList(YangLeavesHolder leavesHolder, String identifierName) throws
DataModelException {
private static void detectCollidingLeafList(YangLeavesHolder leavesHolder, String identifierName)
throws DataModelException {
for (YangLeafList leafList : leavesHolder.getListOfLeafList()) {
if (leafList.getLeafName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate input identifier detected, same as leaf " +
......@@ -114,6 +118,7 @@ public final class DataModelUtils {
* @throws DataModelException a violation of data model rules
*/
public static void addResolutionInfo(YangResolutionInfo resolutionInfo) throws DataModelException {
/* get the module node to add maintain the list of nested reference */
YangNode curNode = resolutionInfo.getHolderOfEntityToResolve();
while (!(curNode instanceof HasResolutionInfo)) {
......@@ -134,8 +139,9 @@ public final class DataModelUtils {
* @throws DataModelException a violation of data model rules
*/
public static void resolveLinkingForResolutionList(List<YangResolutionInfo> resolutionList,
HasResolutionInfo resolutionInfoNode)
HasResolutionInfo resolutionInfoNode)
throws DataModelException {
for (YangResolutionInfo resolutionInfo : resolutionList) {
if (resolutionInfo.getPrefix() == null ||
resolutionInfo.getPrefix().equals(resolutionInfoNode.getPrefix())) {
......
......@@ -16,7 +16,7 @@
package org.onosproject.yangutils.datamodel.utils;
/**
* The target language in which the YANG information is modeled.
* Represents the target language in which the YANG information is modeled.
*/
public enum GeneratedLanguage {
/**
......
......@@ -46,12 +46,12 @@ import org.onosproject.yangutils.translator.tojava.javamodel.YangJavaOutput;
import org.onosproject.yangutils.translator.exception.TranslatorException;
/**
* Factory to create data model objects based on the target file type.
*Represents factory to create data model objects based on the target file type.
*/
public final class YangDataModelFactory {
/**
* Utility class, hence private to prevent creating objects.
* Creates a YANG data model factory object.
*/
private YangDataModelFactory() {
}
......@@ -75,7 +75,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -93,7 +93,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -111,7 +111,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -129,7 +129,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -147,7 +147,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -165,7 +165,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -183,7 +183,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -201,7 +201,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -219,7 +219,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -237,7 +237,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -255,7 +255,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -273,7 +273,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......@@ -291,7 +291,7 @@ public final class YangDataModelFactory {
}
/**
* Based on the target language generate the inherited data model node.
* Returns based on the target language generate the inherited data model node.
*
* @param targetLanguage target language in which YANG mapping needs to be
* generated
......
......@@ -25,14 +25,14 @@ import org.onosproject.yangutils.utils.YangConstructType;
public interface Parsable {
/**
* Get the type of YANG construct data.
* Returns the type of YANG construct data.
*
* @return the type of YANG construct data.
*/
YangConstructType getYangConstructType();
/**
* Check if the node is valid as per YANG grammar's syntax and semantics.
* Checks if the node is valid as per YANG grammar's syntax and semantics.
* This validation will be performed on entering the node in traversal
*
* @throws DataModelException if there is any violation of the YANG rules
......@@ -41,7 +41,7 @@ public interface Parsable {
void validateDataOnEntry() throws DataModelException;
/**
* Check if the node is valid as per YANG grammar's syntax and semantics.
* Checks if the node is valid as per YANG grammar's syntax and semantics.
* This validation will be performed on exiting the node in traversal
*
* @throws DataModelException if there is any violation of the YANG rules
......
......@@ -16,18 +16,18 @@
package org.onosproject.yangutils.parser;
import java.io.IOException;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import java.io.IOException;
/**
* Abstraction of entity which provides parser service of YANG files for yangutils-maven-plugin.
*/
public interface YangUtilsParser {
/**
* It is an entry function to initiate the YANG file parsing.
* Returns the data model node. It is an entry function to initiate the YANG file parsing.
*
* @param file input YANG file
* @return YangNode root node of the data model tree
......
......@@ -22,9 +22,10 @@ package org.onosproject.yangutils.parser.antlrgencode;
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
* ANTLR interfaces to be implemented by listener to traverse the parse tree.
* Represents ANTLR interfaces to be implemented by listener to traverse the parse tree.
*/
public interface GeneratedYangListener extends ParseTreeListener {
/**
* Enter a parse tree produced by GeneratedYangParser for grammar rule
* yangfile.
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.parser.exceptions;
/**
* Base class for exceptions in parser operations.
* Represents base class for exceptions in parser operations.
*/
public class ParserException extends RuntimeException {
......@@ -27,7 +27,7 @@ public class ParserException extends RuntimeException {
private String fileName;
/**
* Create a new parser exception.
* Creates a new parser exception.
*/
public ParserException() {
super();
......
......@@ -75,7 +75,7 @@ import org.onosproject.yangutils.parser.impl.listeners.ValueListener;
import org.onosproject.yangutils.parser.impl.listeners.VersionListener;
/**
* ANTLR generates a parse-tree listener interface that responds to events
* Represents ANTLR generates parse-tree. ANTLR generates a parse-tree listener interface that responds to events
* triggered by the built-in tree walker. The methods in listener are just
* callbacks. This class implements listener interface and generates the
* corresponding data model tree.
......
......@@ -31,7 +31,7 @@ import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.parserutils.ParseTreeErrorListener;
/**
* Manages file parsing, parse tree creation and data model tree creation
* Represents file parsing, parse tree creation and data model tree creation
* corresponding to an input YANG file.
*/
public class YangUtilsParserManager implements YangUtilsParser {
......
......@@ -22,6 +22,7 @@ import org.onosproject.yangutils.datamodel.YangSubModule;
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.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;
......@@ -41,7 +42,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.YANGBASE_DATA;
*/
/**
* Implements call back function corresponding to the "base rule" defined in
* Representation of call back function corresponding to the "base rule" defined in
* ANTLR grammar file.
*/
public final class BaseFileListener {
......
......@@ -57,7 +57,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.BELONGS_TO_DATA;
*/
/**
* Implements listener based call back function corresponding to the
* Represents listener based call back function corresponding to the
* "belongs to" rule defined in ANTLR grammar file for corresponding ABNF rule
* in RFC 6020.
*/
......@@ -116,16 +116,16 @@ public final class BelongsToListener {
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setBelongsTo((YangBelongsTo) tmpBelongstoNode);
subModule.setPrefix(subModule.getBelongsTo().getPrefix());
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, BELONGS_TO_DATA,
ctx.identifier().getText(),
EXIT));
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setBelongsTo((YangBelongsTo) tmpBelongstoNode);
subModule.setPrefix(subModule.getBelongsTo().getPrefix());
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, BELONGS_TO_DATA,
ctx.identifier().getText(),
EXIT));
}
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, BELONGS_TO_DATA,
......
......@@ -82,7 +82,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorTyp
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
/**
* Implements listener based call back function corresponding to the "bit"
* Represents listener based call back function corresponding to the "bit"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class BitListener {
......
......@@ -61,7 +61,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.BITS_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
/**
* Implements listener based call back function corresponding to the "bits" rule
* Represents listener based call back function corresponding to the "bits" rule
* defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class BitsListener {
......
......@@ -67,7 +67,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.WHEN_DATA;
*/
/**
* Implements listener based call back function corresponding to the "case" rule
* Represents listener based call back function corresponding to the "case" rule
* defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class CaseListener {
......
......@@ -86,7 +86,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.WHEN_DATA;
*/
/**
* Implements listener based call back function corresponding to the "choice"
* Represents listener based call back function corresponding to the "choice"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ChoiceListener {
......
......@@ -49,7 +49,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.CONFIG_DATA;
*/
/**
* Implements listener based call back function corresponding to the "config"
* Represents listener based call back function corresponding to the "config"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ConfigListener {
......
......@@ -23,12 +23,12 @@ 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.utils.YangConstructType.CONTACT_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.CONTACT_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -71,7 +71,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "contact"
* Represents listener based call back function corresponding to the "contact"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ContactListener {
......@@ -97,19 +97,19 @@ public final class ContactListener {
// Obtain the node of the stack.
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setContact(ctx.string().getText());
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setContact(ctx.string().getText());
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, CONTACT_DATA,
ctx.string().getText(), ENTRY));
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setContact(ctx.string().getText());
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setContact(ctx.string().getText());
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, CONTACT_DATA,
ctx.string().getText(), ENTRY));
}
}
}
......
......@@ -16,15 +16,15 @@
package org.onosproject.yangutils.parser.impl.listeners;
import org.onosproject.yangutils.datamodel.YangAugment;
import org.onosproject.yangutils.datamodel.YangCase;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangInput;
import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangModule;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.datamodel.YangNotification;
import org.onosproject.yangutils.datamodel.YangInput;
import org.onosproject.yangutils.datamodel.YangOutput;
import org.onosproject.yangutils.datamodel.YangAugment;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
......@@ -83,7 +83,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
*/
/**
* Implements listener based call back function corresponding to the "container"
* Represents listener based call back function corresponding to the "container"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ContainerListener {
......
......@@ -45,7 +45,6 @@ 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.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
......@@ -54,7 +53,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
import static org.onosproject.yangutils.utils.YangConstructType.DEFAULT_DATA;
/**
* Listener implementation for default YANG statement.
* Represents listener for default YANG statement.
*/
public final class DefaultListener {
......
......@@ -22,12 +22,12 @@ 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.utils.YangConstructType.DESCRIPTION_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -40,7 +40,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "description"
* Represents listener based call back function corresponding to the "description"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class DescriptionListener {
......
......@@ -64,10 +64,10 @@ import org.onosproject.yangutils.datamodel.YangEnum;
import org.onosproject.yangutils.datamodel.YangEnumeration;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import static org.onosproject.yangutils.utils.YangConstructType.ENUM_DATA;
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.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
......@@ -77,9 +77,10 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorTyp
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.ENUM_DATA;
/**
* Implements listener based call back function corresponding to the "enum" rule
* Represents listener based call back function corresponding to the "enum" rule
* defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class EnumListener {
......
......@@ -62,7 +62,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.ENUMERATION_DATA
import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
/**
* Implements listener based call back function corresponding to the
* Represents listener based call back function corresponding to the
* "enumeration" rule defined in ANTLR grammar file for corresponding ABNF rule
* in RFC 6020.
*/
......
......@@ -53,7 +53,6 @@ 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.TYPEDEF_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
*
......@@ -77,7 +76,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.TYPEDEF_DATA;
*/
/**
* Implements listener based call back function corresponding to the "grouping"
* Represents listener based call back function corresponding to the "grouping"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class GroupingListener {
......
......@@ -24,13 +24,13 @@ 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.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
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;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.IMPORT_DATA;
......@@ -57,7 +57,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.IMPORT_DATA;
*/
/**
* Implements listener based call back function corresponding to the "import"
* Represents listener based call back function corresponding to the "import"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ImportListener {
......@@ -111,20 +111,20 @@ public final class ImportListener {
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.addToImportList((YangImport) tmpImportNode);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.addToImportList((YangImport) tmpImportNode);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, IMPORT_DATA,
ctx.identifier().getText(),
EXIT));
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.addToImportList((YangImport) tmpImportNode);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.addToImportList((YangImport) tmpImportNode);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, IMPORT_DATA,
ctx.identifier().getText(),
EXIT));
}
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, IMPORT_DATA,
......
......@@ -56,7 +56,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.INCLUDE_DATA;
*/
/**
* Implements listener based call back function corresponding to the "include"
* Represents listener based call back function corresponding to the "include"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class IncludeListener {
......@@ -110,20 +110,20 @@ public final class IncludeListener {
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.addToIncludeList((YangInclude) tmpIncludeNode);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.addToIncludeList((YangInclude) tmpIncludeNode);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, INCLUDE_DATA,
ctx.identifier().getText(),
EXIT));
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.addToIncludeList((YangInclude) tmpIncludeNode);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.addToIncludeList((YangInclude) tmpIncludeNode);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, INCLUDE_DATA,
ctx.identifier().getText(),
EXIT));
}
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, INCLUDE_DATA,
......
......@@ -60,7 +60,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.INPUT_DATA;
*/
/**
* Implements listener based call back function corresponding to the "input"
* Represents listener based call back function corresponding to the "input"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class InputListener {
......
......@@ -23,15 +23,15 @@ 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.utils.YangConstructType.KEY_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.KEY_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -45,7 +45,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "key"
* Represesnts listener based call back function corresponding to the "key"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class KeyListener {
......
......@@ -23,7 +23,6 @@ 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.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
......@@ -31,6 +30,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMes
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
......@@ -72,7 +72,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.UNITS_DATA;
*/
/**
* Implements listener based call back function corresponding to the "leaf-list"
* Represents listener based call back function corresponding to the "leaf-list"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class LeafListListener {
......
......@@ -27,7 +27,6 @@ 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.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerCollisionDetector.detectCollidingChildUtil;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
......@@ -35,6 +34,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMes
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityEqualsOne;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.validateCardinalityMaxOne;
......@@ -74,7 +74,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.UNITS_DATA;
*/
/**
* Implements listener based call back function corresponding to the "leaf" rule
* Represents listener based call back function corresponding to the "leaf" rule
* defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class LeafListener {
......
......@@ -16,15 +16,15 @@
package org.onosproject.yangutils.parser.impl.listeners;
import org.onosproject.yangutils.datamodel.YangAugment;
import org.onosproject.yangutils.datamodel.YangCase;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangInput;
import org.onosproject.yangutils.datamodel.YangList;
import org.onosproject.yangutils.datamodel.YangModule;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.datamodel.YangNotification;
import org.onosproject.yangutils.datamodel.YangInput;
import org.onosproject.yangutils.datamodel.YangOutput;
import org.onosproject.yangutils.datamodel.YangAugment;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
......@@ -89,7 +89,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
*/
/**
* Implements listener based call back function corresponding to the "list" rule
* Represents listener based call back function corresponding to the "list" rule
* defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ListListener {
......
......@@ -22,13 +22,13 @@ 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.parser.impl.parserutils.ListenerUtil.getValidBooleanValue;
import static org.onosproject.yangutils.utils.YangConstructType.MANDATORY_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidBooleanValue;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.MANDATORY_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -48,7 +48,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "mandatory"
* Represents listener based call back function corresponding to the "mandatory"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class MandatoryListener {
......
......@@ -47,7 +47,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.MAX_ELEMENT_DATA
*/
/**
* Implements listener based call back function corresponding to the
* Represents listener based call back function corresponding to the
* "max-elements" rule defined in ANTLR grammar file for corresponding ABNF rule
* in RFC 6020.
*/
......
......@@ -23,13 +23,13 @@ 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.parser.impl.parserutils.ListenerUtil.getValidNonNegativeIntegerValue;
import static org.onosproject.yangutils.utils.YangConstructType.MIN_ELEMENT_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidNonNegativeIntegerValue;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.MIN_ELEMENT_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -47,7 +47,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "min-elements"
* Represents listener based call back function corresponding to the "min-elements"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class MinElementsListener {
......
......@@ -57,7 +57,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.MODULE_DATA;
*/
/**
* Implements listener based call back function corresponding to the "module"
* Represents listener based call back function corresponding to the "module"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ModuleListener {
......
......@@ -55,7 +55,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.NAMESPACE_DATA;
*/
/**
* Implements listener based call back function corresponding to the "namespace"
* Represents listener based call back function corresponding to the "namespace"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class NamespaceListener {
......
......@@ -16,10 +16,10 @@
package org.onosproject.yangutils.parser.impl.listeners;
import org.onosproject.yangutils.datamodel.YangNotification;
import org.onosproject.yangutils.datamodel.YangModule;
import org.onosproject.yangutils.datamodel.YangSubModule;
import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.datamodel.YangNotification;
import org.onosproject.yangutils.datamodel.YangSubModule;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
......@@ -33,17 +33,20 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLoc
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructExtendedListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.*;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.UNHANDLED_PARSED_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
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.NOTIFICATION_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.GROUPING_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.NOTIFICATION_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.TYPEDEF_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.GROUPING_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -70,7 +73,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.GROUPING_DATA;
*/
/**
* Implements listener based call back function corresponding to the "notification"
* Represents listener based call back function corresponding to the "notification"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class NotificationListener {
......
......@@ -23,12 +23,12 @@ 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.utils.YangConstructType.ORGANIZATION_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.ORGANIZATION_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -72,7 +72,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the
* Represents listener based call back function corresponding to the
* "organization" rule defined in ANTLR grammar file for corresponding ABNF rule
* in RFC 6020.
*/
......@@ -101,19 +101,19 @@ public final class OrganizationListener {
// Obtain the node of the stack.
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setOrganization(ctx.string().getText());
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setOrganization(ctx.string().getText());
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ORGANIZATION_DATA,
ctx.string().getText(), ENTRY));
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setOrganization(ctx.string().getText());
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setOrganization(ctx.string().getText());
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ORGANIZATION_DATA,
ctx.string().getText(), ENTRY));
}
}
}
......
......@@ -57,7 +57,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.OUTPUT_DATA;
*/
/**
* Implements listener based call back function corresponding to the "output"
* Represents listener based call back function corresponding to the "output"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class OutputListener {
......
......@@ -50,7 +50,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
import static org.onosproject.yangutils.utils.YangConstructType.POSITION_DATA;
/**
* Implements listener based call back function corresponding to the "position"
* Represents listener based call back function corresponding to the "position"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class PositionListener {
......
......@@ -24,13 +24,13 @@ 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.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
import static org.onosproject.yangutils.utils.YangConstructType.PREFIX_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.getValidIdentifier;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.PREFIX_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -56,7 +56,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "prefix"
* Represents listener based call back function corresponding to the "prefix"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class PrefixListener {
......@@ -84,24 +84,24 @@ public final class PrefixListener {
// Obtain the node of the stack.
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setPrefix(identifier);
break;
}
case IMPORT_DATA: {
YangImport importNode = (YangImport) tmpNode;
importNode.setPrefixId(identifier);
break;
}
case BELONGS_TO_DATA: {
YangBelongsTo belongstoNode = (YangBelongsTo) tmpNode;
belongstoNode.setPrefix(identifier);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, PREFIX_DATA,
ctx.identifier().getText(), ENTRY));
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setPrefix(identifier);
break;
}
case IMPORT_DATA: {
YangImport importNode = (YangImport) tmpNode;
importNode.setPrefixId(identifier);
break;
}
case BELONGS_TO_DATA: {
YangBelongsTo belongstoNode = (YangBelongsTo) tmpNode;
belongstoNode.setPrefix(identifier);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, PREFIX_DATA,
ctx.identifier().getText(), ENTRY));
}
}
}
......
......@@ -22,13 +22,13 @@ 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.utils.YangConstructType.PRESENCE_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.CONTAINER_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.CONTAINER_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.PRESENCE_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -41,7 +41,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "presence"
* Represents listener based call back function corresponding to the "presence"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class PresenceListener {
......
......@@ -59,7 +59,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.rem
*/
/**
* Implements listener based call back function corresponding to the "range"
* Represents listener based call back function corresponding to the "range"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class RangeRestrictionListener {
......
......@@ -22,12 +22,12 @@ 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.utils.YangConstructType.REFERENCE_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.REFERENCE_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -40,7 +40,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "reference"
* Represents listener based call back function corresponding to the "reference"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ReferenceListener {
......
......@@ -23,12 +23,12 @@ 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.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.isDateValid;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.isDateValid;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.REVISION_DATE_DATA;
......@@ -61,7 +61,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.REVISION_DATE_DA
*/
/**
* Implements listener based call back function corresponding to the
* Represents listener based call back function corresponding to the
* "revision date" rule defined in ANTLR grammar file for corresponding ABNF
* rule in RFC 6020.
*/
......
......@@ -24,16 +24,16 @@ 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.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.isDateValid;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
import static org.onosproject.yangutils.utils.YangConstructType.REVISION_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;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_CURRENT_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.isDateValid;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.REVISION_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -64,7 +64,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "revision"
* Represents listener based call back function corresponding to the "revision"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class RevisionListener {
......@@ -132,20 +132,20 @@ public final class RevisionListener {
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setRevision((YangRevision) tmpRevisionNode);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setRevision((YangRevision) tmpRevisionNode);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REVISION_DATA,
ctx.dateArgumentString().getText(),
EXIT));
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setRevision((YangRevision) tmpRevisionNode);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setRevision((YangRevision) tmpRevisionNode);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REVISION_DATA,
ctx.dateArgumentString().getText(),
EXIT));
}
} else {
throw new ParserException(constructListenerErrorMessage(MISSING_CURRENT_HOLDER, REVISION_DATA,
......
......@@ -72,7 +72,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.DESCRIPTION_DATA
*/
/**
* Implements listener based call back function corresponding to the "rpc"
* Represents listener based call back function corresponding to the "rpc"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class RpcListener {
......
......@@ -57,7 +57,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.SHORT_CASE_DATA;
*/
/**
* Implements listener based call back function corresponding to the "short
* Represents listener based call back function corresponding to the "short
* case" rule defined in ANTLR grammar file for corresponding ABNF rule in RFC
* 6020.
*/
......
......@@ -23,14 +23,14 @@ 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.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_CONTENT;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerUtil.removeQuotesAndHandleConcat;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.STATUS_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -48,7 +48,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "status"
* Represents listener based call back function corresponding to the "status"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class StatusListener {
......
......@@ -58,7 +58,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.SUB_MODULE_DATA;
*/
/**
* Implements listener based call back function corresponding to the "submodule"
* Represents listener based call back function corresponding to the "submodule"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class SubModuleListener {
......
......@@ -87,7 +87,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.UNITS_DATA;
*/
/**
* Implements listener based call back function corresponding to the "typedef"
* Represents listener based call back function corresponding to the "typedef"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class TypeDefListener {
......
......@@ -62,7 +62,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
*/
/**
* Implements listener based call back function corresponding to the "type" rule
* Represents listener based call back function corresponding to the "type" rule
* defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class TypeListener {
......
......@@ -60,10 +60,11 @@ import static org.onosproject.yangutils.utils.YangConstructType.TYPE_DATA;
import static org.onosproject.yangutils.utils.YangConstructType.UNION_DATA;
/**
* Implements listener based call back function corresponding to the "union" rule
* Represents listener based call back function corresponding to the "union" rule
* defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class UnionListener {
/**
* Creates a new union listener.
*/
......
......@@ -23,12 +23,12 @@ 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.utils.YangConstructType.UNITS_DATA;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.UNITS_DATA;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
......@@ -41,7 +41,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "units"
* Represents listener based call back function corresponding to the "units"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class UnitsListener {
......
......@@ -90,7 +90,7 @@ import static org.onosproject.yangutils.utils.YangConstructType.WHEN_DATA;
*/
/**
* Implements listener based call back function corresponding to the "uses"
* Represents listener based call back function corresponding to the "uses"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class UsesListener {
......
......@@ -29,18 +29,19 @@ package org.onosproject.yangutils.parser.impl.listeners;
import org.onosproject.yangutils.datamodel.YangEnum;
import org.onosproject.yangutils.datamodel.YangEnumeration;
import org.onosproject.yangutils.parser.Parsable;
import static org.onosproject.yangutils.utils.YangConstructType.VALUE_DATA;
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.parser.impl.parserutils.ListenerErrorLocation.ENTRY;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.MISSING_HOLDER;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation.checkStackIsNotEmpty;
import static org.onosproject.yangutils.utils.YangConstructType.VALUE_DATA;
/**
* Implements listener based call back function corresponding to the "value"
* Represents listener based call back function corresponding to the "value"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class ValueListener {
......
......@@ -65,7 +65,7 @@ import static org.onosproject.yangutils.parser.impl.parserutils.ListenerValidati
*/
/**
* Implements listener based call back function corresponding to the "version"
* Represents listener based call back function corresponding to the "version"
* rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
*/
public final class VersionListener {
......@@ -94,19 +94,19 @@ public final class VersionListener {
// Obtain the node of the stack.
Parsable tmpNode = listener.getParsedDataStack().peek();
switch (tmpNode.getYangConstructType()) {
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setVersion(version);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setVersion(version);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, VERSION_DATA,
ctx.version().getText(), ENTRY));
case MODULE_DATA: {
YangModule module = (YangModule) tmpNode;
module.setVersion(version);
break;
}
case SUB_MODULE_DATA: {
YangSubModule subModule = (YangSubModule) tmpNode;
subModule.setVersion(version);
break;
}
default:
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, VERSION_DATA,
ctx.version().getText(), ENTRY));
}
}
}
......
......@@ -20,13 +20,14 @@ import org.onosproject.yangutils.datamodel.CollisionDetector;
import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.TreeWalkListener;
import org.onosproject.yangutils.utils.YangConstructType;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.EXIT;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.INVALID_HOLDER;
import org.onosproject.yangutils.utils.YangConstructType;
/**
* Check the YANG construct collision in a YANG file.
* Represents the detector of YANG construct collision in a YANG file.
*/
public final class ListenerCollisionDetector {
......@@ -52,7 +53,7 @@ public final class ListenerCollisionDetector {
*/
public static void detectCollidingChildUtil(TreeWalkListener listener, int line, int charPosition,
String identifierName, YangConstructType constructType)
throws ParserException {
throws ParserException {
if (listener.getParsedDataStack().peek() instanceof CollisionDetector) {
try {
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.parser.impl.parserutils;
/**
* Maintains listener error location.
* Represents listener error location.
*/
public enum ListenerErrorLocation {
/**
......
......@@ -18,17 +18,17 @@ package org.onosproject.yangutils.parser.impl.parserutils;
import org.onosproject.yangutils.utils.YangConstructType;
import static org.onosproject.yangutils.utils.YangConstructType.getYangConstructType;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation.getErrorLocationMessage;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType.getErrorType;
import static org.onosproject.yangutils.utils.YangConstructType.getYangConstructType;
/**
* It's a utility to help construct detailed error message.
* Represents a utility to help construct detailed error message.
*/
public final class ListenerErrorMessageConstruction {
/**
* Private constructor.
* Creates a object of listen error message.
*/
private ListenerErrorMessageConstruction() {
}
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.parser.impl.parserutils;
/**
* Maintains listener error type.
* Represents listener error type.
*/
public enum ListenerErrorType {
/**
......
......@@ -26,13 +26,14 @@ import java.util.regex.Pattern;
import org.antlr.v4.runtime.ParserRuleContext;
import org.onosproject.yangutils.datamodel.YangNodeIdentifier;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
import org.onosproject.yangutils.utils.YangConstructType;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.utils.YangConstructType;
/**
* It's a utility for listener.
* Represents an utility for listener.
*/
public final class ListenerUtil {
private static final Pattern IDENTIFIER_PATTERN = Pattern.compile("[a-zA-Z_][a-zA-Z0-9_.-]*");
private static final String NON_NEGATIVE_INTEGER_PATTERN = "[0-9]+";
private static final String PLUS = "+";
......@@ -154,7 +155,7 @@ public final class ListenerUtil {
* @return valid non negative integer value
*/
public static int getValidNonNegativeIntegerValue(String integerValue, YangConstructType yangConstruct,
ParserRuleContext ctx) {
ParserRuleContext ctx) {
String value = removeQuotesAndHandleConcat(integerValue);
if (!value.matches(NON_NEGATIVE_INTEGER_PATTERN)) {
......@@ -178,7 +179,7 @@ public final class ListenerUtil {
* @return boolean value either true or false
*/
public static boolean getValidBooleanValue(String booleanValue, YangConstructType yangConstruct,
ParserRuleContext ctx) {
ParserRuleContext ctx) {
String value = removeQuotesAndHandleConcat(booleanValue);
if (value.equals(TRUE_KEYWORD)) {
......
......@@ -16,6 +16,9 @@
package org.onosproject.yangutils.parser.impl.parserutils;
import java.util.Iterator;
import java.util.List;
import org.antlr.v4.runtime.ParserRuleContext;
import org.onosproject.yangutils.datamodel.YangContainer;
import org.onosproject.yangutils.datamodel.YangList;
......@@ -23,15 +26,13 @@ import org.onosproject.yangutils.datamodel.YangNode;
import org.onosproject.yangutils.parser.Parsable;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.TreeWalkListener;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import org.onosproject.yangutils.utils.YangConstructType;
import static org.onosproject.yangutils.utils.YangConstructType.getYangConstructType;
import java.util.Iterator;
import java.util.List;
import static org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction.constructListenerErrorMessage;
import static org.onosproject.yangutils.utils.YangConstructType.getYangConstructType;
/**
* It's a utility to carry out listener validation.
* Represents a utility to carry out listener validation.
*/
public final class ListenerValidation {
......@@ -54,6 +55,7 @@ public final class ListenerValidation {
public static void checkStackIsNotEmpty(TreeWalkListener listener, ListenerErrorType errorType,
YangConstructType yangConstructType, String parsableDataTypeName,
ListenerErrorLocation errorLocation) {
if (listener.getParsedDataStack().empty()) {
/*
* If stack is empty it indicates error condition, value of
......@@ -100,6 +102,7 @@ public final class ListenerValidation {
* @return true/false parent's config value
*/
public static boolean getParentNodeConfig(TreeWalkListener listener) {
YangNode parentNode;
Parsable curData = listener.getParsedDataStack().peek();
if (curData instanceof YangNode) {
......@@ -125,7 +128,7 @@ public final class ListenerValidation {
* @throws ParserException exception if cardinality check fails
*/
public static void validateCardinalityMaxOne(List<?> childContext, YangConstructType yangChildConstruct,
YangConstructType yangParentConstruct, String parentName)
YangConstructType yangParentConstruct, String parentName)
throws ParserException {
if (!childContext.isEmpty() && childContext.size() != 1) {
......@@ -152,8 +155,8 @@ public final class ListenerValidation {
* @throws ParserException exception if cardinality check fails
*/
public static void validateCardinalityEqualsOne(List<?> childContext, YangConstructType yangChildConstruct,
YangConstructType yangParentConstruct, String parentName,
ParserRuleContext parentContext)
YangConstructType yangParentConstruct, String parentName,
ParserRuleContext parentContext)
throws ParserException {
if (childContext.isEmpty()) {
......@@ -187,8 +190,8 @@ public final class ListenerValidation {
* @throws ParserException exception if cardinality check fails
*/
public static void validateCardinalityNonZero(List<?> childContext, YangConstructType yangChildConstruct,
YangConstructType yangParentConstruct, String parentName,
ParserRuleContext parentContext)
YangConstructType yangParentConstruct, String parentName,
ParserRuleContext parentContext)
throws ParserException {
if (childContext.isEmpty()) {
......@@ -216,8 +219,8 @@ public final class ListenerValidation {
* @throws ParserException exception if cardinality check fails
*/
public static void validateMutuallyExclusiveChilds(List<?> child1Context, YangConstructType yangChild1Construct,
List<?> child2Context, YangConstructType yangChild2Construct,
YangConstructType yangParentConstruct, String parentName)
List<?> child2Context, YangConstructType yangChild2Construct,
YangConstructType yangParentConstruct, String parentName)
throws ParserException {
if (!child1Context.isEmpty() && !child2Context.isEmpty()) {
......
......@@ -22,6 +22,7 @@ import org.antlr.v4.runtime.Recognizer;
import org.onosproject.yangutils.parser.exceptions.ParserException;
/**
* Represent the parse tree error listener.
* By default, ANTLR sends all errors to standard error, this is changed by
* providing this new implementation of interface ANTLRErrorListener. The
* interface has a syntaxError() method that applies to both lexer and parser.
......
......@@ -49,7 +49,7 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.copyYangFilesT
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getDirectory;
/**
* ONOS YANG utility maven plugin.
* Represents ONOS YANG utility maven plugin.
* Goal of plugin is yang2java Execution phase in generate-sources requiresDependencyResolution at compile time.
*/
@Mojo(name = "yang2java", defaultPhase = GENERATE_SOURCES, requiresDependencyResolution = COMPILE,
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.translator.exception;
/**
* Provides custom translator exception for translator's operations.
* Represents custom translator exception for translator's operations.
*/
public class TranslatorException extends RuntimeException {
......
......@@ -17,12 +17,12 @@
package org.onosproject.yangutils.translator.tojava;
/**
* Type of files generated.
* Represents type of java files generated.
*/
public final class GeneratedJavaFileType {
/**
* prevent creating attributes.
* Creates an instance of generate java file type.
*/
private GeneratedJavaFileType() {
}
......
......@@ -17,12 +17,12 @@
package org.onosproject.yangutils.translator.tojava;
/**
* Type of files generated.
* Represents type of temporary files generated.
*/
public final class GeneratedTempFileType {
/**
* prevent creating attributes.
* Creates an instance of generated temp file type.
*/
private GeneratedTempFileType() {
}
......
......@@ -16,19 +16,20 @@
package org.onosproject.yangutils.translator.tojava;
/**
* Data model nodes which are required to generate java classes, need to support
* Represents data model nodes which are required to generate java classes, need to support
* java file info.
*/
public interface HasJavaFileInfo {
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
public JavaFileInfo getJavaFileInfo();
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......
......@@ -16,18 +16,19 @@
package org.onosproject.yangutils.translator.tojava;
/**
* Maintains the information of the java import data.
* Represents the information of the java import data.
*/
public interface HasJavaImportData {
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
public JavaImportData getJavaImportData();
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......
......@@ -16,18 +16,19 @@
package org.onosproject.yangutils.translator.tojava;
/**
* Has temporary file handle.
* Represents Has temporary file handle.
*/
public interface HasTempJavaCodeFragmentFiles {
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
TempJavaCodeFragmentFiles getTempJavaCodeFragmentFiles();
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -27,7 +27,7 @@ import static org.onosproject.yangutils.translator.tojava.JavaQualifiedTypeInfo.
import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getCamelCase;
/**
* Maintains the attribute info corresponding to class/interface generated.
* Represents the attribute info corresponding to class/interface generated.
*/
public final class JavaAttributeInfo {
......@@ -58,7 +58,7 @@ public final class JavaAttributeInfo {
private JavaQualifiedTypeInfo importInfo;
/**
* Default constructor.
* Creates a java attribute info object.
*/
private JavaAttributeInfo() {
}
......@@ -79,7 +79,7 @@ public final class JavaAttributeInfo {
}
/**
* Get the data type info of attribute.
* Returns the data type info of attribute.
*
* @return the data type info of attribute
*/
......@@ -92,7 +92,7 @@ public final class JavaAttributeInfo {
}
/**
* Set the data type info of attribute.
* Sets the data type info of attribute.
*
* @param type the data type info of attribute
*/
......@@ -101,7 +101,7 @@ public final class JavaAttributeInfo {
}
/**
* Get name of the attribute.
* Returns name of the attribute.
*
* @return name of the attribute
*/
......@@ -114,7 +114,7 @@ public final class JavaAttributeInfo {
}
/**
* Set name of the attribute.
* Sets name of the attribute.
*
* @param attrName name of the attribute
*/
......@@ -123,7 +123,7 @@ public final class JavaAttributeInfo {
}
/**
* Get if the added attribute is a list of info.
* Returns if the added attribute is a list of info.
*
* @return the if the added attribute is a list of info
*/
......@@ -132,7 +132,7 @@ public final class JavaAttributeInfo {
}
/**
* Set if the added attribute is a list of info.
* Sets if the added attribute is a list of info.
*
* @param isList if the added attribute is a list of info
*/
......@@ -141,7 +141,7 @@ public final class JavaAttributeInfo {
}
/**
* Get if the added attribute has to be accessed in a fully qualified
* Returns if the added attribute has to be accessed in a fully qualified
* manner.
*
* @return the if the added attribute has to be accessed in a fully
......@@ -152,7 +152,7 @@ public final class JavaAttributeInfo {
}
/**
* Set if the added attribute has to be accessed in a fully qualified
* Sets if the added attribute has to be accessed in a fully qualified
* manner.
*
* @param isQualified if the added attribute has to be accessed in a fully
......@@ -163,7 +163,7 @@ public final class JavaAttributeInfo {
}
/**
* Get the import info for the attribute type. It will be null, of the type
* Returns the import info for the attribute type. It will be null, of the type
* is basic built-in java type.
*
* @return import info
......@@ -173,7 +173,7 @@ public final class JavaAttributeInfo {
}
/**
* Set the import info for the attribute type.
* Sets the import info for the attribute type.
*
* @param importInfo import info for the attribute type
*/
......@@ -182,7 +182,7 @@ public final class JavaAttributeInfo {
}
/**
* Create an attribute info object corresponding to the passed leaf
* Creates an attribute info object corresponding to the passed leaf
* information and return it.
*
* @param curNode current data model node for which the java file is being
......@@ -208,7 +208,7 @@ public final class JavaAttributeInfo {
}
/**
* Create an attribute info object corresponding to a data model node and
* Creates an attribute info object corresponding to a data model node and
* return it.
*
* @param curNode current data model node for which the java code generation
......@@ -234,7 +234,7 @@ public final class JavaAttributeInfo {
}
/**
* Create an attribute info object corresponding to the passed type def attribute
* Creates an attribute info object corresponding to the passed type def attribute
* information and return it.
*
* @param curNode current data model node for which the java file is being
......
......@@ -28,7 +28,7 @@ import static org.onosproject.yangutils.translator.tojava.TraversalType.ROOT;
import static org.onosproject.yangutils.translator.tojava.TraversalType.SIBILING;
/**
* Implementation of Java code generator based on application schema.
* Representation of Java code generator based on application schema.
*/
public final class JavaCodeGeneratorUtil {
......@@ -38,7 +38,7 @@ public final class JavaCodeGeneratorUtil {
private static YangNode curNode;
/**
* Default constructor.
* Creates a java code generator util object.
*/
private JavaCodeGeneratorUtil() {
}
......@@ -57,13 +57,12 @@ public final class JavaCodeGeneratorUtil {
*
* @param node current YANG node
*/
public static void setCurNode(YangNode node) {
curNode = node;
}
/**
* Generate Java code files corresponding to the YANG schema.
* Generates Java code files corresponding to the YANG schema.
*
* @param rootNode root node of the data model tree
* @param codeGenDir code generation directory
......@@ -173,6 +172,7 @@ public final class JavaCodeGeneratorUtil {
YangNode parent = node.getParent();
parent.setChild(null);
if (node.getNextSibling() != null) {
parent.setChild(node.getNextSibling());
} else if (node.getPreviousSibling() != null) {
......
......@@ -19,7 +19,7 @@ package org.onosproject.yangutils.translator.tojava;
import org.onosproject.yangutils.translator.exception.TranslatorException;
/**
* Cached java file handle, which supports the addition of member attributes and
* Represents cached java file handle, which supports the addition of member attributes and
* methods.
*/
public class JavaFileInfo {
......@@ -51,7 +51,7 @@ public class JavaFileInfo {
private String codeGenDirFilePath;
/**
* Get the types of files being generated corresponding to the YANG
* Returns the types of files being generated corresponding to the YANG
* definition.
*
* @return the types of files being generated corresponding to the YANG
......@@ -62,7 +62,7 @@ public class JavaFileInfo {
}
/**
* Set the types of files being generated corresponding to the YANG
* Sets the types of files being generated corresponding to the YANG
* definition.
*
* @param fileTypes the types of files being generated corresponding to the
......@@ -73,7 +73,7 @@ public class JavaFileInfo {
}
/**
* Get the java name of the node.
* Returns the java name of the node.
*
* @return the java name of node
*/
......@@ -82,7 +82,7 @@ public class JavaFileInfo {
}
/**
* Set the java name of the node.
* Sets the java name of the node.
*
* @param name the java name of node
*/
......@@ -91,7 +91,7 @@ public class JavaFileInfo {
}
/**
* Get the mapped java package.
* Returns the mapped java package.
*
* @return the java package
*/
......@@ -104,7 +104,7 @@ public class JavaFileInfo {
}
/**
* Set the node's package.
* Sets the node's package.
*
* @param nodePackage node's package
*/
......@@ -122,7 +122,7 @@ public class JavaFileInfo {
}
/**
* Gets directory package path for code generation.
* Returns directory package path for code generation.
*
* @return directory package path for code generation
*/
......@@ -131,7 +131,7 @@ public class JavaFileInfo {
}
/**
* Gets base directory package path for code generation.
* Returns base directory package path for code generation.
*
* @return directory package path for code generation
*/
......
......@@ -37,7 +37,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.PERIOD;
import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
/**
* Generated Java file can contain imports.
* Represents that generated Java file can contain imports.
*/
public class JavaImportData {
......@@ -53,14 +53,14 @@ public class JavaImportData {
private SortedSet<JavaQualifiedTypeInfo> importSet;
/**
* Default constructor.
* Creates java import data object.
*/
public JavaImportData() {
setImportSet(new TreeSet<JavaQualifiedTypeInfo>());
}
/**
* Get if the list needs to be imported.
* Returns if the list needs to be imported.
*
* @return true if any of the attribute needs to be maintained as a list.
*/
......@@ -69,7 +69,7 @@ public class JavaImportData {
}
/**
* Set the status of importing list.
* Sets the status of importing list.
*
* @param isList status to mention list is bing imported.
*/
......@@ -78,7 +78,7 @@ public class JavaImportData {
}
/**
* Get the set containing the imported class/interface info.
* Returns the set containing the imported class/interface info.
*
* @return the set containing the imported class/interface info
*/
......@@ -149,7 +149,7 @@ public class JavaImportData {
}
if (attr.isListAttr()) {
imports.add(setImportForList());
imports.add(getImportForList());
}
java.util.Collections.sort(imports);
......@@ -157,7 +157,7 @@ public class JavaImportData {
}
/**
* Gets import for hash and equals method.
* Returns import for hash and equals method.
*
* @return import for hash and equals method
*/
......@@ -166,7 +166,7 @@ public class JavaImportData {
}
/**
* Gets import for to string method.
* Returns import for to string method.
*
* @return import for to string method
*/
......@@ -175,9 +175,12 @@ public class JavaImportData {
}
/**
* Sets import for the list attribute.
* Returns import for list attribute.
*
* @return import for for list attribute
*/
private static String setImportForList() {
private static String getImportForList() {
return IMPORT + COLLECTION_IMPORTS + PERIOD + LIST + SEMI_COLAN + NEW_LINE;
}
}
......
......@@ -26,7 +26,7 @@ import org.onosproject.yangutils.translator.tojava.utils.AttributesJavaDataType;
import com.google.common.base.MoreObjects;
/**
* Maintains the information about individual imports in the generated file.
* Represents the information about individual imports in the generated file.
*/
public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo> {
......@@ -41,13 +41,13 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
private String classInfo;
/**
* Default constructor.
* Creates a java qualified type info object.
*/
public JavaQualifiedTypeInfo() {
}
/**
* Get the imported package info.
* Returns the imported package info.
*
* @return the imported package info
*/
......@@ -56,7 +56,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Set the imported package info.
* Sets the imported package info.
*
* @param pkgInfo the imported package info
*/
......@@ -65,7 +65,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Get the imported class/interface info.
* Returns the imported class/interface info.
*
* @return the imported class/interface info
*/
......@@ -74,7 +74,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Set the imported class/interface info.
* Sets the imported class/interface info.
*
* @param classInfo the imported class/interface info
*/
......@@ -83,7 +83,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Get the import info for an attribute, which needs to be used for code
* Returns the import info for an attribute, which needs to be used for code
* generation for import or for qualified access.
*
* @param curNode current data model node for which the java file is being
......@@ -136,7 +136,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Get the import info for an attribute, which needs to be used for code
* Returns the import info for an attribute, which needs to be used for code
* generation for import or for qualified access.
*
* @param curNode current data model node for which the java file is being
......@@ -168,7 +168,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Get if the attribute needs to be accessed in a qualified manner or not,
* Returns if the attribute needs to be accessed in a qualified manner or not,
* if it needs to be imported, then the same needs to be done.
*
* @param curNode current cache of the data model node for which java file
......@@ -226,7 +226,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Check if the import info is same as the package of the current generated
* Checks if the import info is same as the package of the current generated
* java file.
*
* @param curNode Java identifier of the current data model node
......@@ -265,7 +265,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* check if the import info matches.
* checks if the import info matches.
*
* @param importInfo matched import
* @return if equal or not
......@@ -284,7 +284,7 @@ public class JavaQualifiedTypeInfo implements Comparable<JavaQualifiedTypeInfo>
}
/**
* Check that there is no 2 objects with the same class name.
* Checks that there is no 2 objects with the same class name.
*
* @param other compared import info.
*/
......
......@@ -95,7 +95,7 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataInto
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.mergeJavaFiles;
/**
* Provides implementation of java code fragments temporary implementations.
* Represents implementation of java code fragments temporary implementations.
*/
public class TempJavaCodeFragmentFiles {
......@@ -292,7 +292,7 @@ public class TempJavaCodeFragmentFiles {
private boolean isAttributePresent = false;
/**
* Construct an object of temporary java code fragment.
* Creates an instance of temporary java code fragment.
*
* @param genFileType file generation type
* @param genDir file generation directory
......@@ -913,7 +913,7 @@ public class TempJavaCodeFragmentFiles {
}
/**
* Parse attribute to get the attribute string.
* Parses attribute to get the attribute string.
*
* @param attr attribute info
* @return attribute string
......@@ -934,7 +934,7 @@ public class TempJavaCodeFragmentFiles {
}
/**
* Append content to temporary file.
* Appends content to temporary file.
*
* @param file temporary file
* @param data data to be appended
......@@ -1061,7 +1061,7 @@ public class TempJavaCodeFragmentFiles {
}
/**
* Add the new attribute info to the target generated temporary files.
* Adds the new attribute info to the target generated temporary files.
*
* @param newAttrInfo the attribute info that needs to be added to temporary
* files
......@@ -1112,7 +1112,7 @@ public class TempJavaCodeFragmentFiles {
}
/**
* Return java file info.
* Returns java file info.
*
* @return java file info
*/
......
......@@ -17,7 +17,7 @@
package org.onosproject.yangutils.translator.tojava;
/**
* Data model tree traversal types.
* Represents data model tree traversal types.
*/
public enum TraversalType {
......
......@@ -35,7 +35,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Augment information extended to support java code generation.
* Represents augment information extended to support java code generation.
*/
public class YangJavaAugment extends YangAugment
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -59,7 +59,7 @@ public class YangJavaAugment extends YangAugment
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates a YANG java augment object.
*/
public YangJavaAugment() {
super();
......@@ -69,7 +69,7 @@ public class YangJavaAugment extends YangAugment
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -83,7 +83,7 @@ public class YangJavaAugment extends YangAugment
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -93,7 +93,7 @@ public class YangJavaAugment extends YangAugment
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -103,7 +103,7 @@ public class YangJavaAugment extends YangAugment
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -114,7 +114,7 @@ public class YangJavaAugment extends YangAugment
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -124,7 +124,7 @@ public class YangJavaAugment extends YangAugment
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -35,7 +35,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Case information extended to support java code generation.
* Represents case information extended to support java code generation.
*/
public class YangJavaCase extends YangCase
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -59,7 +59,7 @@ public class YangJavaCase extends YangCase
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates YANG java case object.
*/
public YangJavaCase() {
super();
......@@ -69,7 +69,7 @@ public class YangJavaCase extends YangCase
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -83,7 +83,7 @@ public class YangJavaCase extends YangCase
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -93,7 +93,7 @@ public class YangJavaCase extends YangCase
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -103,7 +103,7 @@ public class YangJavaCase extends YangCase
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -114,7 +114,7 @@ public class YangJavaCase extends YangCase
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -124,7 +124,7 @@ public class YangJavaCase extends YangCase
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -35,7 +35,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Choice information extended to support java code generation.
* Represents choice information extended to support java code generation.
*/
public class YangJavaChoice extends YangChoice
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -59,7 +59,7 @@ public class YangJavaChoice extends YangChoice
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates YANG java choice object.
*/
public YangJavaChoice() {
super();
......@@ -69,7 +69,7 @@ public class YangJavaChoice extends YangChoice
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -83,7 +83,7 @@ public class YangJavaChoice extends YangChoice
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -93,7 +93,7 @@ public class YangJavaChoice extends YangChoice
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -103,7 +103,7 @@ public class YangJavaChoice extends YangChoice
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -114,7 +114,7 @@ public class YangJavaChoice extends YangChoice
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -124,7 +124,7 @@ public class YangJavaChoice extends YangChoice
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -35,7 +35,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Container information extended to support java code generation.
* Represents container information extended to support java code generation.
*/
public class YangJavaContainer extends YangContainer
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -59,7 +59,7 @@ public class YangJavaContainer extends YangContainer
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates YANG java container object.
*/
public YangJavaContainer() {
super();
......@@ -69,7 +69,7 @@ public class YangJavaContainer extends YangContainer
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -83,7 +83,7 @@ public class YangJavaContainer extends YangContainer
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -93,7 +93,7 @@ public class YangJavaContainer extends YangContainer
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -103,7 +103,7 @@ public class YangJavaContainer extends YangContainer
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -114,7 +114,7 @@ public class YangJavaContainer extends YangContainer
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -124,7 +124,7 @@ public class YangJavaContainer extends YangContainer
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -35,7 +35,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Grouping information extended to support java code generation.
* Represents grouping information extended to support java code generation.
*/
public class YangJavaGrouping extends YangGrouping
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -59,7 +59,7 @@ public class YangJavaGrouping extends YangGrouping
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates YANG java grouping object.
*/
public YangJavaGrouping() {
super();
......@@ -69,7 +69,7 @@ public class YangJavaGrouping extends YangGrouping
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -83,7 +83,7 @@ public class YangJavaGrouping extends YangGrouping
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -93,7 +93,7 @@ public class YangJavaGrouping extends YangGrouping
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -103,7 +103,7 @@ public class YangJavaGrouping extends YangGrouping
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -114,7 +114,7 @@ public class YangJavaGrouping extends YangGrouping
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -124,7 +124,7 @@ public class YangJavaGrouping extends YangGrouping
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -37,7 +37,7 @@ import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPacka
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Input information extended to support java code generation.
* Represents input information extended to support java code generation.
*/
public class YangJavaInput extends YangInput
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -85,7 +85,7 @@ public class YangJavaInput extends YangInput
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -105,7 +105,7 @@ public class YangJavaInput extends YangInput
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -126,7 +126,7 @@ public class YangJavaInput extends YangInput
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -36,7 +36,7 @@ import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPacka
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* YANG List information extended to support java code generation.
* Represents YANG List information extended to support java code generation.
*/
public class YangJavaList extends YangList
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -60,7 +60,7 @@ public class YangJavaList extends YangList
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates YANG java list object.
*/
public YangJavaList() {
super();
......@@ -70,7 +70,7 @@ public class YangJavaList extends YangList
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -84,7 +84,7 @@ public class YangJavaList extends YangList
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -94,7 +94,7 @@ public class YangJavaList extends YangList
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -104,7 +104,7 @@ public class YangJavaList extends YangList
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -115,7 +115,7 @@ public class YangJavaList extends YangList
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -125,7 +125,7 @@ public class YangJavaList extends YangList
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -35,7 +35,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Module information extended to support java code generation.
* Represents module information extended to support java code generation.
*/
public class YangJavaModule extends YangModule
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -69,7 +69,7 @@ public class YangJavaModule extends YangModule
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -83,7 +83,7 @@ public class YangJavaModule extends YangModule
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -93,7 +93,7 @@ public class YangJavaModule extends YangModule
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -103,7 +103,7 @@ public class YangJavaModule extends YangModule
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -114,7 +114,7 @@ public class YangJavaModule extends YangModule
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -124,7 +124,7 @@ public class YangJavaModule extends YangModule
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -17,8 +17,9 @@
package org.onosproject.yangutils.translator.tojava.javamodel;
import java.io.IOException;
import org.onosproject.yangutils.translator.exception.TranslatorException;
import org.onosproject.yangutils.datamodel.YangNotification;
import org.onosproject.yangutils.translator.exception.TranslatorException;
import org.onosproject.yangutils.translator.tojava.HasJavaFileInfo;
import org.onosproject.yangutils.translator.tojava.HasJavaImportData;
import org.onosproject.yangutils.translator.tojava.HasTempJavaCodeFragmentFiles;
......@@ -35,7 +36,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Notification information extended to support java code generation.
* Represents notification information extended to support java code generation.
*/
public class YangJavaNotification extends YangNotification
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -83,7 +84,7 @@ public class YangJavaNotification extends YangNotification
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -103,7 +104,7 @@ public class YangJavaNotification extends YangNotification
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -124,7 +125,7 @@ public class YangJavaNotification extends YangNotification
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -37,7 +37,7 @@ import static org.onosproject.yangutils.utils.io.impl.FileSystemUtil.createPacka
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Output information extended to support java code generation.
* Represents output information extended to support java code generation.
*/
public class YangJavaOutput extends YangOutput
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -85,7 +85,7 @@ public class YangJavaOutput extends YangOutput
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -105,7 +105,7 @@ public class YangJavaOutput extends YangOutput
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -126,7 +126,7 @@ public class YangJavaOutput extends YangOutput
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -21,7 +21,7 @@ import org.onosproject.yangutils.datamodel.YangRpc;
import org.onosproject.yangutils.translator.tojava.JavaCodeGenerator;
/**
* Rpc information extended to support java code generation.
* Represents rpc information extended to support java code generation.
*/
public class YangJavaRpc extends YangRpc implements JavaCodeGenerator {
......@@ -32,7 +32,7 @@ public class YangJavaRpc extends YangRpc implements JavaCodeGenerator {
}
/**
* Prepare the information for java code generation corresponding to YANG
* Prepares the information for java code generation corresponding to YANG
* rpc info.
*
* @param codeGenDir code generation directory
......@@ -44,7 +44,7 @@ public class YangJavaRpc extends YangRpc implements JavaCodeGenerator {
}
/**
* Create a java file using the YANG rpc info.
* Creates a java file using the YANG rpc info.
*
* @throws IOException IO operation fail
*/
......
......@@ -36,7 +36,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Sub module information extended to support java code generation.
* Represents Sub module information extended to support java code generation.
*/
public class YangJavaSubModule extends YangSubModule
implements JavaCodeGenerator, HasJavaFileInfo,
......@@ -60,7 +60,7 @@ public class YangJavaSubModule extends YangSubModule
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates YANG java sub module object.
*/
public YangJavaSubModule() {
super();
......@@ -70,7 +70,7 @@ public class YangJavaSubModule extends YangSubModule
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -84,7 +84,7 @@ public class YangJavaSubModule extends YangSubModule
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -94,7 +94,7 @@ public class YangJavaSubModule extends YangSubModule
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -104,7 +104,7 @@ public class YangJavaSubModule extends YangSubModule
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -115,7 +115,7 @@ public class YangJavaSubModule extends YangSubModule
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -125,7 +125,7 @@ public class YangJavaSubModule extends YangSubModule
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......@@ -135,7 +135,7 @@ public class YangJavaSubModule extends YangSubModule
}
/**
* Get the name space of the module to which the sub module belongs to.
* Returns the name space of the module to which the sub module belongs to.
*
* @param belongsToInfo Information of the module to which the sub module
* belongs
......
......@@ -35,7 +35,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.getAbsolutePackagePath;
/**
* Type define information extended to support java code generation.
* Represents type define information extended to support java code generation.
*/
public class YangJavaTypeDef extends YangTypeDef
implements JavaCodeGenerator, HasJavaFileInfo, HasJavaImportData, HasTempJavaCodeFragmentFiles {
......@@ -58,7 +58,7 @@ public class YangJavaTypeDef extends YangTypeDef
private TempJavaCodeFragmentFiles tempFileHandle;
/**
* Default constructor.
* Creates a YANG java typedef object.
*/
public YangJavaTypeDef() {
super();
......@@ -68,7 +68,7 @@ public class YangJavaTypeDef extends YangTypeDef
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -82,7 +82,7 @@ public class YangJavaTypeDef extends YangTypeDef
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -92,7 +92,7 @@ public class YangJavaTypeDef extends YangTypeDef
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -102,7 +102,7 @@ public class YangJavaTypeDef extends YangTypeDef
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......@@ -113,7 +113,7 @@ public class YangJavaTypeDef extends YangTypeDef
}
/**
* Get the temporary file handle.
* Returns the temporary file handle.
*
* @return temporary file handle
*/
......@@ -123,7 +123,7 @@ public class YangJavaTypeDef extends YangTypeDef
}
/**
* Set temporary file handle.
* Sets temporary file handle.
*
* @param fileHandle temporary file handle
*/
......
......@@ -30,7 +30,7 @@ import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSy
import static org.onosproject.yangutils.translator.tojava.utils.JavaIdentifierSyntax.getPackageDirPathFromJavaJPackage;
/**
* Uses information extended to support java code generation.
* Represents uses information extended to support java code generation.
*/
public class YangJavaUses extends YangUses implements JavaCodeGenerator, HasJavaFileInfo, HasJavaImportData {
......@@ -46,7 +46,7 @@ public class YangJavaUses extends YangUses implements JavaCodeGenerator, HasJava
private JavaImportData javaImportData;
/**
* Default constructor.
* Creates YANG java uses object.
*/
public YangJavaUses() {
super();
......@@ -56,7 +56,7 @@ public class YangJavaUses extends YangUses implements JavaCodeGenerator, HasJava
}
/**
* Get the generated java file information.
* Returns the generated java file information.
*
* @return generated java file information
*/
......@@ -70,7 +70,7 @@ public class YangJavaUses extends YangUses implements JavaCodeGenerator, HasJava
}
/**
* Set the java file info object.
* Sets the java file info object.
*
* @param javaInfo java file info object
*/
......@@ -80,7 +80,7 @@ public class YangJavaUses extends YangUses implements JavaCodeGenerator, HasJava
}
/**
* Get the data of java imports to be included in generated file.
* Returns the data of java imports to be included in generated file.
*
* @return data of java imports to be included in generated file
*/
......@@ -90,7 +90,7 @@ public class YangJavaUses extends YangUses implements JavaCodeGenerator, HasJava
}
/**
* Set the data of java imports to be included in generated file.
* Sets the data of java imports to be included in generated file.
*
* @param javaImportData data of java imports to be included in generated
* file
......
......@@ -59,14 +59,14 @@ import static org.onosproject.yangutils.utils.UtilConstants.SHORT_WRAPPER;
import static org.onosproject.yangutils.utils.UtilConstants.STRING_DATA_TYPE;
/**
* Provides java data types corresponding to YANG type.
* Represents java data types info corresponding to YANG type.
*/
public final class AttributesJavaDataType {
private static Set<JavaQualifiedTypeInfo> importInfo = new TreeSet<>();
/**
* Default constructor.
* Creates an instance of attribute java data type.
*/
private AttributesJavaDataType() {
}
......
......@@ -34,12 +34,12 @@ import static org.onosproject.yangutils.utils.UtilConstants.PUBLIC;
import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
/**
* Generates class definition for generated files.
* Represents generator for class definition of generated files.
*/
public final class ClassDefinitionGenerator {
/**
* Default constructor.
* Creates an instance of class definition generator.
*/
private ClassDefinitionGenerator() {
}
......
......@@ -32,18 +32,18 @@ import static org.onosproject.yangutils.utils.UtilConstants.SEMI_COLAN;
import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
/**
* Utility class to generate the java snippet.
* Represents utility class to generate the java snippet.
*/
public final class JavaCodeSnippetGen {
/**
* Default constructor.
* Creates an instance of java code snippet gen.
*/
private JavaCodeSnippetGen() {
}
/**
* Get the java file header comment.
* Returns the java file header comment.
*
* @return the java file header comment
*/
......@@ -56,19 +56,18 @@ public final class JavaCodeSnippetGen {
}
/**
* Get the textual java code information corresponding to the import list.
* Returns the textual java code information corresponding to the import list.
*
* @param importInfo import info
* @return the textual java code information corresponding to the import
* list
*/
public static String getImportText(JavaQualifiedTypeInfo importInfo) {
return IMPORT + importInfo.getPkgInfo() + PERIOD + importInfo.getClassInfo() + SEMI_COLAN + NEW_LINE;
}
/**
* Based on the file type and the YANG name of the file, generate the class
* Returns based on the file type and the YANG name of the file, generate the class
* / interface definition start.
*
* @param genFileTypes type of file being generated
......@@ -85,7 +84,7 @@ public final class JavaCodeSnippetGen {
}
/**
* Get the textual java code for attribute definition in class.
* Returns the textual java code for attribute definition in class.
*
* @param javaAttributeTypePkg Package of the attribute type
* @param javaAttributeType java attribute type
......@@ -124,18 +123,16 @@ public final class JavaCodeSnippetGen {
* @return list attribute string
*/
public static String getListAttribute(String type) {
return LIST + DIAMOND_OPEN_BRACKET + type + DIAMOND_CLOSE_BRACKET;
}
/**
* Based on the file type and the YANG name of the file, generate the class
* Returns based on the file type and the YANG name of the file, generate the class
* / interface definition close.
*
* @return corresponding textual java code information
*/
public static String getJavaClassDefClose() {
return CLOSE_CURLY_BRACKET;
}
}
......
......@@ -62,12 +62,12 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataInto
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.partString;
/**
* Generates java file.
* Representation of java file generator.
*/
public final class JavaFileGenerator {
/**
* Default constructor.
* Creates an instance of java file generator.
*/
private JavaFileGenerator() {
}
......
......@@ -57,12 +57,12 @@ import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.INT
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.insertDataIntoJavaFile;
/**
* Provides utilities for java file generator.
* Represents utilities for java file generator.
*/
public final class JavaFileGeneratorUtils {
/**
* Default constructor.
* Creates an instance of java file generator util.
*/
private JavaFileGeneratorUtils() {
}
......@@ -82,7 +82,7 @@ public final class JavaFileGeneratorUtils {
}
/**
* Return data stored in temporary files.
* Returns data stored in temporary files.
*
* @param generatedTempFiles temporary file types
* @param curNode current YANG node
......@@ -126,7 +126,7 @@ public final class JavaFileGeneratorUtils {
}
/**
* Initiate generation of file based on generated file type.
* Initiates generation of file based on generated file type.
*
* @param file generated file
* @param className generated file class name
......@@ -232,7 +232,7 @@ public final class JavaFileGeneratorUtils {
}
/**
* Write data to the specific generated file.
* Writes data to the specific generated file.
*
* @param file generated file
* @param fileName file name
......
......@@ -38,7 +38,7 @@ import static org.onosproject.yangutils.utils.UtilConstants.UNDER_SCORE;
import static org.onosproject.yangutils.utils.UtilConstants.VERSION_PREFIX;
/**
* Utility Class for translating the name from YANG to java convention.
* Represents an utility Class for translating the name from YANG to java convention.
*/
public final class JavaIdentifierSyntax {
......@@ -51,13 +51,13 @@ public final class JavaIdentifierSyntax {
private static final String ZERO = "0";
/**
* Default constructor.
* Create instance of java identifier syntax.
*/
private JavaIdentifierSyntax() {
}
/**
* Get the root package string.
* Returns the root package string.
*
* @param version YANG version
* @param nameSpace name space of the module
......@@ -79,7 +79,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Get the contained data model parent node.
* 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
......@@ -95,7 +95,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Get the node package string.
* Returns the node package string.
*
* @param curNode current java node whose package string needs to be set
* @return returns the root package string
......@@ -128,12 +128,12 @@ public final class JavaIdentifierSyntax {
}
/**
* Get package name from name space.
* Returns package name from name space.
*
* @param nameSpace name space of YANG module
* @return java package name as per java rules
*/
public static String getPkgFromNameSpace(String nameSpace) {
private static String getPkgFromNameSpace(String nameSpace) {
ArrayList<String> pkgArr = new ArrayList<String>();
nameSpace = nameSpace.replace(QUOTES, EMPTY_STRING);
......@@ -153,7 +153,7 @@ public final class JavaIdentifierSyntax {
* @return revision string
* @throws TranslatorException when date is invalid.
*/
public static String getYangRevisionStr(String date) throws TranslatorException {
private static String getYangRevisionStr(String date) throws TranslatorException {
String[] revisionArr = date.split(HYPHEN);
......@@ -183,7 +183,7 @@ public final class JavaIdentifierSyntax {
* @param pkgArr package array
* @return package string
*/
public static String getPkgFrmArr(ArrayList<String> pkgArr) {
private static String getPkgFrmArr(ArrayList<String> pkgArr) {
String pkg = EMPTY_STRING;
int size = pkgArr.size();
......@@ -203,7 +203,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Get package sub name from YANG identifier name.
* Returns package sub name from YANG identifier name.
*
* @param name YANG identifier name
* @return java package sub name as per java rules
......@@ -220,7 +220,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Translate the YANG identifier name to java identifier.
* Returns the YANG identifier name as java identifier.
*
* @param yangIdentifier identifier in YANG file
* @return corresponding java identifier
......@@ -236,7 +236,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Translate the YANG identifier name to java identifier with first letter
* Returns the YANG identifier name as java identifier with first letter
* in caps.
*
* @param yangIdentifier identifier in YANG file
......@@ -247,7 +247,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Translate the YANG identifier name to java identifier with first letter
* Returns the YANG identifier name as java identifier with first letter
* in small.
*
* @param yangIdentifier identifier in YANG file.
......@@ -258,7 +258,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Get the java Package from package path.
* Returns the java Package from package path.
*
* @param packagePath package path
* @return java package
......@@ -268,7 +268,7 @@ public final class JavaIdentifierSyntax {
}
/**
* Get the directory path corresponding to java package.
* Returns the directory path corresponding to java package.
*
* @param packagePath package path
* @return java package
......
......@@ -83,12 +83,12 @@ import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.SET
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.trimAtLast;
/**
* Generated methods for generated files based on the file type.
* Represents generator for methods of generated files based on the file type.
*/
public final class MethodsGenerator {
/**
* Default constructor.
* Creates an instance of method generator.
*/
private MethodsGenerator() {
}
......@@ -506,7 +506,7 @@ public final class MethodsGenerator {
}
/**
* To string method for class.
* Returns to string method for class.
*
* @param attr attribute info
* @return to string method
......@@ -521,9 +521,9 @@ public final class MethodsGenerator {
}
/**
* Returns to hash code method open strings.
* Returns hash code method open strings.
*
* @return to hash code method open string
* @return hash code method open string
*/
public static String getHashCodeMethodOpen() {
......@@ -533,7 +533,7 @@ public final class MethodsGenerator {
}
/**
* Returns to hash code methods close string.
* Returns hash code methods close string.
*
* @param hashcodeString hash code string
* @return to hash code method close string
......@@ -547,7 +547,7 @@ public final class MethodsGenerator {
}
/**
* Hash code method for class.
* Returns hash code method for class.
*
* @param attr attribute info
* @return hash code method
......@@ -558,10 +558,10 @@ public final class MethodsGenerator {
}
/**
* Returns to equals method open strings.
* Returns equals method open strings.
*
* @param className class name
* @return to equals method open string
* @return equals method open string
*/
public static String getEqualsMethodOpen(String className) {
......@@ -597,10 +597,10 @@ public final class MethodsGenerator {
}
/**
* Returns to equals methods close string.
* Returns equals methods close string.
*
* @param equalMethodString equal method string
* @return to equals method close string
* @return equals method close string
*/
public static String getEqualsMethodClose(String equalMethodString) {
......@@ -614,7 +614,7 @@ public final class MethodsGenerator {
}
/**
* Equals method for class.
* Returns equals method for class.
*
* @param attr attribute info
* @return equals method
......
......@@ -21,12 +21,12 @@ import java.util.Arrays;
import java.util.List;
/**
* Provides utility constants while generating java files.
* Represents utilities constants which are used while generating java files.
*/
public final class UtilConstants {
/**
* Default constructor.
* Creates an instance of util constants.
*/
private UtilConstants() {
}
......
......@@ -16,7 +16,7 @@
package org.onosproject.yangutils.utils;
/**
* ENUM to represent the type of data in parse tree.
* Represents ENUM to represent the type of data in parse tree.
*/
public enum YangConstructType {
/**
......
......@@ -27,7 +27,7 @@ import java.io.OutputStream;
import static org.onosproject.yangutils.utils.UtilConstants.NEW_LINE;
/**
* Provides the license header for the generated files.
* Represents the license header for the generated files.
*/
public final class CopyrightHeader {
......@@ -39,7 +39,7 @@ public final class CopyrightHeader {
private static String copyrightHeader;
/**
* Default constructor.
* Creates an instance of copyright header.
*/
private CopyrightHeader() {
}
......@@ -69,11 +69,11 @@ public final class CopyrightHeader {
}
/**
* parse Copyright to the temporary file.
* parses Copyright to the temporary file.
*
* @throws IOException when fails to get the copyright header
*/
public static void parseCopyrightHeader() throws IOException {
private static void parseCopyrightHeader() throws IOException {
File temp = new File(TEMP_FILE);
......
......@@ -36,18 +36,18 @@ import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.addPackageInfo
import static org.onosproject.yangutils.utils.io.impl.YangIoUtils.createDirectories;
/**
* Utility to handle file system operations.
* Represents utility to handle file system operations.
*/
public final class FileSystemUtil {
/**
* Hiding constructor of a utility class.
* Creates an instance of file system util.
*/
private FileSystemUtil() {
}
/**
* Check if the package directory structure created.
* Checks if the package directory structure created.
*
* @param pkg Package to check if it is created
* @return existence status of package
......@@ -63,7 +63,7 @@ public final class FileSystemUtil {
}
/**
* Create a package structure with package info java file if not present.
* Creates a package structure with package info java file if not present.
*
* @param pkg java package string
* @param pkgInfo description of package
......@@ -82,7 +82,7 @@ public final class FileSystemUtil {
}
/**
* Read the contents from source file and append its contents to append
* Reads the contents from source file and append its contents to append
* file.
*
* @param toAppend destination file in which the contents of source file is
......@@ -133,7 +133,7 @@ public final class FileSystemUtil {
}
/**
* Update the generated file handle.
* Updates the generated file handle.
*
* @param inputFile input file
* @param contentTobeAdded content to be appended to the file
......
......@@ -49,12 +49,12 @@ import static org.onosproject.yangutils.utils.UtilConstants.SPACE;
import static org.onosproject.yangutils.utils.UtilConstants.VALUE;
/**
* Provides javadoc for the generated classes.
* Represents javadoc for the generated classes.
*/
public final class JavaDocGen {
/**
* Default Constructor.
* Creates an instance of java doc gen.
*/
private JavaDocGen() {
}
......
......@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Stack;
/**
* Provides utility for searching the files in a directory.
* Represents utility for searching the files in a directory.
*/
public final class YangFileScanner {
......@@ -31,7 +31,7 @@ public final class YangFileScanner {
private static final String YANG_FILE_EXTENTION = ".yang";
/**
* Default constructor.
* Creates an instance of YANG file scanner.
*/
private YangFileScanner() {
}
......
......@@ -48,7 +48,7 @@ import static org.onosproject.yangutils.utils.io.impl.JavaDocGen.JavaDocType.PAC
import static org.slf4j.LoggerFactory.getLogger;
/**
* Provides common utility functionalities for code generation.
* Represents common utility functionalities for code generation.
*/
public final class YangIoUtils {
......@@ -56,7 +56,7 @@ public final class YangIoUtils {
private static final String TARGET_RESOURCE_PATH = SLASH + TEMP + SLASH + YANG_RESOURCES + SLASH;
/**
* Default constructor.
* Creates an instance of YANG io utils.
*/
private YangIoUtils() {
}
......@@ -68,7 +68,6 @@ public final class YangIoUtils {
* @return directory structure
*/
public static File createDirectories(String path) {
File generatedDir = new File(path);
generatedDir.mkdirs();
return generatedDir;
......@@ -114,7 +113,6 @@ public final class YangIoUtils {
* @throws IOException when failed to delete directory
*/
public static void clean(String dir) throws IOException {
File generatedDirectory = new File(dir);
if (generatedDirectory.exists()) {
try {
......@@ -133,7 +131,6 @@ public final class YangIoUtils {
* @param context current build context
*/
public static void addToSource(String source, MavenProject project, BuildContext context) {
project.addCompileSourceRoot(source);
context.refresh(project.getBasedir());
log.info("Source directory added to compilation root: " + source);
......@@ -147,7 +144,6 @@ public final class YangIoUtils {
* @return new string
*/
public static String trimAtLast(String valueString, String removealStirng) {
StringBuilder stringBuilder = new StringBuilder(valueString);
int index = valueString.lastIndexOf(removealStirng);
stringBuilder.deleteCharAt(index);
......@@ -161,7 +157,6 @@ public final class YangIoUtils {
* @return parted string
*/
public static String partString(String partString) {
String[] strArray = partString.split(COMMA);
String newString = EMPTY_STRING;
for (int i = 0; i < strArray.length; i++) {
......@@ -176,7 +171,7 @@ public final class YangIoUtils {
}
/**
* Get the directory path of the package in canonical form.
* Returns the directory path of the package in canonical form.
*
* @param baseCodeGenPath base path where the generated files needs to be
* put
......@@ -197,7 +192,7 @@ public final class YangIoUtils {
}
/**
* Get the absolute path of the package in canonical form.
* Returns the absolute path of the package in canonical form.
*
* @param baseCodeGenPath base path where the generated files needs to be
* put
......@@ -205,12 +200,11 @@ public final class YangIoUtils {
* @return absolute path of the package in canonical form
*/
public static String getAbsolutePackagePath(String baseCodeGenPath, String pathOfJavaPkg) {
return baseCodeGenPath + pathOfJavaPkg;
}
/**
* Copy YANG files to the current project's output directory.
* Copies YANG files to the current project's output directory.
*
* @param yangFiles list of YANG files
* @param outputDir project's output directory
......@@ -243,7 +237,6 @@ public final class YangIoUtils {
* @return list of files
*/
private static List<File> getListOfFile(List<String> strings) {
List<File> files = new ArrayList<>();
for (String file : strings) {
files.add(new File(file));
......@@ -252,14 +245,13 @@ public final class YangIoUtils {
}
/**
* Merge the temp java files to main java files.
* Merges the temp java files to main java files.
*
* @param appendFile temp file
* @param srcFile main file
* @throws IOException when fails to append contents
*/
public static void mergeJavaFiles(File appendFile, File srcFile) throws IOException {
try {
appendFileContents(appendFile, srcFile);
} catch (IOException e) {
......@@ -268,14 +260,13 @@ public final class YangIoUtils {
}
/**
* Insert data in the generated file.
* Inserts data in the generated file.
*
* @param file file in which need to be inserted
* @param data data which need to be inserted
* @throws IOException when fails to insert into file
*/
public static void insertDataIntoJavaFile(File file, String data) throws IOException {
try {
updateFileHandle(file, data, false);
} catch (IOException e) {
......