KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > java > plugin > registry > xml > ExtensionPointImpl


1 /*****************************************************************************
2  * Java Plug-in Framework (JPF)
3  * Copyright (C) 2004-2006 Dmitry Olshansky
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *****************************************************************************/

19 package org.java.plugin.registry.xml;
20
21 import java.util.ArrayList JavaDoc;
22 import java.util.Collection JavaDoc;
23 import java.util.Collections JavaDoc;
24 import java.util.HashMap JavaDoc;
25 import java.util.HashSet JavaDoc;
26 import java.util.Iterator JavaDoc;
27 import java.util.LinkedList JavaDoc;
28 import java.util.List JavaDoc;
29 import java.util.Map JavaDoc;
30 import java.util.Set JavaDoc;
31
32 import org.java.plugin.registry.Extension;
33 import org.java.plugin.registry.ExtensionPoint;
34 import org.java.plugin.registry.Identity;
35 import org.java.plugin.registry.ManifestProcessingException;
36 import org.java.plugin.registry.PluginDescriptor;
37 import org.java.plugin.registry.PluginRegistry;
38 import org.java.plugin.registry.IntegrityCheckReport.ReportItem;
39
40 /**
41  * @version $Id: ExtensionPointImpl.java,v 1.9 2006/08/19 17:37:21 ddimon Exp $
42  */

