Beispiel #1
0
 /**
  * Cmd action to ask user and get a response
  *
  * @param argArray arguments in interpreter buffer
  * @return what's left of arguments
  */
 public ArgArray CmdCommentQuote(ArgArray argArray) {
   setDataDest(DataSink.fromSinkName("NULL:"));
   while (argArray.hasDashCommand()) {
     String dashCommand = argArray.parseDashCommand();
     switch (dashCommand) {
       case "-to":
         setDataDestfromArgArray(argArray);
         break;
       default:
         unknownDashCommand(dashCommand);
     }
   }
   if (havingUnknownDashCommand()) {
     setCommandResult(COMMANDRESULT.FAILURE);
   } else if (argArray.size() < 1) { // no text following
     logArgArrayTooShortError(argArray);
     setCommandResult(COMMANDRESULT.FAILURE);
   } else {
     String quote = argArray.nextMaybeQuotation();
     try {
       put(quote);
     } catch (SQLException
         | IOException
         | AS400SecurityException
         | ErrorCompletingRequestException
         | InterruptedException
         | ObjectDoesNotExistException
         | RequestNotSupportedException ex) {
       getLogger()
           .log(
               Level.SEVERE,
               "Could not put comment quote \"" + quote + "\" in " + getNameAndDescription(),
               ex);
       setCommandResult(COMMANDRESULT.FAILURE);
     }
   }
   return argArray;
 }