Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
HelpMap.java
1 package org.bukkit.help;
2 
3 import java.util.Collection;
4 import java.util.List;
5 
6 /**
7  * The HelpMap tracks all help topics registered in a Bukkit server. When the
8  * server starts up or is reloaded, help is processed and topics are added in
9  * the following order:
10  * <p>
11  * <ol>
12  * <li>General topics are loaded from the help.yml
13  * <li>Plugins load and optionally call {@code addTopic()}
14  * <li>Registered plugin commands are processed by {@link HelpTopicFactory}
15  * objects to create topics
16  * <li>Topic contents are amended as directed in help.yml
17  * </ol>
18  */
19 public interface HelpMap {
20  /**
21  * Returns a help topic for a given topic name.
22  *
23  * @param topicName The help topic name to look up.
24  * @return A {@link HelpTopic} object matching the topic name or null if
25  * none can be found.
26  */
27  public HelpTopic getHelpTopic(String topicName);
28 
29  /**
30  * Returns a collection of all the registered help topics.
31  *
32  * @return All the registered help topics.
33  */
34  public Collection<HelpTopic> getHelpTopics();
35 
36  /**
37  * Adds a topic to the server's help index.
38  *
39  * @param topic The new help topic to add.
40  */
41  public void addTopic(HelpTopic topic);
42 
43  /**
44  * Clears out the contents of the help index. Normally called during
45  * server reload.
46  */
47  public void clear();
48 
49  /**
50  * Associates a {@link HelpTopicFactory} object with given command base
51  * class. Plugins typically call this method during {@code onLoad()}. Once
52  * registered, the custom HelpTopicFactory will be used to create a custom
53  * {@link HelpTopic} for all commands deriving from the {@code
54  * commandClass} base class, or all commands deriving from {@link
55  * org.bukkit.command.PluginCommand} who's executor derives from {@code
56  * commandClass} base class.
57  *
58  * @param commandClass The class for which the custom HelpTopicFactory
59  * applies. Must derive from either {@link org.bukkit.command.Command}
60  * or {@link org.bukkit.command.CommandExecutor}.
61  * @param factory The {@link HelpTopicFactory} implementation to associate
62  * with the {@code commandClass}.
63  * @throws IllegalArgumentException Thrown if {@code commandClass} does
64  * not derive from a legal base class.
65  */
66  public void registerHelpTopicFactory(Class<?> commandClass, HelpTopicFactory<?> factory);
67 
68  /**
69  * Gets the list of plugins the server administrator has chosen to exclude
70  * from the help index. Plugin authors who choose to directly extend
71  * {@link org.bukkit.command.Command} instead of {@link
72  * org.bukkit.command.PluginCommand} will need to check this collection in
73  * their {@link HelpTopicFactory} implementations to ensure they meet the
74  * server administrator's expectations.
75  *
76  * @return A list of plugins that should be excluded from the help index.
77  */
78  public List<String> getIgnoredPlugins();
79 }
Collection< HelpTopic > getHelpTopics()
List< String > getIgnoredPlugins()
HelpTopic getHelpTopic(String topicName)
void addTopic(HelpTopic topic)
void registerHelpTopicFactory(Class<?> commandClass, HelpTopicFactory<?> factory)