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

📄 msofficedocumentpropertiesrule.java

📁 OS(OpenSymphony)的SiteMesh是一个用来在JSP中实现页面布局和装饰(layout and decoration)的框架组件
💻 JAVA
字号:
package com.opensymphony.module.sitemesh.html.rules;import com.opensymphony.module.sitemesh.html.BlockExtractingRule;import com.opensymphony.module.sitemesh.html.Tag;/** * Extracts the extra properties saved in HTML from MS Office applications (Word and Excel), * such as Author, Company, Version, etc. * * @author Joe Walnes */public class MSOfficeDocumentPropertiesRule extends BlockExtractingRule {    private final PageBuilder page;    private boolean inDocumentProperties;    public MSOfficeDocumentPropertiesRule(PageBuilder page) {        super(true);        this.page = page;    }    public boolean shouldProcess(String name) {        return (inDocumentProperties && name.startsWith("o:")) || name.equals("o:documentproperties");    }    public void process(Tag tag) {        if (tag.getName().equals("o:DocumentProperties")) {            inDocumentProperties = (tag.getType() == Tag.OPEN);            tag.writeTo(currentBuffer());        } else {            super.process(tag);        }    }    protected void start(Tag tag) {    }    protected void end(Tag tag) {        String name = tag.getName().substring(2);        page.addProperty("office.DocumentProperties." + name, currentBuffer().toString());        context.mergeBuffer();    }}

⌨️ 快捷键说明

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