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      /**
18       * Creates a new {@link DescriptorParser} for getting plugin descriptor information
19       * from the provided source data.
20       *
21       * @param source the stream of data which represents the descriptor. The stream will
22       * only be read once, so it need not be resettable.
23       * @param applications The list of application keys to match for module descriptors
24       * @return an instance of the descriptor parser tied to this InputStream
25       * @throws PluginParseException if there was a problem creating the descriptor parser
26       * due to an invalid source stream.
27       */
28      DescriptorParser getInstance(InputStream source, Set<Application> applications) throws PluginParseException;
29  
30  }