43 class ExtensionPointImpl extends PluginElementImpl implements ExtensionPoint {
44     private final ModelExtensionPoint model;
45     private Map JavaDoc connectedExtensions;
46     private Map JavaDoc availableExtensions;
47     private List JavaDoc parameterDefinitions;
48     private Boolean JavaDoc isValid;
49     private boolean paramDefsMerged = false;
50     private List JavaDoc descendants;
51
52     ExtensionPointImpl(final PluginDescriptorImpl descr,
53             final PluginFragmentImpl aFragment,
54             final ModelExtensionPoint aModel)
55             throws ManifestProcessingException {
56         super(descr, aFragment, aModel.getId(), aModel.getDocumentation());
57         model = aModel;
58         if ((model.getParentPointId() != null)
59                 && (model.getParentPluginId() == null)) {
60             log.warn("parent plug-in ID not specified together with parent" //$NON-NLS-1$
61
+ " extension point ID, using declaring plug-in ID," //$NON-NLS-1$
62
+ " extension point is " + getUniqueId()); //$NON-NLS-1$
63
model.setParentPluginId(descr.getId());
64         }
65         parameterDefinitions = new ArrayList JavaDoc(model.getParamDefs().size());
66         Set JavaDoc names = new HashSet JavaDoc();
67         for (Iterator JavaDoc it = model.getParamDefs().iterator(); it.hasNext();) {
68             ParameterDefinitionImpl def = new ParameterDefinitionImpl(null,
69                     (ModelParameterDef) it.next());
70             if (names.contains(def.getId())) {
71                 throw new ManifestProcessingException(
72                         PluginRegistryImpl.PACKAGE_NAME,
73                         "duplicateParameterDefinition", //$NON-NLS-1$
74
new Object JavaDoc[] {def.getId(), getId(), descr.getId()});
75             }
76             names.add(def.getId());
77             parameterDefinitions.add(def);
78         }
79         parameterDefinitions =
80             Collections.unmodifiableList(parameterDefinitions);
81         if (log.isDebugEnabled()) {
82             log.debug("object instantiated: " + this); //$NON-NLS-1$
83
}
84     }
85
86     /**
87      * @see org.java.plugin.registry.UniqueIdentity#getUniqueId()
88      */

89     public String JavaDoc getUniqueId() {
90         return getDeclaringPluginDescriptor().getRegistry().makeUniqueId(
91                 getDeclaringPluginDescriptor().getId(), getId());
92     }
93     
94     /**
95      * @see org.java.plugin.registry.ExtensionPoint#getMultiplicity()
96      */

97     public String JavaDoc getMultiplicity() {
98         return model.getExtensionMultiplicity();
99     }
100
101     private void updateExtensionsLists() {
102         connectedExtensions = new HashMap JavaDoc();
103         availableExtensions = new HashMap JavaDoc();
104         for (Iterator JavaDoc it = getDeclaringPluginDescriptor().getRegistry()
105                 .getPluginDescriptors().iterator(); it.hasNext();) {
106             PluginDescriptor descr = (PluginDescriptor) it.next();
107             for (Iterator JavaDoc it2 = descr.getExtensions().iterator();
108                     it2.hasNext();) {
109                 Extension ext = (Extension) it2.next();
110                 if (getDeclaringPluginDescriptor().getId().equals(
111                         ext.getExtendedPluginId())
112                         && getId().equals(ext.getExtendedPointId())) {
113                     availableExtensions.put(ext.getUniqueId(), ext);
114                     if (ext.isValid()) {
115                         if (log.isDebugEnabled()) {
116                             log.debug("extension " + ext //$NON-NLS-1$
117
+ " connected to point " + this); //$NON-NLS-1$
118
}
119                         connectedExtensions.put(ext.getUniqueId(), ext);
120                     } else {
121                         log.warn("extension " + ext.getUniqueId() //$NON-NLS-1$
122
+ " is invalid and doesn't connected to" //$NON-NLS-1$
123
+ " extension point " + getUniqueId()); //$NON-NLS-1$
124
}
125                 }
126             }
127         }
128     }
129
130     /**
131      * @see org.java.plugin.registry.ExtensionPoint#getAvailableExtensions()
132      */

133     public Collection JavaDoc getAvailableExtensions() {
134         if (availableExtensions == null) {
135             updateExtensionsLists();
136         }
137         return Collections.unmodifiableCollection(availableExtensions.values());
138     }
139
140     /**
141      * @see org.java.plugin.registry.ExtensionPoint#getAvailableExtension(
142      * java.lang.String)
143      */

144     public Extension getAvailableExtension(final String JavaDoc uniqueId) {
145         if (availableExtensions == null) {
146             updateExtensionsLists();
147         }
148         Extension result = (Extension) availableExtensions.get(uniqueId);
149         if (result == null) {
150             throw new IllegalArgumentException JavaDoc("extension " + uniqueId //$NON-NLS-1$
151
+ " not available in point " + getUniqueId()); //$NON-NLS-1$
152
}
153         return result;
154     }
155
156     /**
157      * @see org.java.plugin.registry.ExtensionPoint#isExtensionAvailable(
158      * java.lang.String)
159      */

160     public boolean isExtensionAvailable(final String JavaDoc uniqueId) {
161         if (availableExtensions == null) {
162             updateExtensionsLists();
163         }
164         return availableExtensions.containsKey(uniqueId);
165     }
166
167     /**
168      * @see org.java.plugin.registry.ExtensionPoint#getConnectedExtensions()
169      */

170     public Collection JavaDoc getConnectedExtensions() {
171         if (connectedExtensions == null) {
172             updateExtensionsLists();
173         }
174         return Collections.unmodifiableCollection(connectedExtensions.values());
175     }
176
177     /**
178      * @see org.java.plugin.registry.ExtensionPoint#getConnectedExtension(
179      * java.lang.String)
180      */

181     public Extension getConnectedExtension(final String JavaDoc uniqueId) {
182         if (connectedExtensions == null) {
183             updateExtensionsLists();
184         }
185         Extension result = (Extension) connectedExtensions.get(uniqueId);
186         if (result == null) {
187             throw new IllegalArgumentException JavaDoc("extension " + uniqueId //$NON-NLS-1$
188
+ " not connected to point " + getUniqueId()); //$NON-NLS-1$
189
}
190         return result;
191     }
192
193     /**
194      * @see org.java.plugin.registry.ExtensionPoint#isExtensionConnected(
195      * java.lang.String)
196      */

197     public boolean isExtensionConnected(final String JavaDoc uniqueId) {
198         if (connectedExtensions == null) {
199             updateExtensionsLists();
200         }
201         return connectedExtensions.containsKey(uniqueId);
202     }
203
204     /**
205      * @see org.java.plugin.registry.ExtensionPoint#isValid()
206      */

207     public boolean isValid() {
208         if (isValid == null) {
209             validate();
210         }
211         return isValid.booleanValue();
212     }
213     
214     Collection JavaDoc validate() {
215         if ((model.getParentPluginId() != null)
216                 && (model.getParentPointId() != null)) {
217             try {
218                 if (!isExtensionPointAvailable(model.getParentPluginId(),
219                         model.getParentPointId())) {
220                     isValid = Boolean.FALSE;
221                     return Collections.singletonList(
222                             new IntegrityChecker.ReportItemImpl(
223                             ReportItem.SEVERITY_ERROR, this,
224                             ReportItem.ERROR_INVALID_EXTENSION_POINT,
225                             "parentExtPointNotAvailable", new Object JavaDoc[] { //$NON-NLS-1$
226
getDeclaringPluginDescriptor().getRegistry()
227                                 .makeUniqueId(model.getParentPluginId(),
228                                         model.getParentPointId()),
229                             getUniqueId()}));
230                 }
231             } catch (Throwable JavaDoc t) {
232                 isValid = Boolean.FALSE;
233                 if (log.isDebugEnabled()) {
234                     log.debug("failed checking availability of extension point " //$NON-NLS-1$
235
+ getDeclaringPluginDescriptor().getRegistry()
236                                 .makeUniqueId(model.getParentPluginId(),
237                                         model.getParentPointId()), t);
238                 }
239                 return Collections.singletonList(
240                         new IntegrityChecker.ReportItemImpl(
241                         ReportItem.SEVERITY_ERROR, this,
242                         ReportItem.ERROR_INVALID_EXTENSION_POINT,
243                         "parentExtPointAvailabilityCheckFailed", new Object JavaDoc[] { //$NON-NLS-1$
244
getDeclaringPluginDescriptor().getRegistry()
245                             .makeUniqueId(model.getParentPluginId(),
246                                     model.getParentPointId()),
247                         getUniqueId(), t}));
248             }
249         }
250         if (EXT_MULT_ANY.equals(getMultiplicity())) {
251             isValid = Boolean.TRUE;
252             return Collections.EMPTY_LIST;
253         } else if (EXT_MULT_ONE.equals(getMultiplicity())) {
254             isValid = Boolean.valueOf(getAvailableExtensions().size() == 1);
255             if (!isValid.booleanValue()) {
256                 return Collections.singletonList(
257                         new IntegrityChecker.ReportItemImpl(
258                         ReportItem.SEVERITY_ERROR, this,
259                         ReportItem.ERROR_INVALID_EXTENSION_POINT,
260                         "toManyOrFewExtsConnected", getUniqueId())); //$NON-NLS-1$
261
}
262         } else if (EXT_MULT_NONE.equals(getMultiplicity())) {
263             isValid = Boolean.valueOf(getAvailableExtensions().size() == 0);
264             if (!isValid.booleanValue()) {
265                 return Collections.singletonList(
266                         new IntegrityChecker.ReportItemImpl(
267                         ReportItem.SEVERITY_ERROR, this,
268                         ReportItem.ERROR_INVALID_EXTENSION_POINT,
269                         "extsConnectedToAbstractExtPoint", getUniqueId())); //$NON-NLS-1$
270
}
271         } else {
272             // MULT_ONE_PER_PLUGIN case
273
isValid = Boolean.TRUE;
274             Set JavaDoc foundPlugins = new HashSet JavaDoc();
275             for (Iterator JavaDoc it = getAvailableExtensions().iterator();
276                     it.hasNext();) {
277                 String JavaDoc pluginId = ((Extension) it.next())
278                         .getDeclaringPluginDescriptor().getId();
279                 if (!foundPlugins.add(pluginId)) {
280                     isValid = Boolean.FALSE;
281                     return Collections.singletonList(
282                             new IntegrityChecker.ReportItemImpl(
283                             ReportItem.SEVERITY_ERROR, this,
284                             ReportItem.ERROR_INVALID_EXTENSION_POINT,
285                             "toManyExtsConnected", getUniqueId())); //$NON-NLS-1$
286
}
287             }
288         }
289         return Collections.EMPTY_LIST;
290     }
291
292     private boolean isExtensionPointAvailable(final String JavaDoc pluginId,
293             final String JavaDoc pointId) {
294         PluginRegistry registry = getDeclaringPluginDescriptor().getRegistry();
295         if (!registry.isPluginDescriptorAvailable(pluginId)) {
296             return false;
297         }
298         for (Iterator JavaDoc it = registry.getPluginDescriptor(pluginId)
299                 .getExtensionPoints().iterator(); it.hasNext();) {
300             if (((ExtensionPoint) it.next()).getId().equals(pointId)) {
301                 return true;
302             }
303         }
304         return false;
305     }
306     
307     /**
308      * @see org.java.plugin.registry.ExtensionPoint#getParameterDefinitions()
309      */

310     public Collection JavaDoc getParameterDefinitions() {
311         if ((model.getParentPluginId() == null)
312                 || (model.getParentPointId() == null) || paramDefsMerged) {
313             return parameterDefinitions;
314         }
315         Set JavaDoc names = new HashSet JavaDoc();
316         Collection JavaDoc parentParamDefs =
317             getDeclaringPluginDescriptor().getRegistry().getExtensionPoint(
318                     model.getParentPluginId(), model.getParentPointId())
319                     .getParameterDefinitions();
320         List JavaDoc newParamDefs = new ArrayList JavaDoc(parameterDefinitions.size()
321                 + parentParamDefs.size());
322         for (Iterator JavaDoc it = parameterDefinitions.iterator(); it.hasNext();) {
323             ParameterDefinition def = (ParameterDefinition) it.next();
324             names.add(def.getId());
325             newParamDefs.add(def);
326         }
327         for (Iterator JavaDoc it = parentParamDefs.iterator(); it.hasNext();) {
328             ParameterDefinition def = (ParameterDefinition) it.next();
329             if (names.contains(def.getId())) {
330                 continue;
331             }
332             newParamDefs.add(def);
333         }
334         paramDefsMerged = true;
335         parameterDefinitions = Collections.unmodifiableList(newParamDefs);
336         return parameterDefinitions;
337     }
338     
339     /**
340      * @see org.java.plugin.registry.ExtensionPoint#getParameterDefinition(
341      * java.lang.String)
342      */

343     public ParameterDefinition getParameterDefinition(final String JavaDoc id) {
344         for (Iterator JavaDoc it = getParameterDefinitions().iterator();
345                 it.hasNext();) {
346             ParameterDefinitionImpl def = (ParameterDefinitionImpl) it.next();
347             if (def.getId().equals(id)) {
348                 return def;
349             }
350         }
351         throw new IllegalArgumentException JavaDoc("parameter definition with ID " + id //$NON-NLS-1$
352
+ " not found in extension point " + getUniqueId() //$NON-NLS-1$
353
+ " and all it parents"); //$NON-NLS-1$
354
}
355
356     /**
357      * @see org.java.plugin.registry.ExtensionPoint#getParentPluginId()
358      */

359     public String JavaDoc getParentPluginId() {
360         return model.getParentPluginId();
361     }
362
363     /**
364      * @see org.java.plugin.registry.ExtensionPoint#getParentExtensionPointId()
365      */

366     public String JavaDoc getParentExtensionPointId() {
367         return model.getParentPointId();
368     }
369
370     /**
371      * @see org.java.plugin.registry.ExtensionPoint#isSuccessorOf(
372      * org.java.plugin.registry.ExtensionPoint)
373      */

374     public boolean isSuccessorOf(final ExtensionPoint extensionPoint) {
375         if ((model.getParentPluginId() == null)
376                 || (model.getParentPointId() == null)) {
377             return false;
378         }
379         if (model.getParentPluginId().equals(
380                 extensionPoint.getDeclaringPluginDescriptor().getId())
381                 && model.getParentPointId().equals(extensionPoint.getId())) {
382             return true;
383         }
384         try {
385             return getDeclaringPluginDescriptor().getRegistry()
386                 .getExtensionPoint(model.getParentPluginId(),
387                         model.getParentPointId()).isSuccessorOf(extensionPoint);
388         } catch (IllegalArgumentException JavaDoc iae) {
389             return false;
390         }
391     }
392
393     private void collectDescendants() {
394         descendants = new LinkedList JavaDoc();
395         for (Iterator JavaDoc it = getDeclaringPluginDescriptor().getRegistry()
396                 .getPluginDescriptors().iterator(); it.hasNext();) {
397             PluginDescriptor descr = (PluginDescriptor) it.next();
398             for (Iterator JavaDoc it2 = descr.getExtensionPoints().iterator();
399                     it2.hasNext();) {
400                 ExtensionPoint extp = (ExtensionPoint) it2.next();
401                 if (extp.isSuccessorOf(this)) {
402                     if (log.isDebugEnabled()) {
403                         log.debug("extension point " + extp //$NON-NLS-1$
404
+ " is descendant of point " + this); //$NON-NLS-1$
405
}
406                     descendants.add(extp);
407                 }
408             }
409         }
410         descendants = Collections.unmodifiableList(descendants);
411     }
412
413     /**
414      * @see org.java.plugin.registry.ExtensionPoint#getDescendants()
415      */

416     public Collection JavaDoc getDescendants() {
417         if (descendants == null) {
418             collectDescendants();
419         }
420         return descendants;
421     }
422
423     /**
424      * @see java.lang.Object#toString()
425      */

426     public String JavaDoc toString() {
427         return "{ExtensionPoint: uid=" + getUniqueId() + "}"; //$NON-NLS-1$ //$NON-NLS-2$
428
}
429     
430     void registryChanged() {
431         isValid = null;
432         connectedExtensions = null;
433         availableExtensions = null;
434         descendants = null;
435     }
436     
437     class ParameterDefinitionImpl extends PluginElementImpl
438             implements ParameterDefinition {
439         private List JavaDoc subDefinitions;
440         private final ParameterDefinitionImpl superDefinition;
441         private final ModelParameterDef modelParamDef;
442         private final ParameterValueParser valueParser;
443
444         ParameterDefinitionImpl(final ParameterDefinitionImpl aSuperDefinition,
445                 final ModelParameterDef aModel)
446                 throws ManifestProcessingException {
447             super(ExtensionPointImpl.this.getDeclaringPluginDescriptor(),
448                     ExtensionPointImpl.this.getDeclaringPluginFragment(),
449                     aModel.getId(), aModel.getDocumentation());
450             superDefinition = aSuperDefinition;
451             modelParamDef = aModel;
452             checkType();
453             checkMultiplicity();
454             valueParser = new ParameterValueParser(
455                     getDeclaringPluginDescriptor().getRegistry(), this,
456                     modelParamDef.getDefaultValue());
457             if (!valueParser.isParsingSucceeds()) {
458                 log.warn("parsing default value for parameter definition " //$NON-NLS-1$
459
+ this + " failed, message is: " //$NON-NLS-1$
460
+ valueParser.getParsingMessage());
461                 throw new ManifestProcessingException(
462                         PluginRegistryImpl.PACKAGE_NAME,
463                         "invalidDefaultValueAttribute", //$NON-NLS-1$
464
new Object JavaDoc[] {modelParamDef.getDefaultValue(),
465                             ExtensionPointImpl.this.getId(),
466                             ExtensionPointImpl.this
467                                 .getDeclaringPluginDescriptor().getId()});
468             }
469             if (TYPE_ANY.equals(modelParamDef.getType())) {
470                 subDefinitions = Collections.EMPTY_LIST;
471             } else {
472                 subDefinitions = new ArrayList JavaDoc(
473                         modelParamDef.getParamDefs().size());
474                 Set JavaDoc names = new HashSet JavaDoc();
475                 for (Iterator JavaDoc it = modelParamDef.getParamDefs().iterator();
476                         it.hasNext();) {
477                     ParameterDefinitionImpl def = new ParameterDefinitionImpl(
478                             this, (ModelParameterDef) it.next());
479                     if (names.contains(def.getId())) {
480                         throw new ManifestProcessingException(
481                                 PluginRegistryImpl.PACKAGE_NAME,
482                                 "duplicateParameterDefinition", //$NON-NLS-1$
483
new Object JavaDoc[] {def.getId(),
484                                     ExtensionPointImpl.this.getId(),
485                                     ExtensionPointImpl.this.
486                                     getDeclaringPluginDescriptor().getId()});
487                     }
488                     names.add(def.getId());
489                     subDefinitions.add(def);
490                 }
491                 subDefinitions = Collections.unmodifiableList(subDefinitions);
492             }
493             if (log.isDebugEnabled()) {
494                 log.debug("object instantiated: " + this); //$NON-NLS-1$
495
}
496         }
497
498         private void checkType() throws ManifestProcessingException {
499             String JavaDoc type = modelParamDef.getType();
500             if (!TYPE_STRING.equals(type)
501                     && !TYPE_BOOLEAN.endsWith(type)
502                     && !TYPE_NUMBER.equals(type)
503                     && !TYPE_DATE.equals(type)
504                     && !TYPE_TIME.equals(type)
505                     && !TYPE_DATETIME.equals(type)
506                     && !TYPE_NULL.equals(type)
507                     && !TYPE_ANY.equals(type)
508                     && !TYPE_PLUGIN_ID.equals(type)
509                     && !TYPE_EXTENSION_POINT_ID.equals(type)
510                     && !TYPE_EXTENSION_ID.equals(type)
511                     && !TYPE_FIXED.equals(type)
512                     && !TYPE_RESOURCE.equals(type)) {
513                 throw new ManifestProcessingException(
514                         PluginRegistryImpl.PACKAGE_NAME,
515                         "invalidTypeAttribute", //$NON-NLS-1$
516
new Object JavaDoc[] {type, ExtensionPointImpl.this.getId(),
517                             ExtensionPointImpl.this
518                                 .getDeclaringPluginDescriptor().getId()});
519             }
520         }
521
522         private void checkMultiplicity() throws ManifestProcessingException {
523             String JavaDoc multiplicity = modelParamDef.getMultiplicity();
524             if (!MULT_ONE.equals(multiplicity)
525                     && !MULT_ANY.equals(multiplicity)
526                     && !MULT_NONE_OR_ONE.equals(multiplicity)
527                     && !MULT_ONE_OR_MORE.equals(multiplicity)) {
528                 throw new ManifestProcessingException(
529                         PluginRegistryImpl.PACKAGE_NAME,
530                         "invalidMultiplicityAttribute", //$NON-NLS-1$
531
new Object JavaDoc[] {multiplicity,
532                             ExtensionPointImpl.this.getId(),
533                             ExtensionPointImpl.this
534                                 .getDeclaringPluginDescriptor().getId()});
535             }
536         }
537         
538         ParameterValueParser getValueParser() {
539             return valueParser;
540         }
541         
542         /**
543          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
544          * #getDeclaringExtensionPoint()
545          */

546         public ExtensionPoint getDeclaringExtensionPoint() {
547             return ExtensionPointImpl.this;
548         }
549
550         /**
551          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
552          * #getMultiplicity()
553          */

554         public String JavaDoc getMultiplicity() {
555             return modelParamDef.getMultiplicity();
556         }
557
558         /**
559          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
560          * #getSubDefinitions()
561          */

562         public Collection JavaDoc getSubDefinitions() {
563             return subDefinitions;
564         }
565
566         /**
567          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
568          * #getSuperDefinition()
569          */

570         public ParameterDefinition getSuperDefinition() {
571             return superDefinition;
572         }
573         
574         /**
575          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
576          * #getSubDefinition(java.lang.String)
577          */

578         public ParameterDefinition getSubDefinition(final String JavaDoc id) {
579             for (Iterator JavaDoc it = subDefinitions.iterator(); it.hasNext();) {
580                 ParameterDefinitionImpl def =
581                     (ParameterDefinitionImpl) it.next();
582                 if (def.getId().equals(id)) {
583                     return def;
584                 }
585             }
586             throw new IllegalArgumentException JavaDoc(
587                     "parameter definition with ID " + id //$NON-NLS-1$
588
+ " not found in extension point " + getUniqueId()); //$NON-NLS-1$
589
}
590
591         /**
592          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition#getType()
593          */

594         public String JavaDoc getType() {
595             return modelParamDef.getType();
596         }
597
598         /**
599          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
600          * #getCustomData()
601          */

602         public String JavaDoc getCustomData() {
603             return modelParamDef.getCustomData();
604         }
605         
606         /**
607          * @see org.java.plugin.registry.ExtensionPoint.ParameterDefinition
608          * #getDefaultValue()
609          */

610         public String JavaDoc getDefaultValue() {
611             return modelParamDef.getDefaultValue();
612         }
613         
614         /**
615          * @see java.lang.Object#toString()
616          */

617         public String JavaDoc toString() {
618             return "{PluginExtensionPoint.ParameterDefinition: extPointUid=" //$NON-NLS-1$
619
+ getDeclaringExtensionPoint().getUniqueId() + "; id=" + getId() //$NON-NLS-1$
620
+ "}"; //$NON-NLS-1$
621
}
622         
623         /**
624          * @see org.java.plugin.registry.xml.IdentityImpl#isEqualTo(
625          * org.java.plugin.registry.Identity)
626          */

627         protected boolean isEqualTo(final Identity idt) {
628             if (!super.isEqualTo(idt)) {
629                 return false;
630             }
631             ParameterDefinitionImpl other = (ParameterDefinitionImpl) idt;
632             if ((getSuperDefinition() == null)
633                     && (other.getSuperDefinition() == null)) {
634                 return true;
635             }
636             if ((getSuperDefinition() == null)
637                     || (other.getSuperDefinition() == null)) {
638                 return false;
639             }
640             return getSuperDefinition().equals(other.getSuperDefinition());
641         }
642     }
643 }
644
Popular Tags