KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > nutch > plugin > ExtensionPoint


1 /*
2  * Copyright (c) 2003 The Nutch Organization. All rights reserved. Use subject
3  * to the conditions in http://www.nutch.org/LICENSE.txt.
4  */

5 package net.nutch.plugin;
6 import java.util.ArrayList JavaDoc;
7 /**
8  * The <code>ExtensionPoint</code> provide meta information of a extension
9  * point.
10  *
11  * @author joa23
12  */

13 public class ExtensionPoint {
14   private String JavaDoc ftId;
15   private String JavaDoc fName;
16   private String JavaDoc fSchema;
17   private ArrayList JavaDoc fExtensions;
18   /**
19    * Constructor
20    *
21    * @param pId
22    * unique extension point Id
23    * @param pName
24    * name of the extension poin
25    * @param pSchema
26    * xml schema of the extension point
27    */

28   public ExtensionPoint(String JavaDoc pId, String JavaDoc pName, String JavaDoc pSchema) {
29     setId(pId);
30     setName(pName);
31     setSchema(pSchema);
32     fExtensions = new ArrayList JavaDoc();
33   }
34   /**
35    * Returns the unique id of the extension point.
36    *
37    * @return String
38    */

39   public String JavaDoc getId() {
40     return ftId;
41   }
42   /**
43    * Returns the name of the extension point.
44    *
45    * @return String
46    */

47   public String JavaDoc getName() {
48     return fName;
49   }
50   /**
51    * Returns a path to the xml schema of a extension point.
52    *
53    * @return String
54    */

55   public String JavaDoc getSchema() {
56     return fSchema;
57   }
58   /**
59    * Sets the extensionPointId.
60    *
61    * @param extension point id
62    * The extensionPointId to set
63    */

64   private void setId(String JavaDoc pId) {
65     ftId = pId;
66   }
67   /**
68    * Sets the extension point name.
69    *
70    * @param extensionPointName
71    * The extensionPointName to set
72    */

73   private void setName(String JavaDoc pName) {
74     fName = pName;
75   }
76   /**
77    * Sets the schema.
78    *
79    * @param schema
80    * The schema to set
81    */

82   private void setSchema(String JavaDoc pSchema) {
83     fSchema = pSchema;
84   }
85   /**
86    * Install a coresponding extension to this extension point.
87    *
88    * @param extension
89    */

90   public void addExtension(Extension extension) {
91     fExtensions.add(extension);
92   }
93   /**
94    * Returns a array of extensions that lsiten to this extension point
95    *
96    * @return Extension[]
97    */

98   public Extension[] getExtentens() {
99     return (Extension[]) fExtensions.toArray(new Extension[fExtensions
100                                                            .size()]);
101   }
102 }
103
Popular Tags