View Javadoc

1   package com.atlassian.plugin.parsers;
2   
3   import com.atlassian.plugin.Plugin;
4   import com.atlassian.plugin.ModuleDescriptorFactory;
5   import com.atlassian.plugin.PluginParseException;
6   
7   /**
8    * Interface for parsing a plugin descriptor file, e.g. atlassian-plugin.xml.
9    *
10   * @see XmlDescriptorParser
11   * @see DescriptorParserFactory
12   */
13  public interface DescriptorParser
14  {
15      /**
16       * Sets the configuration on the plugin argument to match the configuration specified in the
17       * plugin descriptor (typically an XML file).
18       *
19       * @param moduleDescriptorFactory a factory for instantiating the required plugin modules
20       * @param plugin the plugin whose configuration will be modified
21       * @return the original plugin with the configuration changed and the module descriptors added
22       * @throws PluginParseException if there was an error getting information about the plugin
23       */
24      Plugin configurePlugin(ModuleDescriptorFactory moduleDescriptorFactory, Plugin plugin) throws PluginParseException;
25  
26      /**
27       * @return the key of the plugin specified in the descriptor
28       */
29      String getKey();
30  
31      /**
32       * @return true if this plugin is marked as a system plugin in the descriptor. This should only be
33       * acted on by plugin loaders which can trust their plugins implicitly (e.g. a classpath plugin
34       * loader).
35       */
36      boolean isSystemPlugin();
37  
38      /**
39       * @return The version of the plugin system expected by this plugin.  If unknown, it is assumed to be 1.
40       */
41      int getPluginsVersion();
42  }