01: // Copyright 2004, 2005 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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.Collections;
19: import java.util.List;
20:
21: import org.apache.hivemind.Element;
22: import org.apache.hivemind.util.ToStringBuilder;
23:
24: /**
25: * Descriptor for <contribution> element.
26: *
27: * @author Howard Lewis Ship
28: */
29: public final class ContributionDescriptor extends BaseAnnotationHolder {
30: private String _configurationId;
31:
32: private List _elements;
33:
34: /** @since 1.1 */
35: private String _conditionalExpression;
36:
37: /**
38: * Returns the extension id, which may be a local id (simple name) or an extended id (including
39: * a module id prefix).
40: */
41: public String getConfigurationId() {
42: return _configurationId;
43: }
44:
45: public void setConfigurationId(String string) {
46: _configurationId = string;
47: }
48:
49: public String toString() {
50: ToStringBuilder builder = new ToStringBuilder(this );
51: builder.append("configurationId", _configurationId);
52: builder.append("conditionalExpression", _conditionalExpression);
53:
54: return builder.toString();
55: }
56:
57: public void addElement(Element element) {
58: if (_elements == null)
59: _elements = new ArrayList();
60:
61: _elements.add(element);
62: }
63:
64: public List getElements() {
65: if (_elements == null)
66: return Collections.EMPTY_LIST;
67:
68: return _elements;
69: }
70:
71: /** @since 1.1 */
72: public String getConditionalExpression() {
73: return _conditionalExpression;
74: }
75:
76: /** @since 1.1 */
77: public void setConditionalExpression(String conditionalExpression) {
78: _conditionalExpression = conditionalExpression;
79: }
80: }
|