|
|||||||||||||||||||
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 | |||||||||||||||
ModuleDescriptor.java | 87.5% | 100% | 100% | 98% |
|
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.parse;
|
|
16 |
|
|
17 |
import java.util.ArrayList;
|
|
18 |
import java.util.List;
|
|
19 |
|
|
20 |
import org.apache.hivemind.ClassResolver;
|
|
21 |
import org.apache.hivemind.impl.BaseLocatable;
|
|
22 |
import org.apache.hivemind.util.ToStringBuilder;
|
|
23 |
|
|
24 |
/**
|
|
25 |
* Representation of a HiveMind module descriptor, as parsed
|
|
26 |
* by {@link org.apache.hivemind.parse.DescriptorParser}.
|
|
27 |
* Corresponds to the root <module> element.
|
|
28 |
*
|
|
29 |
* @author Howard Lewis Ship
|
|
30 |
*/
|
|
31 |
public final class ModuleDescriptor extends BaseLocatable |
|
32 |
{ |
|
33 |
private String _moduleId;
|
|
34 |
private String _version;
|
|
35 |
private List _servicePoints;
|
|
36 |
private List _implementations;
|
|
37 |
private List _configurationPoints;
|
|
38 |
private List _contributions;
|
|
39 |
private ClassResolver _resolver;
|
|
40 |
|
|
41 | 21 |
public String toString()
|
42 |
{ |
|
43 | 21 |
ToStringBuilder builder = new ToStringBuilder(this); |
44 |
|
|
45 | 21 |
builder.append("moduleId", _moduleId);
|
46 | 21 |
builder.append("version", _version);
|
47 |
|
|
48 | 21 |
return builder.toString();
|
49 |
} |
|
50 |
|
|
51 | 862 |
public void addServicePoint(ServicePointDescriptor service) |
52 |
{ |
|
53 | 862 |
if (_servicePoints == null) |
54 | 130 |
_servicePoints = new ArrayList();
|
55 |
|
|
56 | 862 |
_servicePoints.add(service); |
57 |
} |
|
58 |
|
|
59 | 159 |
public List getServicePoints()
|
60 |
{ |
|
61 | 159 |
return _servicePoints;
|
62 |
} |
|
63 |
|
|
64 | 13 |
public void addImplementation(ImplementationDescriptor descriptor) |
65 |
{ |
|
66 | 13 |
if (_implementations == null) |
67 | 13 |
_implementations = new ArrayList();
|
68 |
|
|
69 | 13 |
_implementations.add(descriptor); |
70 |
} |
|
71 |
|
|
72 | 157 |
public List getImplementations()
|
73 |
{ |
|
74 | 157 |
return _implementations;
|
75 |
} |
|
76 |
|
|
77 | 599 |
public void addConfigurationPoint(ConfigurationPointDescriptor descriptor) |
78 |
{ |
|
79 | 599 |
if (_configurationPoints == null) |
80 | 130 |
_configurationPoints = new ArrayList();
|
81 |
|
|
82 | 599 |
_configurationPoints.add(descriptor); |
83 |
} |
|
84 |
|
|
85 | 163 |
public List getConfigurationPoints()
|
86 |
{ |
|
87 | 163 |
return _configurationPoints;
|
88 |
} |
|
89 |
|
|
90 | 364 |
public void addContribution(ContributionDescriptor descriptor) |
91 |
{ |
|
92 | 364 |
if (_contributions == null) |
93 | 127 |
_contributions = new ArrayList();
|
94 |
|
|
95 | 364 |
_contributions.add(descriptor); |
96 |
} |
|
97 |
|
|
98 | 158 |
public List getContributions()
|
99 |
{ |
|
100 | 158 |
return _contributions;
|
101 |
} |
|
102 |
|
|
103 | 1456 |
public String getModuleId()
|
104 |
{ |
|
105 | 1456 |
return _moduleId;
|
106 |
} |
|
107 |
|
|
108 | 1 |
public String getVersion()
|
109 |
{ |
|
110 | 1 |
return _version;
|
111 |
} |
|
112 |
|
|
113 | 177 |
public void setModuleId(String string) |
114 |
{ |
|
115 | 177 |
_moduleId = string; |
116 |
} |
|
117 |
|
|
118 | 177 |
public void setVersion(String string) |
119 |
{ |
|
120 | 177 |
_version = string; |
121 |
} |
|
122 |
|
|
123 | 156 |
public ClassResolver getClassResolver()
|
124 |
{ |
|
125 | 156 |
return _resolver;
|
126 |
} |
|
127 |
|
|
128 | 177 |
public void setClassResolver(ClassResolver resolver) |
129 |
{ |
|
130 | 177 |
_resolver = resolver; |
131 |
} |
|
132 |
|
|
133 |
} |
|
134 |
|
|