Changeset 1346 for trunk/universe/kauri-template/src/main/java/org/kauriproject/template/el/TemplateFunctionMapper.java
- Timestamp:
- 2009-07-02 15:06:52 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/universe/kauri-template/src/main/java/org/kauriproject/template/el/TemplateFunctionMapper.java
r1020 r1346 16 16 package org.kauriproject.template.el; 17 17 18 import org.apache.commons.logging.Log; 19 import org.apache.commons.logging.LogFactory; 18 import org.kauriproject.template.TemplateException; 20 19 21 20 import javax.el.FunctionMapper; … … 26 25 public class TemplateFunctionMapper extends FunctionMapper { 27 26 private Map<String, Method> functions = new HashMap<String, Method>(); 28 private Log log = LogFactory.getLog(getClass());29 27 30 28 public TemplateFunctionMapper(FunctionRegistry functionRegistry) { … … 52 50 addFunction(prefix, "max", Math.class.getMethod("max", double.class, double.class)); 53 51 addFunction(prefix, "min", Math.class.getMethod("min", double.class, double.class)); 54 // add additional math functions55 Method[] methods = MathFunctions.class.getDeclaredMethods();56 for (Method method : methods) {57 addFunction(prefix, method.getName(), method);58 }59 52 } catch (NoSuchMethodException nex) { 60 log.error("Error adding math functions to the EL: " + nex); 53 throw new TemplateException("Error registering math functions with EL", nex); 54 } 55 56 // add additional math functions 57 Method[] methods = MathFunctions.class.getDeclaredMethods(); 58 for (Method method : methods) { 59 addFunction(prefix, method.getName(), method); 61 60 } 62 61 }
Note: See TracChangeset
for help on using the changeset viewer.