예제 #1
0
 @Override
 public void run(final Context context) throws ExitException {
   if (context.contains(INSTANCE)) {
     context.show("Validating DSL ...");
     final Either<Boolean> result = DslCompiler.parse(context, DslPath.getDslPaths(context));
     if (result.isSuccess()) {
       context.show("Parse successful.");
     } else {
       context.error(result.whyNot());
       throw new ExitException();
     }
   }
 }
예제 #2
0
 @Override
 public boolean check(final Context context) throws ExitException {
   if (context.contains(INSTANCE)) {
     final Map<String, String> dslMap = DslPath.getCurrentDsl(context);
     if (dslMap.size() == 0) {
       context.error(
           "DSL files not found in: "
               + context.get(DslPath.INSTANCE)
               + ". At least one DSL file required.");
       return false;
     }
   }
   return true;
 }