Example #1
0
  /** execute */
  public CommandResult execute(CommandContext context) {
    // set output type
    context.setOutputType(getOutputType());

    CommandResult result = new CommandResult(this, context);

    // set result
    result.setOutputString(this.getExpansion());

    // indicate successful execution so that command result processing will work
    result.setExecutedSuccessfully(true);

    // grab input type so we can report back which input was used
    String inputTypeString = (String) context.get(CommandContext.INPUT_TYPE);
    InputType inputType = InputType.get(inputTypeString);

    result.setInputType(inputType);

    return result;
  }