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