KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > registry > spi > ConfigurationElementDescription


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.registry.spi;
12
13 import org.eclipse.core.runtime.IConfigurationElement;
14
15 /**
16  * Describes configuration elements (content of an extension) to be added to
17  * the extension registry. Configuration element can contain attributes or
18  * a String value. Configuration element can contain other configuration
19  * elements (children).
20  * <p>
21  * It is expected that configuration element's name is not null. Attributes and
22  * children of the extension description might be null; value might be null as well.
23  * </p>
24  * <p>
25  * This class can be instantiated.
26  * </p>
27  * <p>
28  * This class is not intended to be subclassed.
29  * </p>
30  * @see ConfigurationElementAttribute
31  */

32 public final class ConfigurationElementDescription {
33
34     /**
35      * Name of the configuration element.
36      * @see IConfigurationElement#getName()
37      */

38     private String JavaDoc name;
39
40     /**
41      * Attributes of the configuration element.
42      * @see IConfigurationElement#getAttribute(String)
43      */

44     private ConfigurationElementAttribute[] attributes;
45
46     /**
47      * String value to be stored in this configuration element.
48      * @see IConfigurationElement#getValue()
49      */

50     private String JavaDoc value;
51
52     /**
53      * Children of the configuration element.
54      * @see IConfigurationElement#getChildren()
55      */

56     private ConfigurationElementDescription[] children;
57
58     /**
59      * Constructor.
60      *
61      * @param name - name of the configuration element
62      * @param attributes - attributes of the configuration element. Might be null.
63      * @param value - string value to be stored. Might be null.
64      * @param children - children of the configuration element. Might be null.
65      * @see IConfigurationElement#getName()
66      * @see IConfigurationElement#getChildren()
67      * @see IConfigurationElement#getAttribute(String)
68      * @see IConfigurationElement#getValue()
69      */

70     public ConfigurationElementDescription(String JavaDoc name, ConfigurationElementAttribute[] attributes, String JavaDoc value, ConfigurationElementDescription[] children) {
71         this.name = name;
72         this.attributes = attributes;
73         this.value = value;
74         this.children = children;
75     }
76
77     /**
78      * Constructor.
79      *
80      * @param name - name of the configuration element
81      * @param attribute - attribute of the configuration element. Might be null.
82      * @param value - string value to be stored. Might be null.
83      * @param children - children of the configuration element. Might be null.
84      * @see IConfigurationElement#getName()
85      * @see IConfigurationElement#getChildren()
86      * @see IConfigurationElement#getAttribute(String)
87      * @see IConfigurationElement#getValue()
88      */

89     public ConfigurationElementDescription(String JavaDoc name, ConfigurationElementAttribute attribute, String JavaDoc value, ConfigurationElementDescription[] children) {
90         this.name = name;
91         this.attributes = new ConfigurationElementAttribute[] {attribute};
92         this.value = value;
93         this.children = children;
94     }
95
96     /**
97      * Returns children of the configuration element.
98      * @return - children of the extension
99      * @see IConfigurationElement#getChildren()
100      */

101     public ConfigurationElementDescription[] getChildren() {
102         return children;
103     }
104
105     /**
106      * Returns name of the configuration element.
107      * @return - extension name
108      * @see IConfigurationElement#getName()
109      */

110     public String JavaDoc getName() {
111         return name;
112     }
113
114     /**
115      * Returns attributes of the configuration element.
116      * @return - attributes of the extension description
117      * @see IConfigurationElement#getAttribute(String)
118      */

119     public ConfigurationElementAttribute[] getAttributes() {
120         return attributes;
121     }
122
123     /**
124      * Returns string value stored in the configuration element.
125      * @return - String value to be stored in the element
126      * @see IConfigurationElement#getValue()
127      */

128     public String JavaDoc getValue() {
129         return value;
130     }
131 }
132
Popular Tags