⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reskeyexception.java

📁 云网论坛CWBBS 源码,内容丰富,学习,参考,教学的好资料,具体见内说明,
💻 JAVA
字号:
package cn.js.fan.util;

import cn.js.fan.base.ISkin;
import javax.servlet.http.HttpServletRequest;
import cn.js.fan.web.SkinUtil;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class ResKeyException extends Exception{
    public ResKeyException(ISkin iSkin, String key) {
        this.iSkin = iSkin;
        this.key = key;
    }

    public ResKeyException(String res, String key) {
        this.res = res;
        this.key = key;
    }

    public ResKeyException(String res, String key, Object[] args) {
        this.res = res;
        this.key = key;
        this.args = args;
    }

    public ResKeyException(String key) {
        this.key = key;
    }

    public String getMessage() {
        return "Error key= " + key;
    }

    public String getMessage(HttpServletRequest request) {
        if (res!=null) {
            if (args==null)
                return SkinUtil.LoadString(request, res, key);
            else {
                String str = SkinUtil.LoadString(request, res, key);
                return StrUtil.format(str, args);
            }
        }
        else if (iSkin!=null)
            return iSkin.LoadStr(request, key);
        else
            return SkinUtil.LoadString(request, key);
    }

    public void setISkin(ISkin iSkin) {
        this.iSkin = iSkin;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public void setRes(String res) {
        this.res = res;
    }

    public ISkin getISkin() {
        return iSkin;
    }

    public String getKey() {
        return key;
    }

    public String getRes() {
        return res;
    }

    private ISkin iSkin;
    private String key;
    private String res;
    private Object[] args;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -