Interface DescriptorParser

All Known Implementing Classes:
XmlDescriptorParser

public interface DescriptorParser
Interface for parsing a plugin descriptor file, e.g. atlassian-plugin.xml.
See Also:
  • Method Details

    • configurePlugin

      Plugin configurePlugin(ModuleDescriptorFactory moduleDescriptorFactory, Plugin plugin)
      Sets the configuration on the plugin argument to match the configuration specified in the plugin descriptor (typically an XML file).
      Parameters:
      moduleDescriptorFactory - a factory for instantiating the required plugin modules
      plugin - the plugin whose configuration will be modified
      Returns:
      the original plugin with the configuration changed and the module descriptors added
      Throws:
      PluginParseException - if there was an error getting information about the plugin
    • getKey

      String getKey()
      Returns:
      the key of the plugin specified in the descriptor
    • isSystemPlugin

      @Deprecated boolean isSystemPlugin()
      Deprecated.
      The parser will set the SystemPlugin flag within the configurePlugin() method, so there is no need to use this externally. See PLUG-415. Deprecated since 2.3.0
      Returns:
      true if this plugin is marked as a system plugin in the descriptor. This should only be acted on by plugin loaders which can trust their plugins implicitly (e.g. a classpath plugin loader).
    • getPluginsVersion

      int getPluginsVersion()
      Returns:
      The version of the plugin system expected by this plugin. If unknown, it is assumed to be 1.
    • getPluginInformation

      PluginInformation getPluginInformation()
    • addModule

      ModuleDescriptor<?> addModule(ModuleDescriptorFactory moduleDescriptorFactory, Plugin plugin, Element module)
      Create a new module and createElement it with the plugin, then return it.

      In the event of a problem loading the module, return an UnrecognisedModuleDescriptor with error.

      Parameters:
      moduleDescriptorFactory - basic factory, may be overridden
      plugin - that the module will be initialised with
      module - to create
      Since:
      7.5.0
    • parseChildModulesFromSource

      List<Element> parseChildModulesFromSource()
      Retrieves the Elements representing the modules from the input source (plugin descriptor file snippet). Does not instantiate or validate that the returned Elements represent valid modules.

      Eg. For a snippet such as:

       <root-element>
           <module1 key=""/>
           <module2 key=""><otherModules/></module2>
       </root-element>
       
      The elements returned will be the module1 and module2 elements.
      Since:
      8.0.0