File: ExtensionPoint.java

package info (click to toggle)
libjpf-java 1.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,280 kB
  • ctags: 2,079
  • sloc: java: 13,449; xml: 337; sh: 48; makefile: 10
file content (183 lines) | stat: -rw-r--r-- 6,573 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*****************************************************************************
 * Java Plug-in Framework (JPF)
 * Copyright (C) 2004-2007 Dmitry Olshansky
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *****************************************************************************/
package org.java.plugin.registry;

import java.util.Collection;

/**
 * This interface abstracts the extension point - a place where the
 * functionality of plug-in can be extended.
 * <p>
 * Extension point UID is a combination of declaring plug-in ID and extension
 * point ID that is unique within whole set of registered plug-ins.
 * </p>
 * 
 * @version $Id$
 */
public interface ExtensionPoint
        extends UniqueIdentity, PluginElement<ExtensionPoint> {
    /**
     * @return multiplicity of this extension point
     */
    ExtensionMultiplicity getMultiplicity();

    /**
     * Returns collection of all top level parameter definitions declared
     * in this extension point and all it parents.
     * @return collection of {@link ExtensionPoint.ParameterDefinition} objects
     */
    Collection<ParameterDefinition> getParameterDefinitions();
    
    /**
     * @param id ID of parameter definition to look for
     * @return parameter definition with given ID
     */
    ParameterDefinition getParameterDefinition(String id);

    /**
     * Returns a collection of all extensions that available for this point.
     * @return collection of {@link Extension} objects
     */
    Collection<Extension> getAvailableExtensions();
    
    /**
     * @param uniqueId unique ID of extension
     * @return extension that is available for this point
     */
    Extension getAvailableExtension(String uniqueId);
    
    /**
     * Checks if extension is available for this extension point. If this method
     * returns <code>true</code>, the method
     * {@link #getAvailableExtension(String)} should return valid extension for
     * the same UID.
     * @param uniqueId unique ID of extension
     * @return <code>true</code> if extension is available for this extension
     *         point
     */
    boolean isExtensionAvailable(String uniqueId);

    /**
     * Returns a collection of all extensions that was successfully "connected"
     * to this point.
     * @return collection of {@link Extension} objects
     */
    Collection<Extension> getConnectedExtensions();
    
    /**
     * @param uniqueId unique ID of extension
     * @return extension that was successfully "connected" to this point
     */
    Extension getConnectedExtension(String uniqueId);
    
    /**
     * Checks if extension is in valid state and successfully "connected"
     * to this extension point. If this method returns <code>true</code>,
     * the method {@link #getConnectedExtension(String)} should return
     * valid extension for the same UID.
     * @param uniqueId unique ID of extension
     * @return <code>true</code> if extension was successfully "connected" to
     *         this extension point
     */
    boolean isExtensionConnected(String uniqueId);
    
    /**
     * @return <code>true</code> if extension point is considered to be valid
     */
    boolean isValid();
    
    /**
     * @return parent extension point plug-in ID or <code>null</code>
     */
    String getParentPluginId();
    
    /**
     * @return parent extension point ID or <code>null</code>
     */
    String getParentExtensionPointId();
    
    /**
     * @param extensionPoint extension point
     * @return <code>true</code> if this point is successor of given extension
     *         point
     */
    boolean isSuccessorOf(ExtensionPoint extensionPoint);
    
    /**
     * Looks for all available (valid) successors of this extension point.
     * The search should be done recursively including all descendants of this
     * extension point.
     * @return collection of {@link ExtensionPoint} objects
     */
    Collection<ExtensionPoint> getDescendants();

    /**
     * This interface abstracts parameter definition - a parameter
     * "type declaration".
     * @version $Id$
     */
    interface ParameterDefinition extends PluginElement<ParameterDefinition> {
        /**
         * @return multiplicity of parameter, that can be defined according
         *         to this definition
         */
        ParameterMultiplicity getMultiplicity();

        /**
         * @return value type of parameter, that can be defined according
         *         to this definition
         */
        ParameterType getType();
        
        /**
         * @return custom data for additional customization of some types
         */
        String getCustomData();

        /**
         * Returns collection of all parameter sub-definitions declared
         * in this parameter definition.
         * @return collection of {@link ExtensionPoint.ParameterDefinition}
         *         objects
         */
        Collection<ParameterDefinition> getSubDefinitions();

        /**
         * @param id ID of parameter sub-definition to look for
         * @return parameter sub-definition with given ID
         */
        ParameterDefinition getSubDefinition(String id);

        /**
         * @return extension point, this definition belongs to
         */
        ExtensionPoint getDeclaringExtensionPoint();
        
        /**
         * @return parameter definition, of which this one is child or
         *         <code>null</code> if this is top level parameter definition
         */
        ParameterDefinition getSuperDefinition();
        
        /**
         * @return default parameter value as it is defined in manifest
         */
        String getDefaultValue();
    }
}