KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > panoptes > registry > TemplateRegistry


1 /*
2  * Created on Aug 18, 2003
3  *
4  */

5 package net.sf.panoptes.registry;
6
7 import java.util.Collection JavaDoc;
8 import java.util.HashMap JavaDoc;
9 import java.util.Map JavaDoc;
10
11 /**
12  *
13  *
14  * @author Dag Liodden
15  * @version 0.1
16  */

17 public class TemplateRegistry {
18     
19     private static TemplateRegistry instance;
20     private Map JavaDoc templates = new HashMap JavaDoc();
21
22     public static TemplateRegistry getInstance() {
23         if (instance == null) instance = new TemplateRegistry();
24         return instance;
25     }
26     
27     public Collection JavaDoc getTemplates() {
28         return templates.values();
29     }
30     
31     public void addTemplate(Template template) {
32         templates.put(template.getName(), template);
33     }
34
35     public void removeAll() {
36         templates.clear();
37     }
38 }
39
Popular Tags