protected void validateArguments(Arguments args, SieveContext ctx)
throws SieveException {
List arglist = args.getArgumentList();
if (arglist.size() != 2) {
throw new SyntaxException(
"Currently body-test can only two arguments");
}
// FIXME: As this is a limited implementation force the use of
// ':contains'.
Object arg = arglist.get(0);
if (!(arg instanceof TagArgument)) {
throw new SyntaxException("Body expects a :contains tag");
}
if (!((TagArgument) arg).getTag().equals(":contains")) {
throw new SyntaxException("Body expects a :contains tag");
}
// Get list of strings to search for
arg = arglist.get(1);
if (!(arg instanceof StringListArgument)) {
throw new SyntaxException("Body expects a list of strings");
}
strings = (StringListArgument) args.getArgumentList().get(1);
}