| package com.matrix.system.common.tag; | 
|   | 
| import org.thymeleaf.dialect.AbstractProcessorDialect; | 
| import org.thymeleaf.processor.IProcessor; | 
| import org.thymeleaf.standard.StandardDialect; | 
| import org.thymeleaf.standard.processor.StandardXmlNsTagProcessor; | 
| import org.thymeleaf.templatemode.TemplateMode; | 
|   | 
| import java.util.HashSet; | 
| import java.util.Set; | 
|   | 
| /** | 
|  * thymeleaf自定义标签 | 
|  *  | 
|  * @author jiangyouyao | 
|  * @email 512061637@qq.com | 
|  * @date 2019年1月12日 | 
|  */ | 
| public class MatrixProcessorDialect extends AbstractProcessorDialect { | 
|   | 
|     /** | 
|      * 标签名 | 
|      */ | 
|     private static final String DIALECT_NAME = "Matrix Dialect"; | 
|   | 
|     /** | 
|      * 标签前缀 | 
|      */ | 
|     private static final String DIALECT_PREFIX = "matrix"; | 
|   | 
|     public MatrixProcessorDialect() { | 
|         // We will set this dialect the same "dialect processor" precedence as | 
|         // the Standard Dialect, so that processor executions can interleave. | 
|         super(DIALECT_NAME, DIALECT_PREFIX, StandardDialect.PROCESSOR_PRECEDENCE); | 
|     } | 
|   | 
|     /** | 
|      * 将btn按钮标签属性加入到本方言中 | 
|      *  | 
|      * @author jiangyouyao | 
|      * @email 512061637@qq.com | 
|      * @date 2019年1月12日 | 
|      * @param dialectPrefix | 
|      * @return | 
|      */ | 
|     @Override | 
|     public Set<IProcessor> getProcessors(final String dialectPrefix) { | 
|         final Set<IProcessor> processors = new HashSet<IProcessor>(); | 
|         processors.add(new ButtonRoleAttributeTagProcessor(dialectPrefix)); | 
|         processors.add(new ButtonRoleFnTagProcessor(dialectPrefix)); | 
|         // This will remove the xmlns:matrix attributes we might add for IDE validation | 
|         processors.add(new StandardXmlNsTagProcessor(TemplateMode.HTML, dialectPrefix)); | 
|         return processors; | 
|     } | 
| } |