Package org.apache.jsieve.exception

Examples of org.apache.jsieve.exception.SieveException


            {
                dispatcher.execute(action, getMail(), this);
            }
            catch (MessagingException e)
            {
                throw new SieveException(e);
            }
        }
    }
View Full Code Here


        commandManager.getCommand(name);
        if ("require".equalsIgnoreCase(name)) {
            if (requireAllowed) {
                isInRequire = true;
            } else {
                throw new SieveException(
                        "'require' is only allowed before other commands");
            }
        } else {
            requireAllowed = false;
            isInRequire = false;
View Full Code Here

            final String name = (String) value;
            // Comparators must either be declared (either implicitly or explicitly)
            if (!comparatorManager.isImplicitlyDeclared(name)) {
                if (!declaredComparators.contains(name)) {
                    // TODO: replace with better exception
                    throw new SieveException("Comparator must be explicitly declared in a require statement.");
                }
            }
        }
    }
View Full Code Here

                final String comparatorName = name.substring(COMPARATOR_PREFIX_LENGTH);
                if (comparatorManager.isSupported(comparatorName)) {
                    declaredComparators.add(comparatorName);
                } else {
//                  TODO: Replace with more finely grained exception
                    throw new SieveException("Comparator " + comparatorName + " is not supported");
                }
            } else {
                try {
                    commandManager.getCommand(name);
                } catch (LookupException e) {
View Full Code Here

     * @see SieveParserVisitor#visit(ASTstart, Object)
     */
    public Object visit(ASTstart node, Object data) throws SieveException {
        // The data object must be the MailAdapter to process
        if (!(data instanceof MailAdapter))
            throw new SieveException("Expecting an instance of "
                    + MailAdapter.class.getName()
                    + " as data, received an instance of "
                    + (data == null ? "<null>" : data.getClass().getName())
                    + ".");

View Full Code Here

            getMailetContext().log("Executing action: " + action.toString());
            try {
                ActionDispatcher.getInstance().execute(action, getMail(),
                        getMailetContext());
            } catch (NoSuchMethodException e) {
                throw new SieveException(e.getMessage());
            } catch (IllegalAccessException e) {
                throw new SieveException(e.getMessage());
            } catch (InvocationTargetException e) {
                throw new SieveException(e.getMessage());
            } catch (MessagingException e) {
                throw new SieveException(e.getMessage());
            }
        }
    }
View Full Code Here

     * @see SieveParserVisitor#visit(ASTstart, Object)
     */
    public Object visit(ASTstart node, Object data) throws SieveException {
        // The data object must be the MailAdapter to process
        if (!(data instanceof MailAdapter))
            throw new SieveException("Expecting an instance of "
                    + MailAdapter.class.getName()
                    + " as data, received an instance of "
                    + (data == null ? "<null>" : data.getClass().getName())
                    + ".");

View Full Code Here

        commandManager.getCommand(name);
        if ("require".equalsIgnoreCase(name)) {
            if (requireAllowed) {
                isInRequire = true;
            } else {
                throw new SieveException(
                        "'require' is only allowed before other commands");
            }
        } else {
            requireAllowed = false;
            isInRequire = false;
View Full Code Here

     * @see SieveParserVisitor#visit(ASTstart, Object)
     */
    public Object visit(ASTstart node, Object data) throws SieveException {
        // The data object must be the MailAdapter to process
        if (!(data instanceof MailAdapter))
            throw new SieveException("Expecting an instance of "
                    + MailAdapter.class.getName()
                    + " as data, received an instance of "
                    + (data == null ? "<null>" : data.getClass().getName())
                    + ".");

View Full Code Here

        Command.lookup(name);
        if ("require".equalsIgnoreCase(name)) {
            if (requireAllowed) {
                isInRequire = true;
            } else {
                throw new SieveException("'require' is only allowed before other commands");
            }
        } else {
            requireAllowed = false;
            isInRequire = false;
        }
View Full Code Here

TOP

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

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.