源码有毒:Jfinal源码解析(二)

本文深入剖析Jfinal的源码,从Controller的add方法开始,探讨Map集合的存储机制。接着关注jfinalConfig.configPlugin()中对项目插件的配置,分析Plugins类如何封装List的add方法,并着重讲解IPlugin接口。同时,文章还介绍了插件的启动过程,通过startPlugins()方法逐一启动。最后提到了全局拦截器的配置方法jfinalConfig.configInterceptor()。
摘要由CSDN通过智能技术生成
public Routes add(String controllerKey, Class<? extends Controller> controllerClass, String viewPath) {
   
        if (controllerKey == null)
            throw new IllegalArgumentException("The controllerKey can not be null");
        // if (controllerKey.indexOf(".") != -1)
            // throw new IllegalArgumentException("The controllerKey can not contain dot character: \".\"");
        controllerKey = controllerKey.trim();
        if ("".equals(controllerKey))
            throw new IllegalArgumentException("The controllerKey can not be blank");
        if (controllerClass == null)
            throw new IllegalArgumentException("The controllerClass can not be null");
        if (!controllerKey.startsWith("/"))
            controllerKey = "/" + controllerKey;
        if (map.containsKey(controllerKey))
            throw 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值