import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.thymeleaf.Arguments;
-import org.thymeleaf.Configuration;
-import org.thymeleaf.TemplateProcessingParameters;
import org.thymeleaf.context.IContext;
-import org.thymeleaf.context.VariablesMap;
-import org.thymeleaf.dom.Element;
-import org.thymeleaf.dom.Node;
import org.thymeleaf.exceptions.TemplateProcessingException;
-import org.thymeleaf.processor.ProcessorResult;
-import org.thymeleaf.processor.attr.AbstractAttrProcessor;
-import org.thymeleaf.resourceresolver.IResourceResolver;
+import org.thymeleaf.processor.element.AbstractAttributeModelProcessor;
import org.thymeleaf.standard.expression.IStandardExpression;
import org.thymeleaf.standard.expression.IStandardExpressionParser;
import org.thymeleaf.standard.expression.StandardExpressions;
+import org.thymeleaf.templatemode.TemplateMode;
import org.thymeleaf.templateresolver.ITemplateResolver;
import org.thymeleaf.templateresolver.TemplateResolution;
* variables.
* @author Kai Moritz
*/
-public class ImportVariablesAttrProcessor extends AbstractAttrProcessor
+public class ImportVariablesAttrProcessor extends AbstractAttributeModelProcessor
{
private static final Logger LOG =
LoggerFactory.getLogger(ImportVariablesAttrProcessor.class);
public static final int ATTR_PRECEDENCE = 200;
- public ImportVariablesAttrProcessor()
+ public ImportVariablesAttrProcessor(
+ final String prefix,
+ final String attribute,
+ final String substitute
+ )
{
- super("variables");
+ super(
+ TemplateMode.HTML,
+ prefix,
+ null,
+ false,
+ attribute,
+ true,
+ ATTR_PRECEDENCE,
+ false
+ );
}
public Set<IProcessor> getProcessors(String prefix)
{
final Set<IProcessor> processors = new HashSet<>();
- processors.add(new ActiveAttributeProcessor(prefix));
- processors.add(new InactiveAttributeProcessor(prefix));
+ processors.add(new ActiveAttrProcessor(prefix));
+ processors.add(new InactiveAttrProcessor(prefix));
processors.add(new ImportVariablesAttrProcessor());
return processors;
}