001: /*****************************************************************************
002: * Java Plug-in Framework (JPF)
003: * Copyright (C) 2004-2007 Dmitry Olshansky
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *****************************************************************************/package org.java.plugin.registry;
019:
020: import java.util.Collection;
021:
022: /**
023: * This interface abstracts the extension point - a place where the
024: * functionality of plug-in can be extended.
025: * <p>
026: * Extension point UID is a combination of declaring plug-in ID and extension
027: * point ID that is unique within whole set of registered plug-ins.
028: * </p>
029: *
030: * @version $Id$
031: */
032: public interface ExtensionPoint extends UniqueIdentity,
033: PluginElement<ExtensionPoint> {
034: /**
035: * @return multiplicity of this extension point
036: */
037: ExtensionMultiplicity getMultiplicity();
038:
039: /**
040: * Returns collection of all top level parameter definitions declared
041: * in this extension point and all it parents.
042: * @return collection of {@link ExtensionPoint.ParameterDefinition} objects
043: */
044: Collection<ParameterDefinition> getParameterDefinitions();
045:
046: /**
047: * @param id ID of parameter definition to look for
048: * @return parameter definition with given ID
049: */
050: ParameterDefinition getParameterDefinition(String id);
051:
052: /**
053: * Returns a collection of all extensions that available for this point.
054: * @return collection of {@link Extension} objects
055: */
056: Collection<Extension> getAvailableExtensions();
057:
058: /**
059: * @param uniqueId unique ID of extension
060: * @return extension that is available for this point
061: */
062: Extension getAvailableExtension(String uniqueId);
063:
064: /**
065: * Checks if extension is available for this extension point. If this method
066: * returns <code>true</code>, the method
067: * {@link #getAvailableExtension(String)} should return valid extension for
068: * the same UID.
069: * @param uniqueId unique ID of extension
070: * @return <code>true</code> if extension is available for this extension
071: * point
072: */
073: boolean isExtensionAvailable(String uniqueId);
074:
075: /**
076: * Returns a collection of all extensions that was successfully "connected"
077: * to this point.
078: * @return collection of {@link Extension} objects
079: */
080: Collection<Extension> getConnectedExtensions();
081:
082: /**
083: * @param uniqueId unique ID of extension
084: * @return extension that was successfully "connected" to this point
085: */
086: Extension getConnectedExtension(String uniqueId);
087:
088: /**
089: * Checks if extension is in valid state and successfully "connected"
090: * to this extension point. If this method returns <code>true</code>,
091: * the method {@link #getConnectedExtension(String)} should return
092: * valid extension for the same UID.
093: * @param uniqueId unique ID of extension
094: * @return <code>true</code> if extension was successfully "connected" to
095: * this extension point
096: */
097: boolean isExtensionConnected(String uniqueId);
098:
099: /**
100: * @return <code>true</code> if extension point is considered to be valid
101: */
102: boolean isValid();
103:
104: /**
105: * @return parent extension point plug-in ID or <code>null</code>
106: */
107: String getParentPluginId();
108:
109: /**
110: * @return parent extension point ID or <code>null</code>
111: */
112: String getParentExtensionPointId();
113:
114: /**
115: * @param extensionPoint extension point
116: * @return <code>true</code> if this point is successor of given extension
117: * point
118: */
119: boolean isSuccessorOf(ExtensionPoint extensionPoint);
120:
121: /**
122: * Looks for all available (valid) successors of this extension point.
123: * The search should be done recursively including all descendants of this
124: * extension point.
125: * @return collection of {@link ExtensionPoint} objects
126: */
127: Collection<ExtensionPoint> getDescendants();
128:
129: /**
130: * This interface abstracts parameter definition - a parameter
131: * "type declaration".
132: * @version $Id$
133: */
134: interface ParameterDefinition extends
135: PluginElement<ParameterDefinition> {
136: /**
137: * @return multiplicity of parameter, that can be defined according
138: * to this definition
139: */
140: ParameterMultiplicity getMultiplicity();
141:
142: /**
143: * @return value type of parameter, that can be defined according
144: * to this definition
145: */
146: ParameterType getType();
147:
148: /**
149: * @return custom data for additional customization of some types
150: */
151: String getCustomData();
152:
153: /**
154: * Returns collection of all parameter sub-definitions declared
155: * in this parameter definition.
156: * @return collection of {@link ExtensionPoint.ParameterDefinition}
157: * objects
158: */
159: Collection<ParameterDefinition> getSubDefinitions();
160:
161: /**
162: * @param id ID of parameter sub-definition to look for
163: * @return parameter sub-definition with given ID
164: */
165: ParameterDefinition getSubDefinition(String id);
166:
167: /**
168: * @return extension point, this definition belongs to
169: */
170: ExtensionPoint getDeclaringExtensionPoint();
171:
172: /**
173: * @return parameter definition, of which this one is child or
174: * <code>null</code> if this is top level parameter definition
175: */
176: ParameterDefinition getSuperDefinition();
177:
178: /**
179: * @return default parameter value as it is defined in manifest
180: */
181: String getDefaultValue();
182: }
183: }
|