org.apache.maven.cvslib
Class CvsChangeLogGenerator

java.lang.Object
  extended byorg.apache.maven.changelog.AbstractChangeLogGenerator
      extended byorg.apache.maven.cvslib.CvsChangeLogGenerator
All Implemented Interfaces:
ChangeLogGenerator, org.apache.tools.ant.taskdefs.ExecuteStreamHandler

public class CvsChangeLogGenerator
extends AbstractChangeLogGenerator

A CVS implementation of the ChangeLog interface.

Version:
$Id: CvsChangeLogGenerator.java,v 1.6 2003/04/11 18:53:19 bwalding Exp $
Author:
Glenn McAllister, Eric Pugh, Jeff Martin, Jason van Zyl, dIon Gillard, Stefan Bodewig, Peter Donald, Pete Kazmier

Field Summary
static int POS_SCM
           
static int POS_SCM_MODULE
           
static int POS_SCM_PATH
           
static int POS_SCM_SUBTYPE
           
static int POS_SCM_TYPE
           
static int POS_SCM_USERHOST
           
 
Fields inherited from class org.apache.maven.changelog.AbstractChangeLogGenerator
base, changeLogExecutor, clParser, commentFormat, dateRange, entries, errorReader, in, logEnd, logStart, tag, type
 
Constructor Summary
CvsChangeLogGenerator()
           
 
Method Summary
 Collection getEntries(ChangeLogParser parser)
          Execute cvslib client driving the given parser.
 boolean getQuoteDate()
          Get the quoteDate property.
protected  String getScmDateArgument(Date before, Date to)
          Construct the CVS command-line argument that is used to specify the appropriate date range.
protected  org.apache.tools.ant.types.Commandline getScmLogCommand()
          Constructs the appropriate command line to execute the scm's log command.
protected  String getScmTagArgument(String tagStart, String tagEnd)
          Construct the command-line argument that is passed to the scm client to specify the appropriate tag.
protected  void handleParserException(IOException ioe)
          Handle ChangeLogParser IOExceptions.
 void init(ChangeLog changeLog)
          Initialize the generator from the changelog controller.
 void setProcessErrorStream(InputStream is)
          Set the error stream for reading from cvs log.
 void setQuoteDate(boolean newQuoteDate)
          Set the quoteDate property.
 
Methods inherited from class org.apache.maven.changelog.AbstractChangeLogGenerator
cleanup, getCommentFormat, getConnection, getLogEnd, getLogStart, logExecute, setCommentFormat, setConnection, setDateRange, setDateRangeFromAbsoluteDate, setLogEnd, setLogStart, setProcessInputStream, setProcessOutputStream, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POS_SCM

public static final int POS_SCM
See Also:
Constant Field Values

POS_SCM_TYPE

public static final int POS_SCM_TYPE
See Also:
Constant Field Values

POS_SCM_SUBTYPE

public static final int POS_SCM_SUBTYPE
See Also:
Constant Field Values

POS_SCM_USERHOST

public static final int POS_SCM_USERHOST
See Also:
Constant Field Values

POS_SCM_PATH

public static final int POS_SCM_PATH
See Also:
Constant Field Values

POS_SCM_MODULE

public static final int POS_SCM_MODULE
See Also:
Constant Field Values
Constructor Detail

CvsChangeLogGenerator

public CvsChangeLogGenerator()
Method Detail

setQuoteDate

public void setQuoteDate(boolean newQuoteDate)
Set the quoteDate property.

Parameters:
newQuoteDate - the quoteDate property to set.

getQuoteDate

public boolean getQuoteDate()
Get the quoteDate property.

Returns:
the quoteDate property.

init

public void init(ChangeLog changeLog)
Initialize the generator from the changelog controller.

Specified by:
init in interface ChangeLogGenerator
Overrides:
init in class AbstractChangeLogGenerator
Parameters:
changeLog - The invoking controller (useful for logging)
See Also:
ChangeLogGenerator#init(ChangeLog)

getEntries

public Collection getEntries(ChangeLogParser parser)
                      throws IOException
Execute cvslib client driving the given parser. @todo Currently the output from the logListener is a String, which is then converted to an InputStream. The output of logListener really should be an input stream.

Specified by:
getEntries in interface ChangeLogGenerator
Overrides:
getEntries in class AbstractChangeLogGenerator
Parameters:
parser - A parserto process the scm output.
Returns:
A collection of entriesparsed from the scm output.
Throws:
IOException - When there are issues executing scm.
See Also:
ChangeLogGenerator#getEntries(ChangeLogParser)

getScmLogCommand

protected org.apache.tools.ant.types.Commandline getScmLogCommand()
Description copied from class: AbstractChangeLogGenerator
Constructs the appropriate command line to execute the scm's log command. This method must be implemented by subclasses.

Specified by:
getScmLogCommand in class AbstractChangeLogGenerator
Returns:
the cvs command line to be executed.

getScmDateArgument

protected String getScmDateArgument(Date before,
                                    Date to)
Construct the CVS command-line argument that is used to specify the appropriate date range.

Specified by:
getScmDateArgument in class AbstractChangeLogGenerator
Parameters:
before - The starting point.
to - The ending point.
Returns:
A string that can be used to specify a date to a scm system.

getScmTagArgument

protected String getScmTagArgument(String tagStart,
                                   String tagEnd)
Description copied from class: AbstractChangeLogGenerator
Construct the command-line argument that is passed to the scm client to specify the appropriate tag.

Specified by:
getScmTagArgument in class AbstractChangeLogGenerator
Parameters:
tagStart - The tag name for the start of the log (log shouldn't actually contain the tag).
tagEnd - The tag name for the end of the log (the log can contain this tag), or null to log all changes since tagStart.
Returns:
A string that can be used to specify the tag range to a scm system.
See Also:
AbstractChangeLogGenerator.getScmTagArgument(String, String)

handleParserException

protected void handleParserException(IOException ioe)
                              throws IOException
Handle ChangeLogParser IOExceptions.

Overrides:
handleParserException in class AbstractChangeLogGenerator
Parameters:
ioe - The IOException thrown.
Throws:
IOException - If the handler doesn't wish to handle the exception.

setProcessErrorStream

public void setProcessErrorStream(InputStream is)
Set the error stream for reading from cvs log. This stream will be read on a separate thread.

Specified by:
setProcessErrorStream in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
Overrides:
setProcessErrorStream in class AbstractChangeLogGenerator
Parameters:
is - - an InputStream


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.