|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.changelog.AbstractChangeLogGenerator
An abstract implementation of the ChangeLog
interface.
Field Summary | |
protected File |
base
The working directory. |
protected ChangeLog |
changeLogExecutor
Reference to the enclosing ChangeLog instance - used to obtain any necessary configuration information. |
protected ChangeLogParser |
clParser
The parser that takes the log output and transforms it into a collection of ChangeLogEntry's. |
protected String |
commentFormat
The comment format string used in interrogating the RCS. |
protected String |
dateRange
The date range command line argument. |
protected Collection |
entries
The collection of ChangeLogEntry's returned from clParser. |
protected AsyncStreamReader |
errorReader
Stderr stream eater. |
protected InputStream |
in
The scm process input stream. |
protected String |
logEnd
Represents when this log ends (for the report). |
protected String |
logStart
Represents when this log starts (for the report). |
protected String |
tag
The tag command line argument. |
protected String |
type
The log type (range, date, or tag). |
Constructor Summary | |
AbstractChangeLogGenerator()
|
Method Summary | |
void |
cleanup()
Clean up any generated resources for this run. |
String |
getCommentFormat()
Returns the commentFormat used to interrogate the RCS. |
String |
getConnection()
Returns the connection. |
Collection |
getEntries(ChangeLogParser parser)
Execute scm client driving the given parser. |
String |
getLogEnd()
Return a string indicating the end of the entries. |
String |
getLogStart()
Return a string indicating the start of the entries. |
protected abstract String |
getScmDateArgument(Date before,
Date to)
Construct the command-line argument that is passed to the scm client to specify the appropriate date range. |
protected abstract org.apache.tools.ant.types.Commandline |
getScmLogCommand()
Constructs the appropriate command line to execute the scm's log command. |
protected abstract 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. |
static void |
logExecute(org.apache.tools.ant.taskdefs.Execute exe,
File base)
Logs the pertinent details to the logging system (info level) |
void |
setCommentFormat(String commentFormat)
Sets the commentFormat. |
void |
setConnection(String connection)
Sets the connection. |
protected void |
setDateRange(String numDaysString)
Set the dateRange member based on the number of days obtained from the ChangeLog. |
protected void |
setDateRangeFromAbsoluteDate(String startDate,
String endDate)
Set the dateRange member based on an absolute date. |
protected void |
setLogEnd(Date end)
Sets the log end string based on the given date. |
protected void |
setLogStart(Date start)
Sets the log start string based on the given date. |
void |
setProcessErrorStream(InputStream is)
Set the error stream for reading from scm log. |
void |
setProcessInputStream(OutputStream os)
Set the input stream for the scm process. |
void |
setProcessOutputStream(InputStream is)
Set the input stream used to read from scm log. |
void |
start()
Start read from the scm log. |
void |
stop()
Stop the process - currently unimplemented |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected File base
protected ChangeLog changeLogExecutor
protected ChangeLogParser clParser
protected String type
protected String dateRange
protected String tag
protected String logStart
protected String logEnd
protected Collection entries
protected AsyncStreamReader errorReader
protected InputStream in
protected String commentFormat
Constructor Detail |
public AbstractChangeLogGenerator()
Method Detail |
public void init(ChangeLog changeLog)
init
in interface ChangeLogGenerator
changeLog
- The invoking controller (useful for logging)ChangeLogGenerator.init(ChangeLog)
protected void setDateRange(String numDaysString)
numDaysString
- The number of days of log output to
generate.protected void setDateRangeFromAbsoluteDate(String startDate, String endDate)
startDate
- The start date for the range.endDate
- The end date for the range, or null
to use the present time.protected void setLogStart(Date start)
start
- date the log started.protected void setLogEnd(Date end)
end
- date the log ended.public Collection getEntries(ChangeLogParser parser) throws IOException
getEntries
in interface ChangeLogGenerator
parser
- A parser
to process the scm
output.
entries
parsed from
the scm output.
IOException
- When there are issues executing scm.ChangeLogGenerator.getEntries(ChangeLogParser)
protected void handleParserException(IOException ioe) throws IOException
ioe
- The IOException thrown.
IOException
- If the handler doesn't wish to handle the
exception (the default behavior).public String getLogStart()
ChangeLogGenerator
getLogStart
in interface ChangeLogGenerator
ChangeLogGenerator.getLogStart()
public String getLogEnd()
ChangeLogGenerator
getLogEnd
in interface ChangeLogGenerator
ChangeLogGenerator.getLogEnd()
public void cleanup()
cleanup
in interface ChangeLogGenerator
ChangeLogGenerator.cleanup()
protected abstract org.apache.tools.ant.types.Commandline getScmLogCommand()
protected abstract String getScmDateArgument(Date before, Date to)
before
- The starting point.to
- The ending point.
protected abstract String getScmTagArgument(String tagStart, String tagEnd)
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
.
public void stop()
stop
in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
public void setProcessInputStream(OutputStream os)
setProcessInputStream
in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
os
- An OutputStream
public void setProcessErrorStream(InputStream is)
setProcessErrorStream
in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
is
- An InputStream
public void setProcessOutputStream(InputStream is)
setProcessOutputStream
in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
is
- A stream of scm log output to be read frompublic void start() throws IOException
start
in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
IOException
- When there are errors reading from the
streams previously providedpublic String getConnection()
public void setConnection(String connection)
connection
- The connection to setpublic String getCommentFormat()
public void setCommentFormat(String commentFormat)
commentFormat
- The commentFormat to setpublic static void logExecute(org.apache.tools.ant.taskdefs.Execute exe, File base)
exe
- The object to logbase
- The working directory
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |