1 package com.atlassian.plugin.parsers;
2
3 import com.atlassian.plugin.PluginParseException;
4
5 import java.io.InputStream;
6
7 /**
8 * A factory for creating descriptor parsers.
9 *
10 * @see DescriptorParser
11 * @see XmlDescriptorParserFactory
12 */
13 public interface DescriptorParserFactory
14 {
15 /**
16 * Creates a new {@link DescriptorParser} for getting plugin descriptor information
17 * from the provided source data.
18 *
19 * @param source the stream of data which represents the descriptor. The stream will
20 * only be read once, so it need not be resettable.
21 * @param applicationKeys The list of application keys to match for module descriptors
22 * @return an instance of the descriptor parser tied to this InputStream
23 * @throws PluginParseException if there was a problem creating the descriptor parser
24 * due to an invalid source stream.
25 */
26 DescriptorParser getInstance(InputStream source, String... applicationKeys) throws PluginParseException;
27 }