blockextractingrule.java

来自「一个jsp网页布局框架」· Java 代码 · 共 45 行

JAVA
45
字号
package com.opensymphony.module.sitemesh.html;import com.opensymphony.module.sitemesh.html.util.CharArray;public abstract class BlockExtractingRule extends BasicRule {    private boolean includeEnclosingTags;    protected BlockExtractingRule(boolean includeEnclosingTags, String acceptableTagName) {        super(acceptableTagName);        this.includeEnclosingTags = includeEnclosingTags;    }    protected BlockExtractingRule(boolean includeEnclosingTags) {        this.includeEnclosingTags = includeEnclosingTags;    }    public void process(Tag tag) {        if (tag.getType() == Tag.OPEN) {            if (includeEnclosingTags) {                tag.writeTo(context.currentBuffer());            }            context.pushBuffer(createBuffer());            start(tag);        } else if (tag.getType() == Tag.CLOSE) {            end(tag);            context.popBuffer();            if (includeEnclosingTags) {                tag.writeTo(context.currentBuffer());            }        }    }    protected void start(Tag tag) {    }    protected void end(Tag tag) {    }    protected CharArray createBuffer() {        return new CharArray(512);    }}

⌨️ 快捷键说明

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