Package org.mojavemvc.exception

Examples of org.mojavemvc.exception.ConfigurationException


                String message = "interceptor " + interceptor.getName() + " has already been declared";
                if (method != null) {
                    message += " in " + method.getName();
                }
                message += " in " + controllerClass.getName();
                throw new ConfigurationException(message);
            }

            addMethodsForInterceptor(interceptor);

            foundInterceptors.add(interceptor);
View Full Code Here


            ActionSignature before = interceptorClassToBeforeActionMap.get(interceptorClass);
            ActionSignature after = interceptorClassToAfterActionMap.get(interceptorClass);

            if (before == null && after == null) {

                throw new ConfigurationException("interceptor " + interceptorClass.getName()
                        + " must have at least a @" + BeforeAction.class.getSimpleName() + " or a @"
                        + AfterAction.class.getSimpleName());
            }
        }
    }
View Full Code Here

       
        if (method.getParameterTypes().length > 0) {
            if (method.getParameterTypes().length != 1 ||
                    !(method.getParameterTypes()[0].equals(RequestContext.class))) {
               
                throw new ConfigurationException("a @" + annotationClass.getSimpleName()
                        + " method cannot take arguments in " + clazz.getName());
            }
        }
    }
View Full Code Here

    private void validateMethodDoesNotAcceptArguments(Class<?> annotationClass,
            Class<?> controllerClass, Method method) {
       
        if (method.getParameterTypes().length > 0) {
            throw new ConfigurationException("a @" + annotationClass.getSimpleName()
                    + " method cannot take arguments in " + controllerClass.getName());
        }
    }
View Full Code Here

    private void validateActionOccursOnlyOnce(Map<Class<?>, ActionSignature> map, Class<?> annotationClass,
            Class<?> controllerClass) {
       
        ActionSignature m = map.get(controllerClass);
        if (m != null) {
            throw new ConfigurationException("there can be only one @" + annotationClass.getSimpleName()
                    + " method in " + controllerClass.getName());
        }
    }
View Full Code Here

    private Set<Class<?>> scanControllerClasses() {

        List<String> packages = getControllerPackages();
        Set<Class<?>> controllers = scanner.scanControllers(packages);
        if (controllers == null || controllers.isEmpty()) {
            throw new ConfigurationException("there must be at least one " +
                    "controller in the application");
        }
        return controllers;
    }
View Full Code Here

TOP

Related Classes of org.mojavemvc.exception.ConfigurationException

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.