1 package org.sapia.regis.util; 2 3 import java.util.Properties ; 4 5 import org.sapia.util.text.TemplateContextIF; 6 7 public class PropertiesContext implements TemplateContextIF{ 8 9 Properties props; 10 TemplateContextIF parent; 11 12 public PropertiesContext(Properties props, TemplateContextIF parent){ 13 this.props = props; 14 this.parent = parent; 15 } 16 17 public Object getValue(String name) { 18 Object prop = props.getProperty(name); 19 if(prop == null && parent != null){ 20 prop = parent.getValue(name); 21 } 22 return prop; 23 } 24 public void put(String arg0, Object arg1) { 25 } 26 27 } 28 | Popular Tags |