1 29 30 package com.caucho.el; 31 32 import com.caucho.loader.EnvironmentMap; 33 34 import javax.el.ELContext; 35 import javax.el.ELResolver; 36 37 40 public class EnvironmentVariableResolver extends AbstractVariableResolver { 41 private static EnvironmentMap _map = new EnvironmentMap(); 42 43 46 public EnvironmentVariableResolver() 47 { 48 } 49 50 53 public EnvironmentVariableResolver(ELResolver next) 54 { 55 } 56 57 60 public Object getValue(ELContext context, Object base, Object property) 61 { 62 String var = (String ) base; 63 64 Object value = _map.get(var); 65 66 if (value != null) 67 return value; 68 else 69 return super.getValue(context, base, property); 70 } 71 72 75 public void setValue(ELContext context, 76 Object base, 77 Object property, 78 Object value) 79 { 80 _map.put((String ) base, value); 81 } 82 } 83 | Popular Tags |