Package com.atlassian.plugin.parsers
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 Summary
Modifier and TypeMethodDescriptionaddModule(ModuleDescriptorFactory moduleDescriptorFactory, Plugin plugin, Element module) Create a new module and createElement it with the plugin, then return it.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).getKey()intbooleanDeprecated.The parser will set the SystemPlugin flag within the configurePlugin() method, so there is no need to use this externally.Retrieves theElements representing the modules from the input source (plugin descriptor file snippet).
-
Method Details
-
configurePlugin
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 modulesplugin- 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.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
UnrecognisedModuleDescriptorwith error.- Parameters:
moduleDescriptorFactory- basic factory, may be overriddenplugin- that the module will be initialised withmodule- to create- Since:
- 7.5.0
-
parseChildModulesFromSource
Retrieves theElements 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
-