1 package org.apache.maven.changelog;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import java.io.IOException;
22 import java.io.InputStream;
23
24 import java.util.Collection;
25
26 /**
27 * Instance of <code>ChangeLogParser</code> are intended to parse an {@link
28 * java.io.InputStream} created by a {@link ChangeLogGenerator} into individual
29 * {@link ChangeLogEntry} objects.
30 *
31 * @author Glenn McAllister
32 * @version $Id: ChangeLogParser.java 532339 2007-04-25 12:28:56Z ltheussl $
33 */
34 public interface ChangeLogParser
35 {
36 /**
37 * Initialize the ChangeLogParser instance with the controlling {@link
38 * ChangeLog} instance. Any configuration required for the parser should
39 * be obtained from the <code>changeLog</code>. This method is guaranteed
40 * to be called before {@link #parse}.
41 *
42 * @param changeLog the controlling ChangeLog instance
43 */
44 void init( ChangeLog changeLog );
45
46 /**
47 * Returns a {@link java.util.Collection} of ChangeLogEntry objects, parsed
48 * from the {@link java.io.InputStream}. This method is guaranteed to be
49 * called after {@link #init} and before {@link #cleanup}. However, it is
50 * up to a {@link ChangeLogGenerator} instance to call this method, so no
51 * guarantee can be made this this method will be called.
52 *
53 * @param in the input stream to parse
54 * @return a Collection of ChangeLogEntry objects
55 * @throws IOException if there is an error while parsing the input stream
56 */
57 Collection parse( InputStream in )
58 throws IOException;
59
60 /**
61 * Provides the opportunity for the parser to do any required cleanup.
62 * This method is guaranteed to be called after the {@link #init} (and
63 * presumably the {@link #parse}) method.
64 */
65 void cleanup();
66
67 /**
68 * Set the date formatter for parse starteam stream
69 * @param dateFormat a dateFormat for replace the local format
70 */
71 public void setDateFormatInFile( String dateFormat );
72 }