|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
BeanFactoryContribution.java | 100% | 85.7% | 85.7% | 87.5% |
|
1 |
// Copyright 2004 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 org.apache.hivemind.impl.BaseLocatable;
|
|
18 |
|
|
19 |
/**
|
|
20 |
* A contribution used with an {@link org.apache.hivemind.lib.BeanFactory}
|
|
21 |
* to define one class of objects that may be returned from the factory.
|
|
22 |
*
|
|
23 |
* @author Howard Lewis Ship
|
|
24 |
*/
|
|
25 |
public class BeanFactoryContribution extends BaseLocatable |
|
26 |
{ |
|
27 |
private String _name;
|
|
28 |
private Class _beanClass;
|
|
29 |
|
|
30 |
// Stored as a boolean, so that null means 'as defined by the factory'
|
|
31 |
private Boolean _cacheable;
|
|
32 |
|
|
33 | 0 |
public Boolean getCacheable()
|
34 |
{ |
|
35 | 0 |
return _cacheable;
|
36 |
} |
|
37 |
|
|
38 | 16 |
public String getName()
|
39 |
{ |
|
40 | 16 |
return _name;
|
41 |
} |
|
42 |
|
|
43 | 28 |
public Class getBeanClass()
|
44 |
{ |
|
45 | 28 |
return _beanClass;
|
46 |
} |
|
47 |
|
|
48 | 13 |
public void setCacheable(Boolean cacheable) |
49 |
{ |
|
50 | 13 |
_cacheable = cacheable; |
51 |
} |
|
52 |
|
|
53 | 15 |
public void setName(String string) |
54 |
{ |
|
55 | 15 |
_name = string; |
56 |
} |
|
57 |
|
|
58 | 15 |
public void setBeanClass(Class objectClass) |
59 |
{ |
|
60 | 15 |
_beanClass = objectClass; |
61 |
} |
|
62 |
|
|
63 | 8 |
public boolean getStoreResultInCache(boolean defaultCacheable) |
64 |
{ |
|
65 | 8 |
return _cacheable == null ? defaultCacheable : _cacheable.booleanValue(); |
66 |
} |
|
67 |
} |
|
68 |
|
|