|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.statsvn.input.Builder
public class Builder
Helps building the net.sf.statsvn.model.Repository
from a SVN log. The Builder is fed by some SVN history data source, for example a SVN
log parser. The Repository can be retrieved using the Builder.createRepository()
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 Summary | |
---|---|
Builder(RepositoryFileManager repositoryFileManager,
net.sf.statcvs.util.FilePatternMatcher includePattern,
net.sf.statcvs.util.FilePatternMatcher excludePattern,
java.util.regex.Pattern tagsPattern)
Creates a new Builder |
Method Summary | |
---|---|
void |
addToAttic(java.lang.String filename)
Adds a file to the attic. |
void |
buildFile(java.lang.String filename,
boolean isBinary,
boolean isInAttic,
java.util.Map revBySymnames,
java.util.Map dateBySymnames)
Starts building a new file. |
void |
buildModule(java.lang.String moduleName)
Starts building the module. |
void |
buildRevision(RevisionData data)
Adds a revision to the current file. |
void |
clean()
|
net.sf.statcvs.model.Repository |
createRepository()
Returns a Repository 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. |
java.util.Map |
getFileBuilders()
New in StatSVN: We need to have access to FileBuilders after they have been created to populate them with version numbers later on. |
int |
getLOC(java.lang.String filename)
|
java.lang.String |
getProjectName()
|
java.lang.String |
getRevision(java.lang.String filename)
|
net.sf.statcvs.model.SymbolicName |
getSymbolicName(java.lang.String name,
java.util.Date date)
Returns the SymbolicName with the given name or creates it if it does not yet exist. |
boolean |
matchesPatterns(java.lang.String filename)
Matches a filename against the include and exclude patterns. |
boolean |
matchesTagPatterns(java.lang.String tag)
Matches a tag against the tag patterns. |
void |
updateRevision(java.lang.String filename,
java.lang.String revisionNumber,
int linesAdded,
int linesRemoved)
New in StatSVN: Updates a particular revision for a file with new line count information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Builder(RepositoryFileManager repositoryFileManager, net.sf.statcvs.util.FilePatternMatcher includePattern, net.sf.statcvs.util.FilePatternMatcher excludePattern, java.util.regex.Pattern tagsPattern)
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 ;Method Detail |
---|
public void clean()
public void addToAttic(java.lang.String filename)
addToAttic
in interface SvnLogBuilder
filename
- the filename to add to the attic.public void buildFile(java.lang.String filename, boolean isBinary, boolean isInAttic, java.util.Map revBySymnames, java.util.Map dateBySymnames)
Starts building a new file. The files are not expected to be created in any particular order. Subsequent calls to (@link #buildRevision(RevisionData)) will add revisions to this file.
New in StatSVN: If the method has already been invoked with the same filename, the original file will be re-loaded and the other arguments are ignored.
buildFile
in interface SvnLogBuilder
filename
- 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 branchrevBySymnames
- maps revision (string) by symbolic name (string)dateBySymnames
- maps date (date) by symbolic name (string)public void buildModule(java.lang.String moduleName)
buildModule
in interface SvnLogBuilder
moduleName
- name of the modulepublic void buildRevision(RevisionData data)
buildRevision
in interface SvnLogBuilder
data
- the revisionpublic net.sf.statcvs.model.Repository createRepository()
public java.util.Set getAtticFileNames()
public net.sf.statcvs.model.Author getAuthor(java.lang.String name)
name
- the author's name
public net.sf.statcvs.model.Directory getDirectory(java.lang.String filename)
filename
- the name and path of a file, for example "src/Main.java"
public java.util.Map getFileBuilders()
getFileBuilders
in interface SvnLogBuilder
public int getLOC(java.lang.String filename) throws net.sf.statcvs.input.NoLineCountException
net.sf.statcvs.input.NoLineCountException
RepositoryFileManager.getLinesOfCode(String)
public java.lang.String getProjectName()
public java.lang.String getRevision(java.lang.String filename) throws java.io.IOException
java.io.IOException
RepositoryFileManager.getRevision(String)
public net.sf.statcvs.model.SymbolicName getSymbolicName(java.lang.String name, java.util.Date date)
SymbolicName
with the given name or creates it if it does not yet exist.
name
- the symbolic name's name
public boolean matchesPatterns(java.lang.String filename)
matchesPatterns
in interface SvnLogBuilder
filename
- a filename
public boolean matchesTagPatterns(java.lang.String tag)
matchesTagPatterns
in interface SvnLogBuilder
tag
- a tag
public void updateRevision(java.lang.String filename, java.lang.String revisionNumber, int linesAdded, int linesRemoved)
updateRevision
in interface SvnLogBuilder
filename
- the file to be updatedrevisionNumber
- the revision number to be updatedlinesAdded
- the lines that were addedlinesRemoved
- the lines that were removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |