public class Builder
extends java.lang.Object
implements net.sf.statcvs.input.CvsLogBuilder
Helps building the CvsContent from a CVS
log. The Builder is fed by some CVS history data source, for
example a CVS log parser. The CvsContent can be retrieved
using the createCvsContent() method.
The class also takes care of the creation of Author and Directory objects and makes sure that there's only one of these for each author name and path. It also provides LOC count services.
| Constructor and Description |
|---|
Builder(net.sf.statcvs.input.RepositoryFileManager repositoryFileManager,
net.sf.statcvs.util.FilePatternMatcher includePattern,
net.sf.statcvs.util.FilePatternMatcher excludePattern)
Creates a new Builder
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildFile(java.lang.String filename,
boolean isBinary,
boolean isInAttic)
Starts building a new file.
|
void |
buildModule(java.lang.String moduleName)
Starts building the module.
|
void |
buildRevision(net.sf.statcvs.input.RevisionData data)
Adds a revision to the current file.
|
net.sf.statcvs.model.CvsContent |
createCvsContent()
Returns a CvsContent object of all files.
|
java.util.Set |
getAtticFileNames()
Returns the Set of filenames that are "in the attic".
|
net.sf.statcvs.model.Author |
getAuthor(java.lang.String name)
returns the Author of the given name or creates it
if it does not yet exist.
|
net.sf.statcvs.model.Directory |
getDirectory(java.lang.String filename)
Returns the Directory of the given filename or creates it
if it does not yet exist.
|
int |
getLOC(java.lang.String filename) |
java.lang.String |
getProjectName() |
boolean |
matchesPatterns(java.lang.String filename)
Matches a filename against the include and exclude patterns.
|
public Builder(net.sf.statcvs.input.RepositoryFileManager repositoryFileManager,
net.sf.statcvs.util.FilePatternMatcher includePattern,
net.sf.statcvs.util.FilePatternMatcher excludePattern)
repositoryFileManager - the RepositoryFileManager that
can be used to retrieve LOC counts for
the files that this builder will createincludePattern - a list of Ant-style wildcard patterns, seperated
by : or ;excludePattern - a list of Ant-style wildcard patterns, seperated
by : or ;public void buildModule(java.lang.String moduleName)
buildModule in interface net.sf.statcvs.input.CvsLogBuildermoduleName - name of the modulepublic void buildFile(java.lang.String filename,
boolean isBinary,
boolean isInAttic)
buildFile in interface net.sf.statcvs.input.CvsLogBuilderfilename - the file's name with path, for example "path/file.txt"isBinary - true if it's a binary fileisInAttic - true if the file is dead on the main branchpublic void buildRevision(net.sf.statcvs.input.RevisionData data)
buildRevision in interface net.sf.statcvs.input.CvsLogBuilderdata - the revisionpublic net.sf.statcvs.model.CvsContent createCvsContent()
throws net.sf.statcvs.input.EmptyRepositoryException
EmptyRepositoryException - if no adequate files were found in the
log.public java.lang.String getProjectName()
public java.util.Set getAtticFileNames()
public net.sf.statcvs.model.Author getAuthor(java.lang.String name)
name - the author's namepublic net.sf.statcvs.model.Directory getDirectory(java.lang.String filename)
filename - the name and path of a file, for example "src/Main.java"public int getLOC(java.lang.String filename)
throws net.sf.statcvs.input.NoLineCountException
net.sf.statcvs.input.NoLineCountExceptionpublic boolean matchesPatterns(java.lang.String filename)
filename - a filenameCopyright © 2002-2011 TrackStudio, Ltd. All Rights Reserved.