View Javadoc
1   package com.atlassian.plugin.parsers;
2   
3   import com.atlassian.plugin.Application;
4   import com.atlassian.plugin.PluginParseException;
5   
6   import java.io.InputStream;
7   import java.util.Set;
8   
9   /**
10   * A factory for creating descriptor parsers.
11   *
12   * @see DescriptorParser
13   * @see XmlDescriptorParserFactory
14   */
15  public interface DescriptorParserFactory {
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 applications 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, Set<Application> applications) throws PluginParseException;
28  }