Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PluginLoader.java
1 package org.bukkit.plugin;
2 
3 import java.io.File;
4 import java.util.Map;
5 import java.util.Set;
6 import java.util.regex.Pattern;
7 
8 import org.bukkit.event.Event;
9 import org.bukkit.event.Listener;
10 
11 /**
12  * Represents a plugin loader, which handles direct access to specific types
13  * of plugins
14  */
15 public interface PluginLoader {
16 
17  /**
18  * Loads the plugin contained in the specified file
19  *
20  * @param file File to attempt to load
21  * @return Plugin that was contained in the specified file, or null if
22  * unsuccessful
23  * @throws InvalidPluginException Thrown when the specified file is not a
24  * plugin
25  * @throws UnknownDependencyException If a required dependency could not
26  * be found
27  */
29 
30  /**
31  * Loads a PluginDescriptionFile from the specified file
32  *
33  * @param file File to attempt to load from
34  * @return A new PluginDescriptionFile loaded from the plugin.yml in the
35  * specified file
36  * @throws InvalidDescriptionException If the plugin description file
37  * could not be created
38  */
40 
41  /**
42  * Returns a list of all filename filters expected by this PluginLoader
43  *
44  * @return The filters
45  */
46  public Pattern[] getPluginFileFilters();
47 
48  /**
49  * Creates and returns registered listeners for the event classes used in
50  * this listener
51  *
52  * @param listener The object that will handle the eventual call back
53  * @param plugin The plugin to use when creating registered listeners
54  * @return The registered listeners.
55  */
56  public Map<Class<? extends Event>, Set<RegisteredListener>> createRegisteredListeners(Listener listener, Plugin plugin);
57 
58  /**
59  * Enables the specified plugin
60  * <p>
61  * Attempting to enable a plugin that is already enabled will have no
62  * effect
63  *
64  * @param plugin Plugin to enable
65  */
66  public void enablePlugin(Plugin plugin);
67 
68  /**
69  * Disables the specified plugin
70  * <p>
71  * Attempting to disable a plugin that is not enabled will have no effect
72  *
73  * @param plugin Plugin to disable
74  */
75  public void disablePlugin(Plugin plugin);
76 }
PluginDescriptionFile getPluginDescription(File file)
Plugin loadPlugin(File file)
void enablePlugin(Plugin plugin)
Map< Class<?extends Event >, Set< RegisteredListener > > createRegisteredListeners(Listener listener, Plugin plugin)
void disablePlugin(Plugin plugin)