KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > parse > ContributionDescriptor


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.parse;
16
17 import java.util.ArrayList JavaDoc;
18 import java.util.Collections JavaDoc;
19 import java.util.List JavaDoc;
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 {
31     private String JavaDoc _configurationId;
32
33     private List JavaDoc _elements;
34
35     /** @since 1.1 */
36     private String JavaDoc _conditionalExpression;
37
38     /**
39      * Returns the extension id, which may be a local id (simple name) or an extended id (including
40      * a module id prefix).
41      */

42     public String JavaDoc getConfigurationId()
43     {
44         return _configurationId;
45     }
46
47     public void setConfigurationId(String JavaDoc string)
48     {
49         _configurationId = string;
50     }
51
52     public String JavaDoc toString()
53     {
54         ToStringBuilder builder = new ToStringBuilder(this);
55         builder.append("configurationId", _configurationId);
56         builder.append("conditionalExpression", _conditionalExpression);
57
58         return builder.toString();
59     }
60
61     public void addElement(Element element)
62     {
63         if (_elements == null)
64             _elements = new ArrayList JavaDoc();
65
66         _elements.add(element);
67     }
68
69     public List JavaDoc getElements()
70     {
71         if (_elements == null)
72             return Collections.EMPTY_LIST;
73
74         return _elements;
75     }
76
77     /** @since 1.1 */
78     public String JavaDoc getConditionalExpression()
79     {
80         return _conditionalExpression;
81     }
82
83     /** @since 1.1 */
84     public void setConditionalExpression(String JavaDoc conditionalExpression)
85     {
86         _conditionalExpression = conditionalExpression;
87     }
88 }
Popular Tags