1 14 15 package com.sun.facelets.el; 16 17 import java.util.HashMap ; 18 import java.util.Map ; 19 20 import javax.el.ValueExpression; 21 import javax.el.VariableMapper; 22 23 32 public final class VariableMapperWrapper extends VariableMapper { 33 34 private final VariableMapper target; 35 36 private Map vars; 37 38 41 public VariableMapperWrapper(VariableMapper orig) { 42 super(); 43 this.target = orig; 44 } 45 46 52 public ValueExpression resolveVariable(String variable) { 53 ValueExpression ve = null; 54 if (this.vars != null) { 55 ve = (ValueExpression) this.vars.get(variable); 56 } 57 if (ve == null) { 58 return this.target.resolveVariable(variable); 59 } 60 return ve; 61 } 62 63 69 public ValueExpression setVariable(String variable, 70 ValueExpression expression) { 71 if (this.vars == null) { 72 this.vars = new HashMap (); 73 } 74 return (ValueExpression) this.vars.put(variable, expression); 75 } 76 } 77 | Popular Tags |