EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hiveutils.service.impl]

COVERAGE SUMMARY FOR SOURCE FILE [ObjectContribution.java]

nameclass, %method, %block, %line, %
ObjectContribution.java100% (1/1)80%  (12/15)71%  (73/103)75%  (24/32)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ObjectContribution100% (1/1)80%  (12/15)71%  (73/103)75%  (24/32)
isEagerLoad (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
setEagerLoad (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
toString (): String 0%   (0/1)0%   (0/23)0%   (0/5)
ObjectContribution (): void 100% (1/1)100% (18/18)100% (5/5)
addInjection (InjectContribution): void 100% (1/1)100% (19/19)100% (5/5)
addListener (ListenerContribution): void 100% (1/1)100% (6/6)100% (2/2)
getConstructorInjections (): List 100% (1/1)100% (3/3)100% (1/1)
getListeners (): List 100% (1/1)100% (3/3)100% (1/1)
getName (): String 100% (1/1)100% (3/3)100% (1/1)
getObjectClass (): Class 100% (1/1)100% (3/3)100% (1/1)
getSetterInjections (): Map 100% (1/1)100% (3/3)100% (1/1)
isCached (): boolean 100% (1/1)100% (3/3)100% (1/1)
setCached (boolean): void 100% (1/1)100% (4/4)100% (2/2)
setName (String): void 100% (1/1)100% (4/4)100% (2/2)
setObjectClass (Class): void 100% (1/1)100% (4/4)100% (2/2)

1//  Copyright 2004-2007 Jean-Francois Poilpret
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 
15package net.sourceforge.hiveutils.service.impl;
16 
17import java.util.ArrayList;
18import java.util.HashMap;
19import java.util.List;
20import java.util.Map;
21 
22import org.apache.hivemind.impl.BaseLocatable;
23import org.apache.hivemind.util.ToStringBuilder;
24 
25/**
26 * Represents a configuration parameter to the ObjectBuilder, indicating
27 * which class to instantiate and the unique name of the definition.
28 *
29 * @author Jean-Francois Poilpret
30 */
31public class ObjectContribution extends BaseLocatable
32{
33        public ObjectContribution()
34        {
35                _listeners = new ArrayList<ListenerContribution>();
36                _ctorInjections = new ArrayList<InjectObjectInformation>();
37                _setterInjections = new HashMap<String, InjectObjectInformation>();
38        }
39 
40        public void                setName(String name)
41        {
42                _name = name;
43        }
44 
45        public String        getName()
46        {
47                return _name;
48        }
49 
50        public void                setCached(boolean cached)
51        {
52                _cached = cached;
53        }
54 
55        public boolean        isCached()
56        {
57                return _cached;
58        }
59 
60        public void                setEagerLoad(boolean eagerLoad)
61        {
62                _eagerLoad = eagerLoad;
63        }
64 
65        public boolean        isEagerLoad()
66        {
67                return _eagerLoad;
68        }
69 
70        public void        setObjectClass(Class clazz)
71        {
72                _clazz = clazz;
73        }
74 
75        public Class        getObjectClass()
76        {
77                return _clazz;
78        }
79        
80        public void                addInjection(InjectContribution inject)
81        {
82                if (inject.getName() != null)
83                {
84                        _setterInjections.put(inject.getName(), inject.getObject());
85                }
86                else
87                {
88                        _ctorInjections.add(inject.getObject());
89                }
90        }
91 
92        public void                addListener(ListenerContribution listener)
93        {
94                _listeners.add(listener);
95        }
96 
97        public List<ListenerContribution>        getListeners()
98        {
99                return _listeners;
100        }
101 
102        public List<InjectObjectInformation>        getConstructorInjections()
103        {
104                return _ctorInjections;
105        }
106 
107        public Map<String, InjectObjectInformation>        getSetterInjections()
108        {
109                return _setterInjections;
110        }
111 
112    public String toString()
113    {
114        ToStringBuilder builder = new ToStringBuilder(this);
115        builder.append("name", _name);
116        builder.append("cached", _cached);
117        builder.append("class", _clazz);
118        return builder.toString();
119    }
120    
121        private String                                                                        _name;
122        private boolean                                                                        _cached;
123        private boolean                                                                        _eagerLoad;
124        private Class                                                                        _clazz;
125        private List<ListenerContribution>                                _listeners;
126        private List<InjectObjectInformation>                        _ctorInjections;
127        private Map<String, InjectObjectInformation>        _setterInjections;
128}

[all classes][net.sourceforge.hiveutils.service.impl]
EMMA 2.0.5312 (C) Vladimir Roubtsov