Changeset 1737
- Timestamp:
- 2010-10-12 09:44:15 (3 years ago)
- Location:
- trunk/universe/kauri-template/src
- Files:
-
- 3 added
- 2 edited
-
main/java/org/kauriproject/template/el/JsonFunctions.java (added)
-
main/java/org/kauriproject/template/el/TemplateFunctionMapper.java (modified) (2 diffs)
-
test/java/org/kauriproject/template/TemplateExecutionTest.java (modified) (2 diffs)
-
test/resources/org/kauriproject/template/jsonvariables.xml (added)
-
test/resources/org/kauriproject/template/jsonvariables_result.xml (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/el/TemplateFunctionMapper.java
r1549 r1737 29 29 addDateFunctions(); 30 30 addStringFunctions(); 31 addJsonFunctions(); 31 32 // by doing this last, registered functions may override functions loaded above. 32 33 addRegisteredFunctions(functionRegistry); … … 73 74 } 74 75 } 76 77 private void addJsonFunctions() { 78 String prefix = "json"; 79 Method[] methods = JsonFunctions.class.getDeclaredMethods(); 80 for (Method method : methods) { 81 addFunction(prefix, method.getName(), method); 82 } 83 } 75 84 76 85 private void addRegisteredFunctions(FunctionRegistry functionRegistry) { -
trunk/universe/kauri-template/src/test/java/org/kauriproject/template/TemplateExecutionTest.java
r1688 r1737 26 26 import org.kauriproject.xml.sax.Saxable; 27 27 import org.w3c.dom.Document; 28 import org.xml.sax.ContentHandler; 29 import org.xml.sax.SAXException; 28 30 import org.xml.sax.helpers.AttributesImpl; 29 import org.xml.sax.SAXException;30 import org.xml.sax.ContentHandler;31 31 32 32 public class TemplateExecutionTest extends TemplateTestBase { … … 189 189 testFlow("/org/kauriproject/template/xmlvariables.xml", variables, true); 190 190 } 191 192 public void testJsonVariables() throws Exception { 193 testFlow("/org/kauriproject/template/jsonvariables.xml", true); 194 } 191 195 }
Note: See TracChangeset
for help on using the changeset viewer.