| 
  |||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| BeanFactoryParameter.java | - | 83.3% | 83.3% | 83.3% | 
             | 
  ||||||||||||||
| 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.List; | |
| 18 | ||
| 19 | /** | |
| 20 | * Parameter object passed to {@link org.apache.hivemind.lib.factory.BeanFactoryBuilder}. | |
| 21 | * | |
| 22 | * @author Howard Lewis Ship | |
| 23 | */ | |
| 24 | public class BeanFactoryParameter | |
| 25 | { | |
| 26 | private Class _vendClass = Object.class; | |
| 27 | private boolean _defaultCacheable = true; | |
| 28 | private List _contributions; | |
| 29 | ||
| 30 | /** | |
| 31 | * The contributions to the list (assigned from the companion | |
| 32 | * configuration point). | |
| 33 | */ | |
| 34 | 2 | public List getContributions() | 
| 35 | { | |
| 36 | 2 | return _contributions; | 
| 37 | } | |
| 38 | ||
| 39 | /** | |
| 40 | * Default value for cacheable in contributions that do not explicitly | |
| 41 | * set a value. Default is <code>true</code>. | |
| 42 | */ | |
| 43 | ||
| 44 | 2 | public boolean getDefaultCacheable() | 
| 45 | { | |
| 46 | 2 | return _defaultCacheable; | 
| 47 | } | |
| 48 | ||
| 49 | /** | |
| 50 | * The class or interface to be vended by the factory (all contributed | |
| 51 | * classes must be assigneble). Defaults to <code>Object</code>. | |
| 52 | */ | |
| 53 | 2 | public Class getVendClass() | 
| 54 | { | |
| 55 | 2 | return _vendClass; | 
| 56 | } | |
| 57 | ||
| 58 | 2 | public void setContributions(List list) | 
| 59 | { | |
| 60 | 2 | _contributions = list; | 
| 61 | } | |
| 62 | ||
| 63 | 0 | public void setDefaultCacheable(boolean b) | 
| 64 | { | |
| 65 | 0 | _defaultCacheable = b; | 
| 66 | } | |
| 67 | ||
| 68 | 1 | public void setVendClass(Class class1) | 
| 69 | { | |
| 70 | 1 | _vendClass = class1; | 
| 71 | } | |
| 72 | ||
| 73 | } | 
  | 
||||||||||