01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12: package org.tmatesoft.svn.core.wc;
13:
14: import java.util.Date;
15:
16: import org.tmatesoft.svn.core.SVNException;
17:
18: /**
19: * The <b>ISVNAnnotateHandler</b> interface should be implemented to be further
20: * provided to <b>SVNLogClient</b>'s <b>doAnnotate()</b> methods for processing
21: * annotation information per each text line.
22: *
23: * <p>
24: * Here's an example code snippet:
25: * <pre class="javacode">
26: * <span class="javakeyword">import</span> org.tmatesoft.svn.core.wc.ISVNAnnotateHandler;
27: * <span class="javakeyword">import</span> org.tmatesoft.svn.core.wc.SVNLogClient;
28: * ...
29: *
30: * SVNLogClient logClient;
31: * ...
32: *
33: * logClient.doAnnotate(<span class="javakeyword">new</span> File(<span class="javastring">"path/to/WC/file"</span>), SVNRevision.HEAD, SVNRevision.create(0),
34: * SVNRevision.HEAD, <span class="javakeyword">new</span> ISVNAnnotateHandler(){
35: * <span class="javakeyword">public void</span> handleLine(Date date, <span class="javakeyword">long</span> revision,
36: * String author, String line){
37: * <span class="javacomment">//implement this method as you wish, for example:</span>
38: * System.out.println(revision +
39: * <span class="javastring">" "</span> +
40: * author +
41: * <span class="javastring">" "</span> +
42: * date +
43: * <span class="javastring">" "</span> +
44: * line);
45: * }
46: * });
47: * ...</pre><br />
48: *
49: *
50: * @version 1.1.1
51: * @author TMate Software Ltd.
52: * @see SVNLogClient
53: */
54: public interface ISVNAnnotateHandler {
55: /**
56: * Handles per line annotation information - that is information about
57: * who last committed (changed) this line, the revision and timestamp when it was last
58: * committed.
59: *
60: * @param date the time moment when changes to <code>line</code> were commited
61: * to the repository
62: * @param revision the revision the changes were commited to
63: * @param author the person who did those changes
64: * @param line a text line of the target file (on which
65: * {@link SVNLogClient#doAnnotate(File, SVNRevision, SVNRevision, SVNRevision, ISVNAnnotateHandler) doAnnotate()}
66: * was invoked)
67: * @throws SVNException
68: */
69: public void handleLine(Date date, long revision, String author,
70: String line) throws SVNException;
71:
72: }
|