KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > regis > util > PropertiesContext


1 package org.sapia.regis.util;
2
3 import java.util.Properties JavaDoc;
4
5 import org.sapia.util.text.TemplateContextIF;
6
7 public class PropertiesContext implements TemplateContextIF{
8   
9   Properties JavaDoc props;
10   TemplateContextIF parent;
11   
12   public PropertiesContext(Properties JavaDoc props, TemplateContextIF parent){
13     this.props = props;
14     this.parent = parent;
15   }
16   
17   public Object JavaDoc getValue(String JavaDoc name) {
18     Object JavaDoc 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 JavaDoc arg0, Object JavaDoc arg1) {
25   }
26   
27 }
28
Popular Tags