org.apache.maven.scm.provider.starteam.command.changelog
Class StarteamChangeLogConsumer

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

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

Version:
$Id: StarteamChangeLogConsumer.java 191730 2005-06-21 21:35:52Z evenisse $
Author:
Emmanuel Venisse

Field Summary
private static java.lang.String AUTHOR_TAG
          Marks author data
private  org.apache.maven.scm.ChangeSet currentChange
          the current log entry being processed by the parser
private  org.apache.maven.scm.ChangeFile currentFile
          the current file being processed by the parser
private static java.lang.String DATE_TAG
          Marks date data
private static java.lang.String END_FILE
          Marks end of file
private  java.util.Date endDate
          the to date
private  java.util.List entries
           
private static int GET_AUTHOR
          expecting date
private static int GET_COMMENT
          expecting comments
private static int GET_FILE
          expecting file information
private static int GET_REVISION
          expecting revision
private  java.text.SimpleDateFormat localFormat
           
private  org.apache.maven.scm.log.ScmLogger logger
           
private static java.lang.String REVISION_TAG
          Marks revision data
private static java.lang.String START_FILE
          Marks start of file data
private static java.lang.String START_REVISION
          Marks start of revision
private  java.util.Date startDate
          the before date
private  int status
          current status of the parser
 
Constructor Summary
StarteamChangeLogConsumer(org.apache.maven.scm.log.ScmLogger logger, java.util.Date startDate, java.util.Date endDate)
           
 
Method Summary
private  void addEntry(org.apache.maven.scm.ChangeSet entry, org.apache.maven.scm.ChangeFile file)
          Add a change log entry to the list (if it's not already there) with the given file.
 void consumeLine(java.lang.String line)
           
private  org.apache.maven.scm.ChangeSet getCurrentChange()
          Getter for property currentChange.
private  org.apache.maven.scm.ChangeFile getCurrentFile()
          Getter for property currentFile.
 java.util.List getModifications()
           
private  int getStatus()
          Getter for property status.
private  java.util.Date parseDate(java.lang.String date)
          Converts the date timestamp from the svn output into a date object.
private  void processGetAuthor(java.lang.String line)
          Process the current input line in the Get Author/Date state.
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 processGetRevision(java.lang.String line)
          Process the current input line in the Get Revision state.
private  void setCurrentChange(org.apache.maven.scm.ChangeSet currentChange)
          Setter for property currentChange.
private  void setCurrentFile(org.apache.maven.scm.ChangeFile currentFile)
          Setter for property currentFile.
private  void setStatus(int status)
          Setter for property status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private org.apache.maven.scm.log.ScmLogger logger

localFormat

private java.text.SimpleDateFormat localFormat

entries

private java.util.List entries

GET_FILE

private static final int GET_FILE
expecting file information

See Also:
Constant Field Values

GET_AUTHOR

private static final int GET_AUTHOR
expecting date

See Also:
Constant Field Values

GET_COMMENT

private static final int GET_COMMENT
expecting comments

See Also:
Constant Field Values

GET_REVISION

private static final int GET_REVISION
expecting revision

See Also:
Constant Field Values

START_FILE

private static final java.lang.String START_FILE
Marks start of file data

See Also:
Constant Field Values

END_FILE

private static final java.lang.String END_FILE
Marks end of file

See Also:
Constant Field Values

START_REVISION

private static final java.lang.String START_REVISION
Marks start of revision

See Also:
Constant Field Values

REVISION_TAG

private static final java.lang.String REVISION_TAG
Marks revision data

See Also:
Constant Field Values

AUTHOR_TAG

private static final java.lang.String AUTHOR_TAG
Marks author data

See Also:
Constant Field Values

DATE_TAG

private static final java.lang.String DATE_TAG
Marks date data

See Also:
Constant Field Values

status

private int status
current status of the parser


currentChange

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


currentFile

private org.apache.maven.scm.ChangeFile currentFile
the current file being processed by the parser


startDate

private java.util.Date startDate
the before date


endDate

private java.util.Date endDate
the to date

Constructor Detail

StarteamChangeLogConsumer

public StarteamChangeLogConsumer(org.apache.maven.scm.log.ScmLogger logger,
                                 java.util.Date startDate,
                                 java.util.Date endDate)
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

addEntry

private void addEntry(org.apache.maven.scm.ChangeSet entry,
                      org.apache.maven.scm.ChangeFile file)
Add a change log entry to the list (if it's not already there) with the given file.

Parameters:
entry - a ChangeLogEntry to be added to the list if another with the same key doesn't exist already. If the entry's author is null, the entry wont be added
file - a ChangeLogFile to be added to the entry

processGetFile

private void processGetFile(java.lang.String line)
Process the current input line in the Get File state.

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

processGetRevision

private void processGetRevision(java.lang.String line)
Process the current input line in the Get Revision state.

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

processGetAuthor

private void processGetAuthor(java.lang.String line)
Process the current input line in the Get Author/Date state.

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

processGetComment

private void processGetComment(java.lang.String line)
Process the current input line in the Get Comment state.

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

getCurrentFile

private org.apache.maven.scm.ChangeFile getCurrentFile()
Getter for property currentFile.

Returns:
Value of property currentFile.

setCurrentFile

private void setCurrentFile(org.apache.maven.scm.ChangeFile currentFile)
Setter for property currentFile.

Parameters:
currentFile - New value of property currentFile.

getCurrentChange

private org.apache.maven.scm.ChangeSet getCurrentChange()
Getter for property currentChange.

Returns:
Value of property currentChange.

setCurrentChange

private void setCurrentChange(org.apache.maven.scm.ChangeSet currentChange)
Setter for property currentChange.

Parameters:
currentChange - New value of property currentChange.

getStatus

private int getStatus()
Getter for property status.

Returns:
Value of property status.

setStatus

private void setStatus(int status)
Setter for property status.

Parameters:
status - New value of property status.

parseDate

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

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