use of org.apache.jsieve.exception.SyntaxException in project zm-mailbox by Zimbra.
the class DummyCustomTag method validateArguments.
@Override
protected void validateArguments(Arguments arguments, SieveContext context) throws SieveException {
@SuppressWarnings("unchecked") List<Argument> args = arguments.getArgumentList();
if (args.size() != 1)
throw new SyntaxException("Exactly 1 argument permitted. Found " + args.size());
Object argument = args.get(0);
if (!(argument instanceof StringListArgument))
throw new SyntaxException("Expecting a string-list");
if (1 != ((StringListArgument) argument).getList().size())
throw new SyntaxException("Expecting exactly one argument");
}
Aggregations