summaryrefslogtreecommitdiff
path: root/java/src/main
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2018-09-06 08:57:51 -0400
committerPaul Duncan <pabs@pablotron.org>2018-09-06 08:57:51 -0400
commit2be7535e09e359d70b924013c9f4d25149fdf0ae (patch)
tree912223b1090cecc627c3ef7e845f4296acb88c51 /java/src/main
parentf422534cd4cf1ba32523c9fc798c207065038ca5 (diff)
downloadluigi-template-2be7535e09e359d70b924013c9f4d25149fdf0ae.tar.bz2
luigi-template-2be7535e09e359d70b924013c9f4d25149fdf0ae.zip
java: add src/main/java/org/pablotron/luigi/ResultHandler.java, update tests
Diffstat (limited to 'java/src/main')
-rw-r--r--java/src/main/java/org/pablotron/luigi/ResultHandler.java5
-rw-r--r--java/src/main/java/org/pablotron/luigi/Template.java9
2 files changed, 14 insertions, 0 deletions
diff --git a/java/src/main/java/org/pablotron/luigi/ResultHandler.java b/java/src/main/java/org/pablotron/luigi/ResultHandler.java
new file mode 100644
index 0000000..32690a2
--- /dev/null
+++ b/java/src/main/java/org/pablotron/luigi/ResultHandler.java
@@ -0,0 +1,5 @@
+package org.pablotron.luigi;
+
+public interface ResultHandler {
+ public abstract void append(final String s);
+};
diff --git a/java/src/main/java/org/pablotron/luigi/Template.java b/java/src/main/java/org/pablotron/luigi/Template.java
index 2b17a54..9af3a74 100644
--- a/java/src/main/java/org/pablotron/luigi/Template.java
+++ b/java/src/main/java/org/pablotron/luigi/Template.java
@@ -35,6 +35,15 @@ public final class Template {
return r.toString();
}
+ public void run(
+ final Map<String, String> args,
+ final ResultHandler r
+ ) throws LuigiError {
+ for (Action a: this.actions) {
+ r.append(a.run(this.filters, args));
+ }
+ }
+
public String toString() {
return this.template;
}