Package org.apache.jsieve.exception

Examples of org.apache.jsieve.exception.SyntaxException


                log.warn(message);
            }
            logDiagnosticsInfo(log);
        }
        final String fullMessage = addStartLineAndColumn(message);
        final SyntaxException result = new SyntaxException(fullMessage);
        return result;
    }
View Full Code Here


                log.warn(message);
            }
            logDiagnosticsInfo(log);
        }
        final String fullMessage = addStartLineAndColumn(message);
        final SyntaxException result = new SyntaxException(fullMessage);
        return result;
    }
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

            }
            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 {

        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);
    }
View Full Code Here

        if (logger.isWarnEnabled()) {
            logger.warn(message);
        }
        logDiagnosticsInfo(logger);
        final String fullMessage = addStartLineAndColumn(message);
        final SyntaxException result = new SyntaxException(fullMessage);
        return result;
    }
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

            }
            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 {

        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);
    }
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.