Class VssChangeLogConsumer
- java.lang.Object
-
- org.apache.maven.scm.util.AbstractConsumer
-
- org.apache.maven.scm.provider.vss.commands.changelog.VssChangeLogConsumer
-
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
public class VssChangeLogConsumer extends AbstractConsumer
-
-
Field Summary
Fields Modifier and Type Field Description private ChangeSetcurrentChangeSetprivate ChangeFilecurrentFileprivate java.util.Map<java.lang.String,ChangeSet>entriesrcs entries, in reverse (date, time, author, comment) orderprivate static java.text.SimpleDateFormatENTRY_KEY_TIMESTAMP_FORMATCustom date/time formatter.private static intGET_AUTHORexpecting dateprivate static intGET_COMMENTexpecting commentsprivate static intGET_FILEexpecting file informationprivate static intGET_FILE_PATHexpecting file path informationprivate static intGET_REVISIONexpecting revisionprivate static intGET_UNKNOWNunknown vss history line statusprivate intlastStatuslast status of the parserprivate VssScmProviderRepositoryrepoprivate static java.lang.StringSTART_AUTHORMarks author dataprivate static java.lang.StringSTART_COMMENTMarks comment dataprivate static java.lang.StringSTART_FILEMarks start of file dataprivate static java.lang.StringSTART_FILE_PATHMarks start of file dataprivate static java.lang.StringSTART_REVISIONMarks start of revisionprivate java.lang.StringuserDatePattern
-
Constructor Summary
Constructors Constructor Description VssChangeLogConsumer(VssScmProviderRepository repo, java.lang.String userDatePattern, ScmLogger logger)
-
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 intgetLineStatus(java.lang.String line)Identify the status of a vss history linejava.util.List<ChangeSet>getModifications()private voidprocessGetAuthor(java.lang.String line)Process the current input line in the Get Author 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 voidprocessGetFilePath(java.lang.String line)Process the current input line in the Get File Path state.private voidprocessGetRevision(java.lang.String line)Process the current input line in the Get Revision state.-
Methods inherited from class org.apache.maven.scm.util.AbstractConsumer
getLogger, parseDate, parseDate, setLogger
-
-
-
-
Field Detail
-
ENTRY_KEY_TIMESTAMP_FORMAT
private static final java.text.SimpleDateFormat ENTRY_KEY_TIMESTAMP_FORMAT
Custom date/time formatter. Rounds ChangeLogEntry times to the nearest minute.
-
GET_FILE
private static final int GET_FILE
expecting file information- See Also:
- Constant Field Values
-
GET_FILE_PATH
private static final int GET_FILE_PATH
expecting file path 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
-
GET_UNKNOWN
private static final int GET_UNKNOWN
unknown vss history line status- 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
-
START_FILE_PATH
private static final java.lang.String START_FILE_PATH
Marks start of file data- See Also:
- Constant Field Values
-
START_REVISION
private static final java.lang.String START_REVISION
Marks start of revision- See Also:
- Constant Field Values
-
START_AUTHOR
private static final java.lang.String START_AUTHOR
Marks author data- See Also:
- Constant Field Values
-
START_COMMENT
private static final java.lang.String START_COMMENT
Marks comment data- See Also:
- Constant Field Values
-
entries
private java.util.Map<java.lang.String,ChangeSet> entries
rcs entries, in reverse (date, time, author, comment) order
-
currentFile
private ChangeFile currentFile
-
currentChangeSet
private ChangeSet currentChangeSet
-
lastStatus
private int lastStatus
last status of the parser
-
repo
private VssScmProviderRepository repo
-
userDatePattern
private java.lang.String userDatePattern
-
-
Constructor Detail
-
VssChangeLogConsumer
public VssChangeLogConsumer(VssScmProviderRepository repo, java.lang.String userDatePattern, ScmLogger logger)
-
-
Method Detail
-
getModifications
public java.util.List<ChangeSet> getModifications()
-
consumeLine
public void consumeLine(java.lang.String line)
-
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 VSS log output
-
processGetAuthor
private void processGetAuthor(java.lang.String line)
Process the current input line in the Get Author state.- Parameters:
line- a line of text from the VSS log output
-
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 VSS log output
-
processGetFilePath
private void processGetFilePath(java.lang.String line)
Process the current input line in the Get File Path state.- Parameters:
line- a line of text from the VSS 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 VSS log output
-
getLineStatus
private int getLineStatus(java.lang.String line)
Identify the status of a vss history line- Parameters:
line- The line to process- Returns:
- status
-
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
-
-