1 17 18 package org.apache.el.lang; 19 20 import java.lang.reflect.Method ; 21 22 import javax.el.FunctionMapper; 23 24 28 public class FunctionMapperFactory extends FunctionMapper { 29 30 protected FunctionMapperImpl memento = null; 31 protected FunctionMapper target; 32 33 public FunctionMapperFactory(FunctionMapper mapper) { 34 if (mapper == null) { 35 throw new NullPointerException ("FunctionMapper target cannot be null"); 36 } 37 this.target = mapper; 38 } 39 40 41 44 public Method resolveFunction(String prefix, String localName) { 45 if (this.memento == null) { 46 this.memento = new FunctionMapperImpl(); 47 } 48 Method m = this.target.resolveFunction(prefix, localName); 49 if (m != null) { 50 this.memento.addFunction(prefix, localName, m); 51 } 52 return m; 53 } 54 55 public FunctionMapper create() { 56 return this.memento; 57 } 58 59 } 60 | Popular Tags |