KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jdon > container > config > ContainerComponents


1 /*
2  * Copyright 2003-2006 the original author or authors.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  */

16 package com.jdon.container.config;
17
18 import java.util.HashMap JavaDoc;
19 import java.util.Iterator JavaDoc;
20 import java.util.Map JavaDoc;
21
22
23 /**
24  * the components that loaded from container.xml
25  *
26  * @author <a HREF="mailto:banqiao@jdon.com">banq</a>
27  *
28  */

29 public class ContainerComponents {
30     public final static String JavaDoc NAME = ContainerComponents.class.getName();
31     
32     private Map JavaDoc components ;
33           
34     /**
35      * @param components
36      */

37     public ContainerComponents(Map JavaDoc components) {
38         this.components = components;
39     }
40     
41     public void addComponent(String JavaDoc name, ComponentMetaDef componentMetaDef){
42         this.components.put(name, componentMetaDef);
43     }
44     
45     public void addComponents(Map JavaDoc components){
46         this.components.putAll(components);
47     }
48     
49     public ComponentMetaDef getComponentMetaDef(String JavaDoc name){
50         return (ComponentMetaDef)this.components.get(name);
51     }
52     
53     public Iterator JavaDoc iterator(){
54         return this.components.keySet().iterator();
55     }
56     
57    public int size(){
58        return this.components.size();
59    }
60    
61    
62
63     
64     /**
65      * @return Returns the components.
66      */

67     public Map JavaDoc getComponents() {
68         return this.components;
69     }
70 }
Popular Tags