Examples of CommandDefinition


Examples of org.impalaframework.command.framework.CommandDefinition

      return false;
    }
  }

  public CommandDefinition getCommandDefinition() {
    return new CommandDefinition("Loads module definition using supplied test class");
  }
View Full Code Here

Examples of org.impalaframework.command.framework.CommandDefinition

   
    throw new TerminatedApplicationException();
  }

  public CommandDefinition getCommandDefinition() {
    return new CommandDefinition("Shuts down modules and exits application");
  }
View Full Code Here

Examples of org.impalaframework.command.framework.CommandDefinition

    Impala.init(moduleDefinitionSource);
    return true;
  }

  public CommandDefinition getCommandDefinition() {
    return new CommandDefinition();
  }
View Full Code Here

Examples of org.impalaframework.command.framework.CommandDefinition

    }
    return true;
  }

  public CommandDefinition getCommandDefinition() {
    return new CommandDefinition();
  }
View Full Code Here

Examples of org.impalaframework.command.framework.CommandDefinition

      return false;
    }
  }

  public CommandDefinition getCommandDefinition() {
    return new CommandDefinition("Loads module definition using supplied test class");
  }
View Full Code Here

Examples of org.impalaframework.command.framework.CommandDefinition

    return currentDirectoryName;
  }

  public CommandDefinition getCommandDefinition() {
    return new CommandDefinition("Runs test");
  }
View Full Code Here

Examples of org.impalaframework.command.framework.CommandDefinition

    return true;
  }

  public CommandDefinition getCommandDefinition() {

    CommandDefinition commandDefinition = new CommandDefinition();

    String[] extraLines = new String[alternatives.length];

    for (int i = 0; i < extraLines.length; i++) {
      extraLines[i] = (i + 1) + " " + alternatives[i];
    }

    CommandInfo ci1 = new CommandInfo("selection", "Selected value", "More than one alternative was found.\nPlease choose option by entering digit corresponding with selection",
        null,
        extraLines, true, false, false, false) {
      @Override
      public String validate(String input) {
        int selection = -1;
        try {
          selection = Integer.parseInt(input);
        }
        catch (NumberFormatException e) {
          return "Invalid Selection. Please select a number corresponding with one of the alternative choices";
        }

        if (selection <= 0 || selection > alternatives.length) {
          return "Invalid Selection. Selected number does not correspond with one of the values."
              + "\nPlease select a number between 1 and " + alternatives.length;
        }

        return null;
      }

    };
    commandDefinition.add(ci1);
    return commandDefinition;
  }
View Full Code Here

Examples of org.impalaframework.command.framework.CommandDefinition

        return null;
      }

    };

    CommandDefinition commandDefinition = new CommandDefinition();
    commandDefinition.add(commandInfo);
    return commandDefinition;
  }
View Full Code Here

Examples of org.jboss.aesh.cl.CommandDefinition

    public static CommandLineParser generateCommandLineParser(Object paramInstance) throws CommandLineParserException {
        return generateCommandLineParser(paramInstance.getClass());
    }

    public static CommandLineParser generateCommandLineParser(Class clazz) throws CommandLineParserException {
        CommandDefinition command = (CommandDefinition) clazz.getAnnotation(CommandDefinition.class);
        if(command == null)
            throw new CommandLineParserException("Commands must be annotated with @CommandDefinition");

        ProcessedCommand processedCommand = new ProcessedCommand(command.name(), command.description(), command.validator());

        for(Field field : clazz.getDeclaredFields()) {
            Option o;
            OptionGroup og;
            OptionList ol;
View Full Code Here

Examples of org.jboss.aesh.cl.CommandDefinition

    public static CommandLineParser generateCommandLineParser(Object paramInstance) throws CommandLineParserException {
        return generateCommandLineParser(paramInstance.getClass());
    }

    public static CommandLineParser generateCommandLineParser(Class clazz) throws CommandLineParserException {
        CommandDefinition command = (CommandDefinition) clazz.getAnnotation(CommandDefinition.class);
        if(command == null)
            throw new CommandLineParserException("Commands must be annotated with @CommandDefinition");

        ProcessedCommand processedCommand = new ProcessedCommand(command.name(), command.description(), command.validator());

        for(Field field : clazz.getDeclaredFields()) {
            Option o;
            OptionGroup og;
            OptionList ol;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.