コード例 #1
0
 /** {@inheritDoc} */
 @Override
 public boolean accept(final ConsoleState state) {
   Assertions.checkNotNull("state", state);
   if (state.getActiveCommand() == null && state.getInput().trim().equals("exit")) {
     return true;
   }
   return false;
 }
コード例 #2
0
 /** {@inheritDoc} */
 @Override
 public void execute(final ConsoleReader reader, final PrintWriter out, final ConsoleState state) {
   Assertions.checkNotNull("reader", reader);
   Assertions.checkNotNull("out", out);
   Assertions.checkNotNull("state", state);
   if (!accept(state)) {
     return;
   }
   state.setQuitApplication(true);
   state.setInput(null);
   state.clearBuffer();
 }