01: /*
02: * Created on Sep 23, 2005
03: */
04: package uk.org.ponder.rsf.renderer.scr;
05:
06: import java.util.HashMap;
07: import java.util.List;
08:
09: public class StaticRendererCollection {
10: // a hashmap of either Strings or Component classes
11: private HashMap renderers = new HashMap();
12:
13: public void addSCR(StaticComponentRenderer renderer) {
14: renderers.put(renderer.getName(), renderer);
15: }
16:
17: public StaticComponentRenderer getSCR(String name) {
18: return (StaticComponentRenderer) renderers.get(name);
19: }
20:
21: public void setStaticRenderers(List rendererlist) {
22: for (int i = 0; i < rendererlist.size(); ++i) {
23: Object entry = rendererlist.get(i);
24: if (entry instanceof StaticComponentRenderer) {
25: addSCR((StaticComponentRenderer) entry);
26: } else {
27: renderers
28: .putAll(((StaticRendererCollection) entry).renderers);
29: }
30: }
31: }
32: }
|