[ONOS-3880, 3881] Yang Listener for Module and Sub-Module
Change-Id: Iee75c3e04af9b66ebc38acb3396aa4c54af5a268
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorType.java b/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorType.java
new file mode 100644
index 0000000..13925bc
--- /dev/null
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/parserutils/ListenerErrorType.java
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+package org.onosproject.yangutils.parser.impl.parserutils;
+
+/**
+ * Maintains listener error type.
+ */
+public enum ListenerErrorType {
+ /**
+ * Represents the parent holder in parsable stack for given YANG construct is invalid.
+ */
+ INVALID_HOLDER(),
+
+ /**
+ * Represents the parent holder in parsable stack for given YANG construct is missing.
+ */
+ MISSING_HOLDER(),
+
+ /**
+ * Represents the current holder in parsable stack for given YANG construct is missing.
+ */
+ MISSING_CURRENT_HOLDER(),
+
+ /**
+ * Represents that the child in parsable stack for given YANG construct is invalid.
+ */
+ INVALID_CHILD(),
+
+ /**
+ * Represents that the cardinality for given YANG construct is invalid.
+ */
+ INVALID_CARDINALITY(),
+
+ /**
+ * Represents that some of earlier parsed data is not handled correctly.
+ */
+ UNHANDLED_PARSED_DATA();
+
+ /**
+ * Returns the message corresponding to listener error type.
+ *
+ * @param errorType enum value for type of error.
+ * @return message corresponding to listener error type.
+ */
+ public static String getErrorType(ListenerErrorType errorType) {
+
+ switch (errorType) {
+ case INVALID_HOLDER:
+ return "Invalid holder for";
+ case MISSING_HOLDER:
+ return "Missing holder at";
+ case MISSING_CURRENT_HOLDER:
+ return "Missing";
+ case INVALID_CHILD:
+ return "Invalid child in";
+ case INVALID_CARDINALITY:
+ return "Invalid cardinality in";
+ case UNHANDLED_PARSED_DATA:
+ return "Unhandled parsed data at";
+ default:
+ return "Problem in";
+ }
+ }
+}
\ No newline at end of file