public class

XmlDescriptorParser

extends Object
implements DescriptorParser
java.lang.Object
   ↳ com.atlassian.plugin.parsers.XmlDescriptorParser
Known Direct Subclasses

Class Overview

Provides access to the descriptor information retrieved from an XML InputStream.

Uses the dom4j SAXReader to parse the XML stream into a document when the parser is constructed.

Summary

Public Constructors
XmlDescriptorParser(Document source, String... applicationKeys)
Constructs a parser with an already-constructed document
XmlDescriptorParser(InputStream source, String... applicationKeys)
Constructs a parser with a stream of an XML document for a specific application
Public Methods
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).
String getKey()
PluginInformation getPluginInformation()
int getPluginsVersion()
boolean isSystemPlugin()
Protected Methods
Document createDocument(InputStream source)
ModuleDescriptor<?> createModuleDescriptor(Plugin plugin, Element element, ModuleDescriptorFactory moduleDescriptorFactory)
PluginInformation createPluginInformation(Element element)
Document getDocument()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.parsers.DescriptorParser

Public Constructors

public XmlDescriptorParser (Document source, String... applicationKeys)

Constructs a parser with an already-constructed document

Parameters
source the source document
applicationKeys the application key to filter modules with, null for all unspecified
Throws
PluginParseException if there is a problem reading the descriptor from the XML InputStream.

public XmlDescriptorParser (InputStream source, String... applicationKeys)

Constructs a parser with a stream of an XML document for a specific application

Parameters
source The descriptor stream
applicationKeys the application key to filter modules with, null for all unspecified
Throws
PluginParseException if there is a problem reading the descriptor from the XML InputStream.

Public Methods

public 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

public String getKey ()

public PluginInformation getPluginInformation ()

public int getPluginsVersion ()

public boolean isSystemPlugin ()

Protected Methods

protected Document createDocument (InputStream source)

protected ModuleDescriptor<?> createModuleDescriptor (Plugin plugin, Element element, ModuleDescriptorFactory moduleDescriptorFactory)

protected PluginInformation createPluginInformation (Element element)

protected Document getDocument ()