[Dive4elements-commits] [PATCH 3 of 4] pass BuildHelper to Function Resolver

Wald Commits scm-commit at wald.intevation.org
Tue Mar 26 16:29:25 CET 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1364311447 -3600
# Node ID d0f5bc8064f17d43484f004e913ef9bbf1fec40c
# Parent  2fe120e1e4dfb466c7cd4758de762777b4090f02
pass BuildHelper to Function Resolver.

diff -r 2fe120e1e4df -r d0f5bc8064f1 flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Tue Mar 26 16:19:10 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java	Tue Mar 26 16:24:07 2013 +0100
@@ -543,7 +543,7 @@
             try {
                 XPath xpath = XPATH_FACTORY.newXPath();
                 xpath.setXPathVariableResolver(frames);
-                xpath.setXPathFunctionResolver(FunctionResolver.FUNCTIONS);
+                xpath.setXPathFunctionResolver(new FunctionResolver(this));
                 return xpath.evaluate(expr, EVAL_DOCUMENT, returnType);
             }
             catch (XPathExpressionException xpee) {
diff -r 2fe120e1e4df -r d0f5bc8064f1 flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java	Tue Mar 26 16:19:10 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/FunctionResolver.java	Tue Mar 26 16:24:07 2013 +0100
@@ -42,10 +42,16 @@
     /** List of functions. */
     protected List<Entry> functions;
 
-    public static final FunctionResolver FUNCTIONS = new FunctionResolver();
+    protected Builder.BuildHelper buildHelper;
 
 
     public FunctionResolver() {
+        this(null);
+    }
+
+    public FunctionResolver(Builder.BuildHelper buildHelper) {
+        this.buildHelper = buildHelper;
+
         functions = new ArrayList<Entry>();
 
         addFunction("contains", 2, new XPathFunction() {


More information about the Dive4elements-commits mailing list