|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tmatesoft.svn.core.SVNAnnotationGenerator
The SVNAnnotationGenerator class is used to annotate files - that is to place author and revision information in-line for the specified file.
Since SVNAnnotationGenerator implements ISVNFileRevisionHandler,
it is merely passed to a getFileRevisions()
method of SVNRepository. After that you handle the resultant annotated
file line-by-line providing an ISVNAnnotateHandler implementation to the reportAnnotations()
method:
import org.tmatesoft.svn.core.SVNAnnotationGenerator; import org.tmatesoft.svn.core.io.SVNRepositoryFactory; import org.tmatesoft.svn.core.io.SVNRepository; import org.tmatesoft.svn.core.wc.SVNAnnotateHandler; ... File tmpFile; SVNRepository repos; ISVNAnnotateHandler annotateHandler; ISVNEventHandler cancelHandler; long startRev = 0; long endRev = 150; ... SVNAnnotationGenerator generator = new SVNAnnotationGenerator(path, tmpFile, cancelHandler); try { repos.getFileRevisions("", startRev, endRev, generator); generator.reportAnnotations(annotateHandler, null); } finally { generator.dispose(); } ...
Constructor Summary | |
SVNAnnotationGenerator(String path,
File tmpDirectory,
long startRevision,
ISVNEventHandler cancelBaton)
Constructs an annotation generator object. |
Method Summary | |
void |
applyTextDelta(String token,
String baseChecksum)
Starts applying text delta(s) to an opened file. |
void |
closeRevision(String token)
Does nothing. |
void |
dispose()
Finalizes an annotation operation releasing resources involved by this generator. |
void |
openRevision(SVNFileRevision fileRevision)
Handles a file revision info. |
void |
reportAnnotations(ISVNAnnotateHandler handler,
String inputEncoding)
Dispatches file lines along with author & revision info to the provided annotation handler. |
OutputStream |
textDeltaChunk(String token,
SVNDiffWindow diffWindow)
Collects a next delta chunk. |
void |
textDeltaEnd(String token)
Finalizes collecting text delta(s). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SVNAnnotationGenerator(String path, File tmpDirectory, long startRevision, ISVNEventHandler cancelBaton)
cancelBaton
's
ISVNEventHandler.checkCancelled()
method
is used for this purpose.
path
- a file path (relative to a repository location)tmpDirectory
- a revision to stop atstartRevision
- a start revision to begin annotation withcancelBaton
- a baton which is used to check if an operation
is cancelledMethod Detail |
public void openRevision(SVNFileRevision fileRevision) throws SVNException
ISVNFileRevisionHandler
openRevision
in interface ISVNFileRevisionHandler
fileRevision
-
SVNException
- if one of the following occurs:
SVNFileRevision
public void closeRevision(String token) throws SVNException
closeRevision
in interface ISVNFileRevisionHandler
token
- a file token (name or path)
SVNException
public void applyTextDelta(String token, String baseChecksum) throws SVNException
ISVNDeltaConsumer
applyTextDelta
in interface ISVNDeltaConsumer
token
- a file path relative to the edit root
directorybaseChecksum
- an MD5 checksum for the base file contents (before the
file is changed)
SVNException
- if the calculated base file checksum didn't match the expected
baseChecksum
public OutputStream textDeltaChunk(String token, SVNDiffWindow diffWindow) throws SVNException
ISVNDeltaConsumer
If there are more than one windows for the file, this method is called several times.
textDeltaChunk
in interface ISVNDeltaConsumer
token
- a file path relative to the edit root
directorydiffWindow
- a next diff window
SVNException
public void textDeltaEnd(String token) throws SVNException
ISVNDeltaConsumer
textDeltaEnd
in interface ISVNDeltaConsumer
token
- a file path relative to the edit root
directory
SVNException
public void reportAnnotations(ISVNAnnotateHandler handler, String inputEncoding) throws SVNException
handler
- an annotation handler that processes file lines with
author & revision infoinputEncoding
- a desired character set (encoding) of text lines
SVNException
public void dispose()
reportAnnotations()
.
|
JavaSVN Home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |