Change to static import for lesser indentation.
Change-Id: I5350c65496023a96c88cefe9dd5ed64a72c5f30c
diff --git a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
index fffa86a..e5ebf36 100644
--- a/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
+++ b/src/main/java/org/onosproject/yangutils/parser/impl/listeners/TypeListener.java
@@ -21,14 +21,17 @@
import org.onosproject.yangutils.datamodel.YangLeafList;
import org.onosproject.yangutils.datamodel.YangType;
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.TYPE_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
@@ -68,9 +71,7 @@
GeneratedYangParser.TypeStatementContext ctx) {
// Check for stack to be non empty.
- ListenerValidation.checkStackIsNotEmpty(listener, ListenerErrorType.MISSING_HOLDER,
- ParsableDataType.TYPE_DATA, String.valueOf(ctx.string().getText()),
- ListenerErrorLocation.ENTRY);
+ checkStackIsNotEmpty(listener, MISSING_HOLDER, TYPE_DATA, ctx.string().getText(), ENTRY);
YangType type = new YangType();
YangDataTypes yangDataTypes = YangDataTypes.getType(ctx.string().getText());
@@ -90,11 +91,8 @@
case TYPEDEF_DATA: //TODO
break;
default:
- throw new ParserException(ListenerErrorMessageConstruction
- .constructListenerErrorMessage(ListenerErrorType.INVALID_HOLDER,
- ParsableDataType.TYPE_DATA,
- String.valueOf(ctx.string().getText()),
- ListenerErrorLocation.ENTRY));
+ throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, TYPE_DATA,
+ ctx.string().getText(), ENTRY));
}
}
}
\ No newline at end of file