KickJava   Java API By Example, From Geeks To Geeks.

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


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.LinkedList JavaDoc;
22 import java.util.List JavaDoc;
23
24 import org.java.plugin.registry.ExtensionPoint;
25 import org.java.plugin.registry.PluginPrerequisite;
26 import org.java.plugin.registry.Version;
27
28 /**
29  * @version $Id: Model.java,v 1.6 2006/08/19 17:37:21 ddimon Exp $
30  */

31 abstract class ModelPluginManifest {
32     private String JavaDoc id;
33     private Version version;
34     private String JavaDoc vendor;
35     private String JavaDoc docsPath;
36     private ModelDocumentation documentation;
37     private LinkedList JavaDoc attributes = new LinkedList JavaDoc();
38     private LinkedList JavaDoc prerequisites = new LinkedList JavaDoc();
39     private LinkedList JavaDoc libraries = new LinkedList JavaDoc();
40     private LinkedList JavaDoc extensionPoints = new LinkedList JavaDoc();
41     private LinkedList JavaDoc extensions = new LinkedList JavaDoc();
42     
43     String JavaDoc getDocsPath() {
44         return docsPath;
45     }
46     
47     void setDocsPath(final String JavaDoc value) {
48         docsPath = value;
49     }
50     
51     ModelDocumentation getDocumentation() {
52         return documentation;
53     }
54     
55     void setDocumentation(final ModelDocumentation value) {
56         documentation = value;
57     }
58     
59     String JavaDoc getId() {
60         return id;
61     }
62     
63     void setId(final String JavaDoc value) {
64         id = value;
65     }
66     
67     String JavaDoc getVendor() {
68         return vendor;
69     }
70     
71     void setVendor(final String JavaDoc value) {
72         vendor = value;
73     }
74     
75     Version getVersion() {
76         return version;
77     }
78     
79     void setVersion(final String JavaDoc value) {
80         version = Version.parse(value);
81     }
82     
83     List JavaDoc getAttributes() {
84         return attributes;
85     }
86     
87     List JavaDoc getExtensionPoints() {
88         return extensionPoints;
89     }
90     
91     List JavaDoc getExtensions() {
92         return extensions;
93     }
94     
95     List JavaDoc getLibraries() {
96         return libraries;
97     }
98     
99     List JavaDoc getPrerequisites() {
100         return prerequisites;
101     }
102 }
103
104 final class ModelPluginDescriptor extends ModelPluginManifest {
105     private String JavaDoc className;
106     
107     ModelPluginDescriptor() {
108        // no-op
109
}
110     
111     String JavaDoc getClassName() {
112         return className;
113     }
114     
115     void setClassName(final String JavaDoc value) {
116         className = value;
117     }
118 }
119
120 final class ModelPluginFragment extends ModelPluginManifest {
121     private String JavaDoc pluginId;
122     private Version pluginVersion;
123     private String JavaDoc match = PluginPrerequisite.MATCH_COMPATIBLE;
124     
125     ModelPluginFragment() {
126         // no-op
127
}
128     
129     String JavaDoc getMatch() {
130         return match;
131     }
132     
133     void setMatch(final String JavaDoc value) {
134         match = value;
135     }
136     
137     String JavaDoc getPluginId() {
138         return pluginId;
139     }
140     
141     void setPluginId(final String JavaDoc value) {
142         pluginId = value;
143     }
144     
145     Version getPluginVersion() {
146         return pluginVersion;
147     }
148     
149     void setPluginVersion(final String JavaDoc value) {
150         pluginVersion = Version.parse(value);
151     }
152 }
153
154 final class ModelDocumentation {
155     private LinkedList JavaDoc references = new LinkedList JavaDoc();
156     private String JavaDoc caption;
157     private String JavaDoc text;
158     
159     ModelDocumentation() {
160         // no-op
161
}
162     
163     String JavaDoc getCaption() {
164         return caption;
165     }
166     
167     void setCaption(final String JavaDoc value) {
168         caption = value;
169     }
170     
171     String JavaDoc getText() {
172         return text;
173     }
174     
175     void setText(final String JavaDoc value) {
176         text = value;
177     }
178     
179     List JavaDoc getReferences() {
180         return references;
181     }
182 }
183
184 final class ModelDocumentationReference {
185     private String JavaDoc path;
186     private String JavaDoc caption;
187     
188     ModelDocumentationReference() {
189         // no-op
190
}
191     
192     String JavaDoc getCaption() {
193         return caption;
194     }
195     
196     void setCaption(final String JavaDoc value) {
197         caption = value;
198     }
199     
200     String JavaDoc getPath() {
201         return path;
202     }
203     
204     void setPath(final String JavaDoc value) {
205         path = value;
206     }
207 }
208
209 final class ModelAttribute {
210     private String JavaDoc id;
211     private String JavaDoc value;
212     private ModelDocumentation documentation;
213     private LinkedList JavaDoc attributes = new LinkedList JavaDoc();
214     
215     ModelAttribute() {
216         // no-op
217
}
218     
219     ModelDocumentation getDocumentation() {
220         return documentation;
221     }
222     
223     void setDocumentation(final ModelDocumentation aValue) {
224         documentation = aValue;
225     }
226     
227     String JavaDoc getId() {
228         return id;
229     }
230     
231     void setId(final String JavaDoc aValue) {
232         id = aValue;
233     }
234     
235     String JavaDoc getValue() {
236         return value;
237     }
238     
239     void setValue(final String JavaDoc aValue) {
240         value = aValue;
241     }
242     
243     List JavaDoc getAttributes() {
244         return attributes;
245     }
246 }
247
248 final class ModelPrerequisite {
249     private String JavaDoc id;
250     private String JavaDoc pluginId;
251     private Version pluginVersion;
252     private String JavaDoc match = "compatible"; //$NON-NLS-1$
253
private ModelDocumentation documentation;
254     private boolean isExported;
255     private boolean isOptional;
256     private boolean isReverseLookup;
257     
258     ModelPrerequisite() {
259         // no-op
260
}
261     
262     ModelDocumentation getDocumentation() {
263         return documentation;
264     }
265     
266     void setDocumentation(final ModelDocumentation value) {
267         documentation = value;
268     }
269     
270     String JavaDoc getId() {
271         return id;
272     }
273     
274     void setId(final String JavaDoc value) {
275         id = value;
276     }
277     
278     boolean isExported() {
279         return isExported;
280     }
281     
282     void setExported(final String JavaDoc value) {
283         isExported = "true".equals(value); //$NON-NLS-1$
284
}
285     
286     boolean isOptional() {
287         return isOptional;
288     }
289     
290     void setOptional(final String JavaDoc value) {
291         isOptional = "true".equals(value); //$NON-NLS-1$
292
}
293     
294     boolean isReverseLookup() {
295         return isReverseLookup;
296     }
297     
298     void setReverseLookup(final String JavaDoc value) {
299         isReverseLookup = "true".equals(value); //$NON-NLS-1$
300
}
301     
302     String JavaDoc getMatch() {
303         return match;
304     }
305     
306     void setMatch(final String JavaDoc value) {
307         match = value;
308     }
309     
310     String JavaDoc getPluginId() {
311         return pluginId;
312     }
313     
314     void setPluginId(final String JavaDoc value) {
315         pluginId = value;
316     }
317     
318     Version getPluginVersion() {
319         return pluginVersion;
320     }
321     
322     void setPluginVersion(final String JavaDoc value) {
323         pluginVersion = Version.parse(value);
324     }
325 }
326
327 final class ModelLibrary {
328     private String JavaDoc id;
329     private String JavaDoc path;
330     private boolean isCodeLibrary;
331     private ModelDocumentation documentation;
332     private LinkedList JavaDoc exports = new LinkedList JavaDoc();
333     private Version version;
334     
335     ModelLibrary() {
336         // no-op
337
}
338     
339     ModelDocumentation getDocumentation() {
340         return documentation;
341     }
342     
343     void setDocumentation(final ModelDocumentation value) {
344         documentation = value;
345     }
346     
347     String JavaDoc getId() {
348         return id;
349     }
350     
351     void setId(final String JavaDoc value) {
352         id = value;
353     }
354     
355     boolean isCodeLibrary() {
356         return isCodeLibrary;
357     }
358     
359     void setCodeLibrary(final String JavaDoc value) {
360         isCodeLibrary = "code".equals(value); //$NON-NLS-1$
361
}
362     
363     String JavaDoc getPath() {
364         return path;
365     }
366     
367     void setPath(final String JavaDoc value) {
368         path = value;
369     }
370     
371     List JavaDoc getExports() {
372         return exports;
373     }
374     
375     Version getVersion() {
376         return version;
377     }
378     
379     void setVersion(final String JavaDoc value) {
380         version = Version.parse(value);
381     }
382 }
383
384 final class ModelExtensionPoint {
385     private String JavaDoc id;
386     private String JavaDoc parentPluginId;
387     private String JavaDoc parentPointId;
388     private String JavaDoc extensionMultiplicity = ExtensionPoint.EXT_MULT_ONE;
389     private ModelDocumentation documentation;
390     private LinkedList JavaDoc paramDefs = new LinkedList JavaDoc();
391
392     ModelExtensionPoint() {
393         // no-op
394
}
395     
396     ModelDocumentation getDocumentation() {
397         return documentation;
398     }
399     
400     void setDocumentation(final ModelDocumentation value) {
401         documentation = value;
402     }
403     
404     String JavaDoc getExtensionMultiplicity() {
405         return extensionMultiplicity;
406     }
407     
408     void setExtensionMultiplicity(final String JavaDoc value) {
409         extensionMultiplicity = value;
410     }
411     
412     String JavaDoc getId() {
413         return id;
414     }
415     
416     void setId(final String JavaDoc value) {
417         id = value;
418     }
419     
420     String JavaDoc getParentPluginId() {
421         return parentPluginId;
422     }
423     
424     void setParentPluginId(final String JavaDoc value) {
425         parentPluginId = value;
426     }
427     
428     String JavaDoc getParentPointId() {
429         return parentPointId;
430     }
431     
432     void setParentPointId(final String JavaDoc value) {
433         parentPointId = value;
434     }
435     
436     List JavaDoc getParamDefs() {
437         return paramDefs;
438     }
439 }
440
441 final class ModelParameterDef {
442     private String JavaDoc id;
443     private String JavaDoc multiplicity = ExtensionPoint.ParameterDefinition.MULT_ONE;
444     private String JavaDoc type = ExtensionPoint.ParameterDefinition.TYPE_STRING;
445     private String JavaDoc customData;
446     private ModelDocumentation documentation;
447     private LinkedList JavaDoc paramDefs = new LinkedList JavaDoc();
448     private String JavaDoc defaultValue;
449     
450     ModelParameterDef() {
451         // no-op
452
}
453     
454     String JavaDoc getCustomData() {
455         return customData;
456     }
457     
458     void setCustomData(final String JavaDoc value) {
459         customData = value;
460     }
461     
462     ModelDocumentation getDocumentation() {
463         return documentation;
464     }
465     
466     void setDocumentation(final ModelDocumentation value) {
467         documentation = value;
468     }
469     
470     String JavaDoc getId() {
471         return id;
472     }
473     
474     void setId(final String JavaDoc value) {
475         id = value;
476     }
477     
478     String JavaDoc getMultiplicity() {
479         return multiplicity;
480     }
481     
482     void setMultiplicity(final String JavaDoc value) {
483         multiplicity = value;
484     }
485     
486     String JavaDoc getType() {
487         return type;
488     }
489     
490     void setType(final String JavaDoc value) {
491         type = value;
492     }
493     
494     List JavaDoc getParamDefs() {
495         return paramDefs;
496     }
497     
498     String JavaDoc getDefaultValue() {
499         return defaultValue;
500     }
501     
502     void setDefaultValue(final String JavaDoc value) {
503         defaultValue = value;
504     }
505 }
506
507 final class ModelExtension {
508     private String JavaDoc id;
509     private String JavaDoc pluginId;
510     private String JavaDoc pointId;
511     private ModelDocumentation documentation;
512     private LinkedList JavaDoc params = new LinkedList JavaDoc();
513     
514     ModelExtension() {
515         // no-op
516
}
517     
518     ModelDocumentation getDocumentation() {
519         return documentation;
520     }
521     
522     void setDocumentation(final ModelDocumentation value) {
523         documentation = value;
524     }
525     
526     String JavaDoc getId() {
527         return id;
528     }
529     
530     void setId(final String JavaDoc value) {
531         id = value;
532     }
533     
534     String JavaDoc getPluginId() {
535         return pluginId;
536     }
537     
538     void setPluginId(final String JavaDoc value) {
539         pluginId = value;
540     }
541     
542     String JavaDoc getPointId() {
543         return pointId;
544     }
545     
546     void setPointId(final String JavaDoc value) {
547         pointId = value;
548     }
549     
550     List JavaDoc getParams() {
551         return params;
552     }
553 }
554
555 final class ModelParameter {
556     private String JavaDoc id;
557     private String JavaDoc value;
558     private ModelDocumentation documentation;
559     private LinkedList JavaDoc params = new LinkedList JavaDoc();
560     
561     ModelParameter() {
562         // no-op
563
}
564     
565     ModelDocumentation getDocumentation() {
566         return documentation;
567     }
568     
569     void setDocumentation(final ModelDocumentation aValue) {
570         documentation = aValue;
571     }
572     
573     String JavaDoc getId() {
574         return id;
575     }
576     
577     void setId(final String JavaDoc aValue) {
578         id = aValue;
579     }
580     
581     String JavaDoc getValue() {
582         return value;
583     }
584     
585     void setValue(final String JavaDoc aValue) {
586         value = aValue;
587     }
588     
589     List JavaDoc getParams() {
590         return params;
591     }
592 }
593
594 final class ModelManifestInfo {
595     private String JavaDoc id;
596     private Version version;
597     private String JavaDoc vendor;
598     private String JavaDoc pluginId;
599     private Version pluginVersion;
600     private String JavaDoc match = PluginPrerequisite.MATCH_COMPATIBLE;
601     
602     ModelManifestInfo() {
603         // no-op
604
}
605     
606     String JavaDoc getId() {
607         return id;
608     }
609     
610     void setId(final String JavaDoc value) {
611         id = value;
612     }
613     
614     String JavaDoc getVendor() {
615         return vendor;
616     }
617     
618     void setVendor(final String JavaDoc value) {
619         vendor = value;
620     }
621     
622     Version getVersion() {
623         return version;
624     }
625     
626     void setVersion(final String JavaDoc value) {
627         version = Version.parse(value);
628     }
629     
630     String JavaDoc getMatch() {
631         return match;
632     }
633     
634     void setMatch(final String JavaDoc value) {
635         match = value;
636     }
637     
638     String JavaDoc getPluginId() {
639         return pluginId;
640     }
641     
642     void setPluginId(final String JavaDoc value) {
643         pluginId = value;
644     }
645     
646     Version getPluginVersion() {
647         return pluginVersion;
648     }
649     
650     void setPluginVersion(final String JavaDoc value) {
651         pluginVersion = Version.parse(value);
652     }
653 }
654
Popular Tags