1 17 18 package org.apache.el.lang; 19 20 import java.io.Externalizable ; 21 import java.io.IOException ; 22 import java.io.ObjectInput ; 23 import java.io.ObjectOutput ; 24 import java.util.HashMap ; 25 import java.util.Map ; 26 27 import javax.el.ValueExpression; 28 import javax.el.VariableMapper; 29 30 public class VariableMapperImpl extends VariableMapper implements Externalizable { 31 32 private static final long serialVersionUID = 1L; 33 34 private Map vars = new HashMap (); 35 36 public VariableMapperImpl() { 37 super(); 38 } 39 40 public ValueExpression resolveVariable(String variable) { 41 return (ValueExpression) this.vars.get(variable); 42 } 43 44 public ValueExpression setVariable(String variable, 45 ValueExpression expression) { 46 return (ValueExpression) this.vars.put(variable, expression); 47 } 48 49 public void readExternal(ObjectInput in) throws IOException , ClassNotFoundException { 50 this.vars = (Map ) in.readObject(); 51 } 52 53 public void writeExternal(ObjectOutput out) throws IOException { 54 out.writeObject(this.vars); 55 } 56 } 57 | Popular Tags |