1 28 29 package com.caucho.config.types; 30 31 import com.caucho.config.Config; 32 import com.caucho.util.L10N; 33 34 import javax.servlet.jsp.el.ELException ; 35 import java.util.HashMap ; 36 37 40 public class InitParam { 41 private static L10N L = new L10N(InitParam.class); 42 43 private HashMap <String ,String > _parameters = new HashMap <String ,String >(); 44 45 private boolean _allowEL = true; 46 47 private String _paramName; 48 private String _paramValue; 49 50 private String _description; 51 52 55 public void setAllowEL(boolean allowEL) 56 { 57 _allowEL = allowEL; 58 } 59 60 63 public void setParamName(String paramName) 64 { 65 _paramName = paramName; 66 } 67 68 71 public void setParamValue(RawString paramValue) 72 throws ELException 73 { 74 String value = paramValue.getValue(); 75 76 if (_allowEL) 77 value = Config.evalString(value); 78 79 _paramValue = value; 80 } 81 82 85 public void setDescription(String description) 86 { 87 _description = description; 88 } 89 90 93 public void setProperty(String name, RawString rawValue) 94 throws ELException 95 { 96 String value = rawValue.getValue(); 97 98 if (_allowEL) 99 value = Config.evalString(value); 100 101 _parameters.put(name, value); 102 } 103 104 107 public HashMap <String ,String > getParameters() 108 { 109 if (_paramName != null) 110 _parameters.put(_paramName, _paramValue); 111 112 return _parameters; 113 } 114 115 public String toString() 116 { 117 return "InitParam" + getParameters(); 118 } 119 } 120 121 | Popular Tags |