public class XmlDescriptorParser extends Object implements DescriptorParser
Uses the dom4j SAXReader to parse the XML stream into a document
when the parser is constructed.
XmlDescriptorParserFactory| Constructor and Description |
|---|
XmlDescriptorParser(org.dom4j.Document source,
Set<Application> applications)
Constructs a parser with an already-constructed document
|
XmlDescriptorParser(InputStream source,
Iterable<InputStream> supplementalSources,
Set<Application> applications)
Constructs a parser with a stream of an XML document for a specific application
|
XmlDescriptorParser(InputStream source,
Set<Application> applications)
Constructs a parser with a stream of an XML document for a specific application
|
| Modifier and Type | Method and Description |
|---|---|
ModuleDescriptor<?> |
addModule(ModuleDescriptorFactory moduleDescriptorFactory,
Plugin plugin,
org.dom4j.Element module)
Create a new module and initialise it with the plugin, then return it.
|
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).
|
protected static org.dom4j.Document |
createDocument(InputStream source) |
protected ModuleDescriptor<?> |
createModuleDescriptor(Plugin plugin,
org.dom4j.Element element,
ModuleDescriptorFactory moduleDescriptorFactory) |
protected PluginInformation |
createPluginInformation() |
protected org.dom4j.Document |
getDocument() |
String |
getKey() |
PluginInformation |
getPluginInformation() |
int |
getPluginsVersion() |
boolean |
isSystemPlugin() |
protected static org.dom4j.Document |
mergeDocuments(org.dom4j.Document mainDocument,
Iterable<org.dom4j.Document> supplementalDocuments) |
public XmlDescriptorParser(org.dom4j.Document source,
Set<Application> applications)
throws PluginParseException
source - the source documentapplications - the application key to filter modules with, null for all unspecifiedPluginParseException - if there is a problem reading the descriptor from the XML InputStream.public XmlDescriptorParser(InputStream source, Set<Application> applications) throws PluginParseException
source - The descriptor streamapplications - the application key to filter modules with, null for all unspecifiedPluginParseException - if there is a problem reading the descriptor from the XML InputStream.public XmlDescriptorParser(InputStream source, Iterable<InputStream> supplementalSources, Set<Application> applications) throws PluginParseException
source - The descriptor streamsupplementalSources - a collection of streams containing supplemental ModuleDescriptorsapplications - the application key to filter modules with, null for all unspecifiedPluginParseException - if there is a problem reading the descriptor from the XML InputStream.protected static org.dom4j.Document createDocument(InputStream source) throws PluginParseException
PluginParseExceptionprotected static org.dom4j.Document mergeDocuments(org.dom4j.Document mainDocument,
Iterable<org.dom4j.Document> supplementalDocuments)
protected org.dom4j.Document getDocument()
public Plugin configurePlugin(ModuleDescriptorFactory moduleDescriptorFactory, Plugin plugin) throws PluginParseException
DescriptorParserconfigurePlugin in interface DescriptorParsermoduleDescriptorFactory - a factory for instantiating the required plugin modulesplugin - the plugin whose configuration will be modifiedPluginParseException - if there was an error getting information about the pluginpublic ModuleDescriptor<?> addModule(ModuleDescriptorFactory moduleDescriptorFactory, Plugin plugin, org.dom4j.Element module)
DescriptorParser
In the event of a problem loading the module, return an UnrecognisedModuleDescriptor
with error.
addModule in interface DescriptorParsermoduleDescriptorFactory - basic factory, may be overriddenplugin - that the module will be initialised withmodule - to createprotected ModuleDescriptor<?> createModuleDescriptor(Plugin plugin, org.dom4j.Element element, ModuleDescriptorFactory moduleDescriptorFactory) throws PluginParseException
PluginParseExceptionprotected PluginInformation createPluginInformation()
public String getKey()
getKey in interface DescriptorParserpublic int getPluginsVersion()
getPluginsVersion in interface DescriptorParserpublic PluginInformation getPluginInformation()
getPluginInformation in interface DescriptorParserpublic boolean isSystemPlugin()
isSystemPlugin in interface DescriptorParserCopyright © 2019 Atlassian. All rights reserved.