KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > lib > factory > BeanFactoryParameter


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
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 package org.apache.hivemind.lib.factory;
16
17 import java.util.ArrayList JavaDoc;
18 import java.util.List JavaDoc;
19 import java.util.Map JavaDoc;
20
21 /**
22  * Parameter object passed to {@link org.apache.hivemind.lib.factory.BeanFactoryBuilder}.
23  *
24  * @author Howard Lewis Ship
25  */

26 public class BeanFactoryParameter
27 {
28     private Class JavaDoc _vendClass = Object JavaDoc.class;
29     private boolean _defaultCacheable = true;
30     private List JavaDoc _contributions;
31
32     /**
33      * The contributions to the list (assigned from the companion
34      * configuration point).
35      */

36     public List JavaDoc getContributionsList()
37     {
38         return _contributions;
39     }
40
41     /**
42      * Default value for cacheable in contributions that do not explicitly
43      * set a value. Default is <code>true</code>.
44      */

45
46     public boolean getDefaultCacheable()
47     {
48         return _defaultCacheable;
49     }
50
51     /**
52      * The class or interface to be vended by the factory (all contributed
53      * classes must be assigneble). Defaults to <code>Object</code>.
54      */

55     public Class JavaDoc getVendClass()
56     {
57         return _vendClass;
58     }
59
60     public void setContributions(Map JavaDoc contributions)
61     {
62         _contributions = new ArrayList JavaDoc(contributions.values());
63     }
64
65     public void setContributionsList(List JavaDoc contributions)
66     {
67         _contributions = contributions;
68     }
69
70     public void setDefaultCacheable(boolean b)
71     {
72         _defaultCacheable = b;
73     }
74
75     public void setVendClass(Class JavaDoc class1)
76     {
77         _vendClass = class1;
78     }
79
80 }
81
Popular Tags