Package org.apache.jsieve.exception

Examples of org.apache.jsieve.exception.SyntaxException


            }
            context.getCoordinate().logDiagnosticsInfo(logger);
            logger.debug(arguments);
            final String message = context.getCoordinate()
                    .addStartLineAndColumn("Found unexpected arguments.");
            throw new SyntaxException(message);
        }
    }
View Full Code Here


    protected void validateArguments(Arguments args, SieveContext ctx)
            throws SieveException {

        final List<Argument> arglist = args.getArgumentList();
        if (arglist.size() != 2) {
            throw new SyntaxException(
                    "Currently body-test can only two arguments");
        }

        // TODO: FIXME: As this is a limited implementation force the use of
        // ':contains'.
        Argument 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);
    }
View Full Code Here

                        argument = argumentsIter.next();
                        if (argument instanceof StringListArgument) {
                            List stringList = ((StringListArgument) argument)
                                    .getList();
                            if (stringList.size() != 1)
                                throw new SyntaxException(
                                        "Expecting exactly one String");
                            comparator = (String) stringList.get(0);
                        } else
                            throw new SyntaxException("Expecting a StringList");
                    }
                }
                // [MATCH-TYPE]?
                else if (null == matchType
                        && (tag.equals(IS_TAG) || tag.equals(CONTAINS_TAG) || tag
View Full Code Here

TOP

Related Classes of org.apache.jsieve.exception.SyntaxException

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.