1 25 package com.sun.el.lang; 26 27 import java.lang.reflect.Method ; 28 29 import javax.el.FunctionMapper; 30 31 35 public class FunctionMapperFactory extends FunctionMapper { 36 37 protected FunctionMapperImpl memento = null; 38 protected FunctionMapper target; 39 40 public FunctionMapperFactory(FunctionMapper mapper) { 41 if (mapper == null) { 42 throw new NullPointerException ("FunctionMapper target cannot be null"); 43 } 44 this.target = mapper; 45 } 46 47 48 51 public Method resolveFunction(String prefix, String localName) { 52 if (this.memento == null) { 53 this.memento = new FunctionMapperImpl(); 54 } 55 Method m = this.target.resolveFunction(prefix, localName); 56 if (m != null) { 57 this.memento.addFunction(prefix, localName, m); 58 } 59 return m; 60 } 61 62 public FunctionMapper create() { 63 return this.memento; 64 } 65 66 } 67 | Popular Tags |