TMP
authorKai Moritz <kai@juplo.de>
Wed, 24 Apr 2019 14:43:01 +0000 (16:43 +0200)
committerKai Moritz <kai@juplo.de>
Wed, 24 Apr 2019 14:43:01 +0000 (16:43 +0200)
pom.xml
src/main/java/de/juplo/thymeleaf/ActiveAttrProcessor.java
src/main/java/de/juplo/thymeleaf/ImportVariablesAttrProcessor.java
src/main/java/de/juplo/thymeleaf/JuploDialect.java

diff --git a/pom.xml b/pom.xml
index c6158b9..c83d646 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       <version>${simple-mapper.version}</version>
     </dependency>
 
+    <!-- JPA -->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+    </dependency>
+
     <!-- Testing -->
     <dependency>
       <groupId>junit</groupId>
index 7392bf9..a07241e 100644 (file)
@@ -6,7 +6,7 @@ package de.juplo.thymeleaf;
  * marked as active.
  * @author Kai Moritz
  */
-public class ActiveAttrProcessor extends AbstractSubstituteAttrrocessor
+public class ActiveAttrProcessor extends AbstractSubstituteAttrProcessor
 {
   public ActiveAttrProcessor(final String prefix)
   {
index aac37a6..e063a0c 100644 (file)
@@ -15,20 +15,13 @@ import java.util.regex.Matcher;
 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;
 
@@ -39,7 +32,7 @@ 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);
@@ -55,9 +48,22 @@ public class ImportVariablesAttrProcessor extends AbstractAttrProcessor
   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
+        );
   }
 
 
index 21cf8ac..d97953b 100644 (file)
@@ -39,8 +39,8 @@ public class JuploDialect extends AbstractProcessorDialect
   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;
   }