KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > tbutils > res > PropertyResourceProvider


1 package com.tonbeller.tbutils.res;
2
3 import java.util.Collection JavaDoc;
4 import java.util.Properties JavaDoc;
5
6 /**
7  * Adapter for Properties
8  */

9
10 public class PropertyResourceProvider implements ResourceProvider {
11   Properties JavaDoc props;
12   String JavaDoc name;
13
14   public PropertyResourceProvider(String JavaDoc name, Properties JavaDoc props) {
15     this.props = props;
16     this.name = name;
17   }
18
19   public String JavaDoc getString(String JavaDoc key) {
20     return props.getProperty(key);
21   }
22
23   public Collection JavaDoc keySet() {
24     return props.keySet();
25   }
26
27   public void close() {
28   }
29
30   public void dump(Dumper d) {
31     d.dump(this);
32   }
33   public String JavaDoc getName() {
34     return name;
35   }
36 }
37
Popular Tags