View Javadoc

1   package net.sourceforge.blogentis.plugins;
2   
3   //-----------------------------------------------------------------------
4   //Blogentis - a blog publishing platform.
5   //Copyright (C) 2004 Tassos Bassoukos <abassouk@gmail.com>
6   //
7   //This library is free software; you can redistribute it and/or
8   //modify it under the terms of the GNU Lesser General Public
9   //License as published by the Free Software Foundation; either
10  //version 2.1 of the License, or (at your option) any later version.
11  //
12  //This library is distributed in the hope that it will be useful,
13  //but WITHOUT ANY WARRANTY; without even the implied warranty of
14  //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  //Lesser General Public License for more details.
16  //
17  //You should have received a copy of the GNU Lesser General Public
18  //License along with this library; if not, write to the Free Software
19  //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  //-----------------------------------------------------------------------
21  //
22  //$Id: IExtensionPoint.java,v 1.1 2004/10/22 17:34:14 tassos Exp $
23  //
24  
25  import java.util.Iterator;
26  
27  /***
28   * Interface for extension points. No actual functionality is defined here, it
29   * is expected to be provided by the implementors of this interface.
30   * 
31   * @author abas
32   */
33  public interface IExtensionPoint {
34      /***
35       * Get the user-visible name of this extension point.
36       * 
37       * @return the name of this extension point.
38       */
39      public String getName();
40      
41      /***
42       * Get the plugin that defines this extension point.
43       * 
44       * @return The plugin that defines this extension.
45       */
46      public IPlugin getPlugin();
47      
48      /***
49       * Get the class or interface that extensions for this extension point have
50       * to implement.
51       * 
52       * @return this extension points' appropriate base class or inteface.
53       */
54      public Class getExtensionClass();
55  
56      /***
57       * Add an extension to this extension point.
58       * 
59       * @param extension
60       *            the extension to add.
61       */
62      public void addExtension(IExtension extension);
63  
64      /***
65       * Remove an extension from this extension point.
66       * 
67       * @param extension
68       *            the extension to remove.
69       */
70      public void removeExtension(IExtension extension);
71  
72      /***
73       * Remove all extensions that belong to this plugin.
74       * 
75       * @param plugin
76       *            the plugin whose extensions should be removed.
77       */
78      public void removeExtensions(IPlugin plugin);
79  
80      /***
81       * Get the list of extensions that have been registered with this extension
82       * point. Depending on the extension point, order may be significant.
83       * 
84       * @return the list of extensions.
85       */
86      public Iterator getExtensions();
87  }