Class StarteamChangeLogConsumer
- java.lang.Object
-
- org.apache.maven.scm.util.AbstractConsumer
-
- org.apache.maven.scm.provider.starteam.command.changelog.StarteamChangeLogConsumer
-
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
public class StarteamChangeLogConsumer extends AbstractConsumer
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringAUTHOR_TAGMarks author dataprivate ChangeSetcurrentChangethe current log entry being processed by the parserprivate java.lang.StringcurrentDirprivate ChangeFilecurrentFilethe current file being processed by the parserprivate static java.lang.StringDATE_TAGMarks date dataprivate static java.lang.StringDIR_MARKERMarks current directory dataprivate static java.lang.StringEND_FILEMarks end of fileprivate java.util.DateendDatethe to dateprivate java.util.List<ChangeSet>entriesprivate static intGET_AUTHORexpecting dateprivate static intGET_COMMENTexpecting commentsprivate static intGET_FILEexpecting file informationprivate static intGET_REVISIONexpecting revisionprivate java.text.SimpleDateFormatlocalFormatprivate static java.lang.StringREVISION_TAGMarks revision dataprivate static java.lang.StringSTART_FILEMarks start of file dataprivate static java.lang.StringSTART_REVISIONMarks start of revisionprivate java.util.DatestartDatethe before dateprivate intstatuscurrent status of the parserprivate java.lang.StringuserDateFormatprivate java.lang.StringworkingDirectory
-
Constructor Summary
Constructors Constructor Description StarteamChangeLogConsumer(java.io.File workingDirectory, ScmLogger logger, java.util.Date startDate, java.util.Date endDate, java.lang.String userDateFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddEntry(ChangeSet entry, ChangeFile file)Add a change log entry to the list (if it's not already there) with the given file.voidconsumeLine(java.lang.String line)private ChangeSetgetCurrentChange()Getter for property currentChange.private ChangeFilegetCurrentFile()Getter for property currentFile.java.util.List<ChangeSet>getModifications()private intgetStatus()Getter for property status.private voidprocessDirectory(java.lang.String line, int pos)private voidprocessGetAuthor(java.lang.String line)Process the current input line in the Get Author/Date state.private voidprocessGetComment(java.lang.String line)Process the current input line in the Get Comment state.private voidprocessGetFile(java.lang.String line)Process the current input line in the Get File state.private voidprocessGetRevision(java.lang.String line)Process the current input line in the Get Revision state.private voidsetCurrentChange(ChangeSet currentChange)Setter for property currentChange.private voidsetCurrentFile(ChangeFile currentFile)Setter for property currentFile.private voidsetStatus(int status)Setter for property status.-
Methods inherited from class org.apache.maven.scm.util.AbstractConsumer
getLogger, parseDate, parseDate, setLogger
-
-
-
-
Field Detail
-
localFormat
private java.text.SimpleDateFormat localFormat
-
entries
private java.util.List<ChangeSet> entries
-
workingDirectory
private java.lang.String workingDirectory
-
currentDir
private java.lang.String currentDir
-
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
-
DIR_MARKER
private static final java.lang.String DIR_MARKER
Marks current directory data- 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 ChangeSet currentChange
the current log entry being processed by the parser
-
currentFile
private 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
-
userDateFormat
private java.lang.String userDateFormat
-
-
Constructor Detail
-
StarteamChangeLogConsumer
public StarteamChangeLogConsumer(java.io.File workingDirectory, ScmLogger logger, java.util.Date startDate, java.util.Date endDate, java.lang.String userDateFormat)
-
-
Method Detail
-
getModifications
public java.util.List<ChangeSet> getModifications()
-
consumeLine
public void consumeLine(java.lang.String line)
-
addEntry
private void addEntry(ChangeSet entry, ChangeFile file)
Add a change log entry to the list (if it's not already there) with the given file.- Parameters:
entry- aChangeSetto 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 addedfile- aChangeFileto be added to the entry
-
processDirectory
private void processDirectory(java.lang.String line, int pos)
-
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 ChangeFile getCurrentFile()
Getter for property currentFile.- Returns:
- Value of property currentFile.
-
setCurrentFile
private void setCurrentFile(ChangeFile currentFile)
Setter for property currentFile.- Parameters:
currentFile- New value of property currentFile.
-
getCurrentChange
private ChangeSet getCurrentChange()
Getter for property currentChange.- Returns:
- Value of property currentChange.
-
setCurrentChange
private void setCurrentChange(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.
-
-