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

📄 basicrule.java

📁 OS(OpenSymphony)的SiteMesh是一个用来在JSP中实现页面布局和装饰(layout and decoration)的框架组件
💻 JAVA
字号:
package com.opensymphony.module.sitemesh.html;import com.opensymphony.module.sitemesh.html.util.CharArray;public abstract class BasicRule implements TagRule {    private final String[] acceptableTagNames;    protected HTMLProcessorContext context;    protected BasicRule(String[] acceptableTagNames) {        this.acceptableTagNames = acceptableTagNames;    }    protected BasicRule(String acceptableTagName) {        this.acceptableTagNames = new String[] {acceptableTagName};    }    protected BasicRule() {        this.acceptableTagNames = null;    }    public void setContext(HTMLProcessorContext context) {        this.context = context;    }    public boolean shouldProcess(String name) {        if (acceptableTagNames == null || acceptableTagNames.length < 1) {            throw new UnsupportedOperationException(getClass().getName()                    + " should be constructed with acceptableTagNames OR should implement shouldProcess()");        }        for (int i=0; i<acceptableTagNames.length; i++) {            if (name.equals(acceptableTagNames[i])) return true;        }        return false;    }    public abstract void process(Tag tag);    protected CharArray currentBuffer() {        return context.currentBuffer();    }}

⌨️ 快捷键说明

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