Package com.sk89q.intake.parametric

Examples of com.sk89q.intake.parametric.MissingParameterException


    @Override
    public String next() throws ParameterException {
        try {
            return context.getString(index++);
        } catch (IndexOutOfBoundsException e) {
            throw new MissingParameterException();
        }
    }
View Full Code Here


    @Override
    public Boolean nextBoolean() throws ParameterException {
        try {
            return next().equalsIgnoreCase("true");
        } catch (IndexOutOfBoundsException e) {
            throw new MissingParameterException();
        }
    }
View Full Code Here

        try {
            String value = context.getJoinedStrings(index);
            index = context.argsLength();
            return value;
        } catch (IndexOutOfBoundsException e) {
            throw new MissingParameterException();
        }
    }
View Full Code Here

    @Override
    public String next() throws ParameterException {
        try {
            return arguments[index++];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new MissingParameterException();
        }
    }
View Full Code Here

        } catch (IndexOutOfBoundsException e) {
            if (nonNullBoolean) { // Special case
                return false;
            }
           
            throw new MissingParameterException();
        }
    }
View Full Code Here

        try {
            String value = StringUtils.joinString(arguments, " ", index);
            markConsumed();
            return value;
        } catch (IndexOutOfBoundsException e) {
            throw new MissingParameterException();
        }
    }
View Full Code Here

    public boolean preInvoke(Object object, Method method, ParameterData[] parameters, Object[] args, CommandContext context, CommandLocals locals) throws ParameterException {
        Command annotation = method.getAnnotation(Command.class);
       
        if (annotation != null) {
            if (context.argsLength() < annotation.min()) {
                throw new MissingParameterException();
            }
   
            if (annotation.max() != -1 && context.argsLength() > annotation.max()) {
                throw new UnconsumedParameterException(context.getRemainingString(annotation.max()));
            }
View Full Code Here

TOP

Related Classes of com.sk89q.intake.parametric.MissingParameterException

Copyright © 2018 www.massapicom. 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.