读书人

Html标签属性语法外衣

发布时间: 2012-11-01 11:11:32 作者: rapoo

Html标签属性语法外套
CommonTemplate( http://www.commontemplate.org )的Html标签属性语法外套是项目比较重要的Feature.
如:


过滤后:
// Tag外套内容封装public final class Coat {private final String before;private final String after;public Coat(String before, String after) {this.before = before;this.after = after;}public String getBefore() {return before;}public String getAfter() {return after;}}public interface AttributeCoatHandler {// 解析器在遇到相应属性时, 回调此接口// 并将返回的Coat中的before和after内容添加到Tag两端Coat handleAttribute(String attrName, String attrValue);}// 注册指定名称空间的属性处理器TagCoatContext.registerAttributeCoatHandler(String namespace, AttributeCoatHandler handler);


希望他们能实现, 如果不行, 可能要自己写了, 先加入延迟计划中.

读书人网 >CSS

热点推荐