private <C extends BaseCommand> ClassShellCommand<C> make(Class<C> clazz) throws IntrospectionException { return new ClassShellCommand<C>(clazz); }
private <C extends BaseCommand> CommandResolution createCommand(final Class<C> commandClass) throws CommandException { final ClassShellCommand<C> shellCommand; final String description; try { shellCommand = new ClassShellCommand<C>(commandClass); description = shellCommand.describe(commandClass.getSimpleName(), Format.DESCRIBE); } catch (IntrospectionException e) { throw new CommandException(ErrorKind.SYNTAX, "Invalid cli annotation in command " + commandClass.getSimpleName(), e); } return new CommandResolution() { @Override public String getDescription() { return description; } @Override public Command<?> getCommand() throws CommandException { return shellCommand; } }; } }
@Override public Command<?> resolveCommand(String name) throws CommandException, NullPointerException { if ("mycommand".equals(name)) { try { return new ClassShellCommand<mycommand>(mycommand.class); } catch (IntrospectionException e) { throw new CommandException(ErrorKind.EVALUATION, "Invalid cli annotations", e); } } return null; } }
public <B extends BaseCommand> String execute(Class<B> commandClass, String... args) throws IntrospectionException, IOException, CommandException { return execute(new ClassShellCommand<B>(commandClass), args); }
final ClassShellCommand command; try { command = new ClassShellCommand(clazz);
private <C extends BaseCommand> ClassShellCommand<C> make(Class<C> clazz) throws IntrospectionException { return new ClassShellCommand<C>(clazz); }
private <C extends BaseCommand> ClassShellCommand<C> make(Class<C> clazz) throws IntrospectionException { return new ClassShellCommand<C>(clazz); }
private <C extends BaseCommand> CommandResolution createCommand(final Class<C> commandClass) throws CommandException { final ClassShellCommand<C> shellCommand; final String description; try { shellCommand = new ClassShellCommand<C>(commandClass); description = shellCommand.describe(commandClass.getSimpleName(), Format.DESCRIBE); } catch (IntrospectionException e) { throw new CommandException(ErrorKind.SYNTAX, "Invalid cli annotation in command " + commandClass.getSimpleName(), e); } return new CommandResolution() { @Override public String getDescription() { return description; } @Override public Command<?> getCommand() throws CommandException { return shellCommand; } }; } }
private <C extends BaseCommand> CommandResolution createCommand(final Class<C> commandClass) throws CommandException { final ClassShellCommand<C> shellCommand; final String description; try { shellCommand = new ClassShellCommand<C>(commandClass); description = shellCommand.describe(commandClass.getSimpleName(), Format.DESCRIBE); } catch (IntrospectionException e) { throw new CommandException(ErrorKind.SYNTAX, "Invalid cli annotation in command " + commandClass.getSimpleName(), e); } return new CommandResolution() { @Override public String getDescription() { return description; } @Override public Command<?> getCommand() throws CommandException { return shellCommand; } }; } }
private <C extends BaseCommand> CommandResolution createCommand(final Class<C> commandClass) throws CommandException { final ClassShellCommand<C> shellCommand; final String description; try { shellCommand = new ClassShellCommand<C>(commandClass); description = shellCommand.describe(commandClass.getSimpleName(), Format.DESCRIBE); } catch (IntrospectionException e) { throw new CommandException(ErrorKind.SYNTAX, "Invalid cli annotation in command " + commandClass.getSimpleName(), e); } return new CommandResolution() { @Override public String getDescription() { return description; } @Override public Command<?> getCommand() throws CommandException { return shellCommand; } }; } }
final ClassShellCommand command; try { command = new ClassShellCommand(clazz);
final ClassShellCommand command; try { command = new ClassShellCommand(clazz);