[ONOS-3880, 3881] Change to static import for lesser indentation.
Change-Id: I93a39f9b0ccd019ace5900bf8ba68f7d60f228a0
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java
index 3f60aef..8cd6d67 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/RevisionDateListener.java
@@ -19,14 +19,16 @@
import org.onosproject.yangutils.datamodel.YangImport;
import org.onosproject.yangutils.datamodel.YangInclude;
import org.onosproject.yangutils.parser.Parsable;
-import org.onosproject.yangutils.parser.ParsableDataType;
import org.onosproject.yangutils.parser.antlrgencode.GeneratedYangParser;
import org.onosproject.yangutils.parser.exceptions.ParserException;
import org.onosproject.yangutils.parser.impl.TreeWalkListener;
-import org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorLocation;
-import org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorMessageConstruction;
-import org.onosproject.yangutils.parser.impl.parserutils.ListenerErrorType;
-import org.onosproject.yangutils.parser.impl.parserutils.ListenerValidation;
+
+import static org.onosproject.yangutils.parser.ParsableDataType.REVISION_DATE_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;
/*
* Reference: RFC6020 and YANG ANTLR Grammar
@@ -57,8 +59,9 @@
*/
/**
- * Implements listener based call back function corresponding to the "revision date"
- * rule defined in ANTLR grammar file for corresponding ABNF rule in RFC 6020.
+ * Implements listener based call back function corresponding to the
+ * "revision date" rule defined in ANTLR grammar file for corresponding ABNF
+ * rule in RFC 6020.
*/
public final class RevisionDateListener {
@@ -69,9 +72,8 @@
}
/**
- * It is called when parser receives an input matching the grammar
- * rule (revision date),perform validations and update the data model
- * tree.
+ * It is called when parser receives an input matching the grammar rule
+ * (revision date),perform validations and update the data model tree.
*
* @param listener Listener's object.
* @param ctx context object of the grammar rule.
@@ -80,10 +82,8 @@
GeneratedYangParser.RevisionDateStatementContext ctx) {
// Check for stack to be non empty.
- ListenerValidation.checkStackIsNotEmpty(listener, ListenerErrorType.MISSING_HOLDER,
- ParsableDataType.REVISION_DATE_DATA,
- String.valueOf(ctx.DATE_ARG().getText()),
- ListenerErrorLocation.ENTRY);
+ checkStackIsNotEmpty(listener, MISSING_HOLDER, REVISION_DATE_DATA, String.valueOf(ctx.DATE_ARG().getText()),
+ ENTRY);
// Obtain the node of the stack.
Parsable tmpNode = listener.getParsedDataStack().peek();
@@ -99,13 +99,9 @@
break;
}
default:
- throw new ParserException(
- ListenerErrorMessageConstruction
- .constructListenerErrorMessage(ListenerErrorType.INVALID_HOLDER,
- ParsableDataType.REVISION_DATE_DATA,
- String.valueOf(ctx.DATE_ARG().getText()),
- ListenerErrorLocation.ENTRY));
+ throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, REVISION_DATE_DATA,
+ String.valueOf(ctx.DATE_ARG().getText()), ENTRY));
}
}
// TODO Implement the DATE_ARG validation as per RFC 6020.
-}
\ No newline at end of file
+}