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