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 * @return an instance of the descriptor parser tied to this InputStream
22 * @throws PluginParseException if there was a problem creating the descriptor parser
23 * due to an invalid source stream.
24 */
25 DescriptorParser getInstance(InputStream source) throws PluginParseException;
26 }