Add parameter to get the name of the parameter from the data provider.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 09:57:20 +0000 (11:57 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 22 Oct 2010 09:57:20 +0000 (11:57 +0200)
src/main/java/net/pterodactylus/sone/template/RequestChangeFilter.java

index d9c453e..bd35fa4 100644 (file)
@@ -47,6 +47,10 @@ public class RequestChangeFilter implements Filter {
        public Object format(DataProvider dataProvider, Object data, Map<String, String> parameters) {
                Request request = (Request) data;
                String name = parameters.get("name");
+               String nameKey = parameters.get("nameKey");
+               if (nameKey != null) {
+                       name = String.valueOf(dataProvider.getData(nameKey));
+               }
                String key = parameters.get("key");
                String value = null;
                if (key != null) {