org.apache.maven.scm.provider.svn.command.changelog
Class SvnChangeLogConsumer

java.lang.Object
  extended byorg.apache.maven.scm.provider.svn.command.changelog.SvnChangeLogConsumer
All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer

public class SvnChangeLogConsumer
extends java.lang.Object
implements org.codehaus.plexus.util.cli.StreamConsumer

Version:
$Id: SvnChangeLogConsumer.java 189558 2005-06-08 08:37:34Z evenisse $
Author:
Emmanuel Venisse

Field Summary
private static java.lang.String COMMENT_END_TOKEN
          The comment section ends with a dashed line
private  org.apache.maven.scm.ChangeSet currentChange
          The current log entry being processed by the parser
private  java.lang.StringBuffer currentComment
          The current comment of the entry being processed by the parser
private  java.lang.String currentRevision
          The current revision of the entry being processed by the parser
private  java.util.List entries
          List of change log entries
private static java.lang.String FILE_BEGIN_TOKEN
          A file line begins with a space character
private static java.lang.String FILE_END_TOKEN
          The file section ends with a blank line
private static int FILE_START_INDEX
          The filename starts after 5 characters
private static int GET_COMMENT
          State machine constant: expecting comments
private static int GET_FILE
          State machine constant: expecting file information
private static int GET_HEADER
          State machine constant: expecting header
private  org.apache.regexp.RE headerRegexp
          The regular expression used to match header lines
private static java.lang.String pattern
          The pattern used to match svn header lines
private  int status
          Current status of the parser
private static java.text.SimpleDateFormat SVN_TIMESTAMP
          Date formatter for svn timestamp (after a little massaging)
 
Constructor Summary
SvnChangeLogConsumer()
          Default constructor.
 
Method Summary
 void consumeLine(java.lang.String line)
           
 java.util.List getModifications()
           
private  java.util.Date parseDate()
          Converts the date timestamp from the svn output into a date object.
private  void processGetComment(java.lang.String line)
          Process the current input line in the GET_COMMENT state.
private  void processGetFile(java.lang.String line)
          Process the current input line in the GET_FILE state.
private  void processGetHeader(java.lang.String line)
          Process the current input line in the GET_HEADER state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SVN_TIMESTAMP

private static final java.text.SimpleDateFormat SVN_TIMESTAMP
Date formatter for svn timestamp (after a little massaging)


GET_HEADER

private static final int GET_HEADER
State machine constant: expecting header

See Also:
Constant Field Values

GET_FILE

private static final int GET_FILE
State machine constant: expecting file information

See Also:
Constant Field Values

GET_COMMENT

private static final int GET_COMMENT
State machine constant: expecting comments

See Also:
Constant Field Values

FILE_BEGIN_TOKEN

private static final java.lang.String FILE_BEGIN_TOKEN
A file line begins with a space character

See Also:
Constant Field Values

FILE_END_TOKEN

private static final java.lang.String FILE_END_TOKEN
The file section ends with a blank line

See Also:
Constant Field Values

FILE_START_INDEX

private static final int FILE_START_INDEX
The filename starts after 5 characters

See Also:
Constant Field Values

COMMENT_END_TOKEN

private static final java.lang.String COMMENT_END_TOKEN
The comment section ends with a dashed line

See Also:
Constant Field Values

pattern

private static final java.lang.String pattern
The pattern used to match svn header lines

See Also:
Constant Field Values

status

private int status
Current status of the parser


entries

private java.util.List entries
List of change log entries


currentChange

private org.apache.maven.scm.ChangeSet currentChange
The current log entry being processed by the parser


currentRevision

private java.lang.String currentRevision
The current revision of the entry being processed by the parser


currentComment

private java.lang.StringBuffer currentComment
The current comment of the entry being processed by the parser


headerRegexp

private org.apache.regexp.RE headerRegexp
The regular expression used to match header lines

Constructor Detail

SvnChangeLogConsumer

public SvnChangeLogConsumer()
Default constructor.

Method Detail

getModifications

public java.util.List getModifications()

consumeLine

public void consumeLine(java.lang.String line)
Specified by:
consumeLine in interface org.codehaus.plexus.util.cli.StreamConsumer

processGetHeader

private void processGetHeader(java.lang.String line)
Process the current input line in the GET_HEADER state. The author, date, and the revision of the entry are gathered. Note, Subversion does not have per-file revisions, instead, the entire repository is given a single revision number, which is used for the revision number of each file.

Parameters:
line - A line of text from the svn log output

processGetFile

private void processGetFile(java.lang.String line)
Process the current input line in the GET_FILE state. This state adds each file entry line to the current change log entry. Note, the revision number for the entire entry is used for the revision number of each file.

Parameters:
line - A line of text from the svn log output

processGetComment

private void processGetComment(java.lang.String line)
Process the current input line in the GET_COMMENT state. This state gathers all of the comments that are part of a log entry.

Parameters:
line - a line of text from the svn log output

parseDate

private java.util.Date parseDate()
Converts the date timestamp from the svn output into a date object.

Returns:
A date representing the timestamp of the log entry.