protected void validateSingleStringArguments()

in core/src/main/java/org/apache/jsieve/commands/AbstractActionCommand.java [87:102]


    protected void validateSingleStringArguments(Arguments arguments,
            SieveContext context) throws SieveException {
        List<Argument> args = arguments.getArgumentList();
        if (args.size() != 1)
            throw context.getCoordinate().syntaxException(
                    "Exactly 1 argument permitted. Found " + args.size());

        Argument argument = args.get(0);
        if (!(argument instanceof StringListArgument))
            throw context.getCoordinate().syntaxException(
                    "Expecting a string-list");

        if (1 != ((StringListArgument) argument).getList().size())
            throw context.getCoordinate().syntaxException(
                    "Expecting exactly one argument");
    }