Package org.nutz.mvc

Examples of org.nutz.mvc.UrlMapping


      log.debugf(" - Timezone        : %s", System.getProperties().get("user.timezone"));
    }
    /*
     * 准备返回值
     */
    UrlMapping mapping;

    /*
     * 准备计时
     */
    Stopwatch sw = Stopwatch.begin();
View Full Code Here


    /*
     * @ TODO 个人建议可以将这个方法所涉及的内容转换到Loadings类或相应的组装类中,
     * 以便将本类加以隔离,使本的职责仅限于MVC整体的初使化,而不再负责UrlMapping的加载
     */
   
    UrlMapping mapping;
    /*
     * 准备 UrlMapping
     */
    mapping = createUrlMapping(config);
    if (log.isInfoEnabled())
      log.infof("Build URL mapping by %s ...", mapping.getClass().getName());

    /*
     * 创建视图工厂
     */
    ViewMaker[] makers = createViewMakers(mainModule);

    /*
     * 创建动作链工厂
     */
    ActionChainMaker maker = createChainMaker(config, mainModule);

    /*
     * 创建主模块的配置信息
     */
    ActionInfo mainInfo = Loadings.createInfo(mainModule);

    /*
     * 准备要加载的模块列表
     */
    //TODO 为什么用Set呢? 用List不是更快吗?
    Set<Class<?>> modules = Loadings.scanModules(mainModule);

    /*
     * 分析所有的子模块
     */
    for (Class<?> module : modules) {
      ActionInfo moduleInfo = Loadings.createInfo(module).mergeWith(mainInfo);
      for (Method method : module.getMethods()) {
        /*
         * public 并且声明了 @At 的函数,才是入口函数
         */
        if (!Modifier.isPublic(method.getModifiers())
          || !method.isAnnotationPresent(At.class))
          continue;
        // 增加到映射中
        ActionInfo info = Loadings.createInfo(method).mergeWith(moduleInfo);
        info.setViewMakers(makers);
        mapping.add(maker, info, config);
      }
     
      //记录pathMap
      if(null != moduleInfo.getPathMap()){
        for(Entry<String, String> en : moduleInfo.getPathMap().entrySet()){
View Full Code Here

            log.debugf(" - ContextPath     : %s", config.getServletContext().getContextPath());
        }
        /*
         * 准备返回值
         */
        UrlMapping mapping;

        /*
         * 准备计时
         */
        Stopwatch sw = Stopwatch.begin();
View Full Code Here

         */

        /*
         * 准备 UrlMapping
         */
        UrlMapping mapping = createUrlMapping(config);
        if (log.isInfoEnabled())
            log.infof("Build URL mapping by %s ...", mapping.getClass().getName());

        /*
         * 创建视图工厂
         */
        ViewMaker[] makers = createViewMakers(mainModule);

        /*
         * 创建动作链工厂
         */
        ActionChainMaker maker = createChainMaker(config, mainModule);

        /*
         * 创建主模块的配置信息
         */
        ActionInfo mainInfo = Loadings.createInfo(mainModule);

        /*
         * 准备要加载的模块列表
         */
        // TODO 为什么用Set呢? 用List不是更快吗?
        Set<Class<?>> modules = Loadings.scanModules(mainModule);

        if (modules.isEmpty())
            if (log.isWarnEnabled())
                log.warn("None module classes found!!!");

        boolean hasAtMethod = false;
        /*
         * 分析所有的子模块
         */
        for (Class<?> module : modules) {
            ActionInfo moduleInfo = Loadings.createInfo(module).mergeWith(mainInfo);
            for (Method method : module.getMethods()) {
                /*
                 * public 并且声明了 @At 的函数,才是入口函数
                 */
                if (!Modifier.isPublic(method.getModifiers())
                    || !method.isAnnotationPresent(At.class))
                    continue;
                // 增加到映射中
                ActionInfo info = Loadings.createInfo(method).mergeWith(moduleInfo);
                info.setViewMakers(makers);
                mapping.add(maker, info, config);
                hasAtMethod = true;
            }

            // 记录pathMap
            if (null != moduleInfo.getPathMap()) {
View Full Code Here

              log.debugf(" - ContextPath     : %s", config.getServletContext().getContextPath());
        }
        /*
         * 准备返回值
         */
        UrlMapping mapping;

        /*
         * 准备计时
         */
        Stopwatch sw = Stopwatch.begin();
View Full Code Here

         */

        /*
         * 准备 UrlMapping
         */
        UrlMapping mapping = createUrlMapping(config);
        if (log.isInfoEnabled())
            log.infof("Build URL mapping by %s ...", mapping.getClass().getName());

        /*
         * 创建视图工厂
         */
        ViewMaker[] makers = createViewMakers(mainModule, ioc);

        /*
         * 创建动作链工厂
         */
        ActionChainMaker maker = createChainMaker(config, mainModule);

        /*
         * 创建主模块的配置信息
         */
        ActionInfo mainInfo = Loadings.createInfo(mainModule);

        /*
         * 准备要加载的模块列表
         */
        // TODO 为什么用Set呢? 用List不是更快吗?
        Set<Class<?>> modules = Loadings.scanModules(mainModule);

        if (modules.isEmpty()) {
            if (log.isWarnEnabled())
                log.warn("None module classes found!!!");
        }

        int atMethods = 0;
        /*
         * 分析所有的子模块
         */
        for (Class<?> module : modules) {
            ActionInfo moduleInfo = Loadings.createInfo(module).mergeWith(mainInfo);
            for (Method method : module.getMethods()) {
                /*
                 * public 并且声明了 @At 的函数,才是入口函数
                 */
                if (!Modifier.isPublic(method.getModifiers())
                    || !method.isAnnotationPresent(At.class))
                    continue;
                // 增加到映射中
                ActionInfo info = Loadings.createInfo(method).mergeWith(moduleInfo);
                info.setViewMakers(makers);
                mapping.add(maker, info, config);
                atMethods ++;
            }

            // 记录pathMap
            if (null != moduleInfo.getPathMap()) {
View Full Code Here

TOP

Related Classes of org.nutz.mvc.UrlMapping

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.