Package com.bastengao.struts2.freeroute

Examples of com.bastengao.struts2.freeroute.ControllerPackageProvider


        Method[] methods = controller.getMethods();
        if (methods == null) {
            return routes;
        }

        ContentBase contentBase = ReflectUtil.getAnnotation(controller, ContentBase.class);
        Route controllerRoute = ReflectUtil.getAnnotation(controller, Route.class);
        for (Method method : methods) {
            //查看是否有 @Route 注解, 如果有则加到路由列表中
            if (method.isAnnotationPresent(Route.class)) {
                Route methodRoute = method.getAnnotation(Route.class);
View Full Code Here


        Method[] methods = controller.getMethods();
        if (methods == null) {
            return routes;
        }

        ContentBase contentBase = ReflectUtil.getAnnotation(controller, ContentBase.class);
        Route controllerRoute = ReflectUtil.getAnnotation(controller, Route.class);
        for (Method method : methods) {
            //查看是否有 @Route 注解, 如果有则加到路由列表中
            if (method.isAnnotationPresent(Route.class)) {
                Route methodRoute = method.getAnnotation(Route.class);
View Full Code Here

        Method[] methods = controller.getMethods();
        if (methods == null) {
            return routes;
        }

        ContentBase contentBase = ReflectUtil.getAnnotation(controller, ContentBase.class);
        Route controllerRoute = ReflectUtil.getAnnotation(controller, Route.class);
        for (Method method : methods) {
            //查看是否有 @Route 注解, 如果有则加到路由列表中
            if (method.isAnnotationPresent(Route.class)) {
                Route methodRoute = method.getAnnotation(Route.class);
View Full Code Here

        Method[] methods = controller.getMethods();
        if (methods == null) {
            return routes;
        }

        ContentBase contentBase = ReflectUtil.getAnnotation(controller, ContentBase.class);
        Route controllerRoute = ReflectUtil.getAnnotation(controller, Route.class);
        for (Method method : methods) {
            //查看是否有 @Route 注解, 如果有则加到路由列表中
            if (method.isAnnotationPresent(Route.class)) {
                Route methodRoute = method.getAnnotation(Route.class);
View Full Code Here

     * @param controllerClass
     * @return
     * @since 1.0.2
     */
    private PackageConfig findParentPackage(Class<?> controllerClass) {
        ControllerPackage pkg = ReflectUtil.getAnnotation(controllerClass, ControllerPackage.class);
        // 父包
        PackageConfig parentPackage = null;
        if (pkg == null) {
            parentPackage = this.defaultParentPackage();

            if(parentPackage == null){
                throw new IllegalStateException("defaultParentPackage not found: " + this.defaultParentPackage);
            }
        } else {
            parentPackage = this.configuration.getPackageConfig(pkg.parent());
        }
        return parentPackage;
    }
View Full Code Here

     * @param controllerClass
     * @return
     * @since 1.0.2
     */
    private PackageConfig findParentPackage(Class<?> controllerClass) {
        ControllerPackage pkg = ReflectUtil.getAnnotation(controllerClass, ControllerPackage.class);
        // 父包
        PackageConfig parentPackage = null;
        if (pkg == null) {
            parentPackage = this.defaultParentPackage();
        } else {
            parentPackage = this.configuration.getPackageConfig(pkg.parent());
        }
        return parentPackage;
    }
View Full Code Here

     */
    private void initCookieValues() {
        cookieValues = new HashMap<CookieValue, Field>();
        for (Field field : action.getDeclaredFields()) {
            if (ReflectUtil.isAnnotationPresentOfField(field, CookieValue.class)) {
                CookieValue cookieValue = ReflectUtil.getAnnotationOfField(field, CookieValue.class);
                cookieValues.put(cookieValue, field);
            }
        }
        cookieValues = Collections.unmodifiableMap(cookieValues);
    }
View Full Code Here

     */
    private void initCookieValues() {
        cookieValues = new HashMap<CookieValue, Field>();
        for (Field field : action.getDeclaredFields()) {
            if (ReflectUtil.isAnnotationPresentOfField(field, CookieValue.class)) {
                CookieValue cookieValue = ReflectUtil.getAnnotationOfField(field, CookieValue.class);
                cookieValues.put(cookieValue, field);
            }
        }
        cookieValues = Collections.unmodifiableMap(cookieValues);
    }
View Full Code Here

     */
    private void initCookieValues() {
        cookieValues = new HashMap<CookieValue, Field>();
        for (Field field : action.getDeclaredFields()) {
            if (ReflectUtil.isAnnotationPresentOfField(field, CookieValue.class)) {
                CookieValue cookieValue = ReflectUtil.getAnnotationOfField(field, CookieValue.class);
                cookieValues.put(cookieValue, field);
            }
        }
        cookieValues = Collections.unmodifiableMap(cookieValues);
    }
View Full Code Here

    static int weightOfMethod(HttpServletRequest request, RouteMapping routeMapping) {
        if (routeMapping.getHttpMethods().size() == 0) {
            return 1000;
        }

        MethodType methodType = RouteUtil.valueOfMethod(request.getMethod());
        if (methodType == null) {
            return -1;
        }

        for (MethodType m : routeMapping.getHttpMethods()) {
View Full Code Here

TOP

Related Classes of com.bastengao.struts2.freeroute.ControllerPackageProvider

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.