net.sf.statsvn.input
Class RepositoriesBuilder

java.lang.Object
  extended by net.sf.statsvn.input.RepositoriesBuilder

public class RepositoriesBuilder
extends java.lang.Object

This class receives information from the (@link net.sf.statsvn.input.SvnXmlRepositoriesFileHandler) to build a DOM-based XML structure containing the names of all repositories and associated line counts xml files. It then allows to retrieve the line counts XML file name for a given repository.

 

Constructor Summary
RepositoriesBuilder()
          Constructs the RepositoriesBuilder
 
Method Summary
 org.w3c.dom.Element buildRepository(java.lang.String uuid, java.lang.String file)
          Adds a repository to the DOM structure.
 void buildRoot()
          Builds the DOM root.
 org.w3c.dom.Document getDocument()
          Returns the DOM object when building is complete.
 java.lang.String getFileName(java.lang.String uuid)
          Retrieves the file name of the line counts xml file for a given repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoriesBuilder

public RepositoriesBuilder()
Constructs the RepositoriesBuilder

Method Detail

buildRepository

public org.w3c.dom.Element buildRepository(java.lang.String uuid,
                                           java.lang.String file)
Adds a repository to the DOM structure.

Parameters:
uuid - the uuid of the repository
file - the filename for the XML line counts file

buildRoot

public void buildRoot()
               throws javax.xml.parsers.ParserConfigurationException
Builds the DOM root.

Throws:
javax.xml.parsers.ParserConfigurationException

getFileName

public java.lang.String getFileName(java.lang.String uuid)
Retrieves the file name of the line counts xml file for a given repository. Creates a new file name if the line counts xml file does not exist. If the repositories xml file does not exist (i.e. the document is null), a new document is created.

Parameters:
uuid - the uuid of the repository
Returns:
the file name or "" if an unexpected error occurs

getDocument

public org.w3c.dom.Document getDocument()
Returns the DOM object when building is complete.

Returns:
the DOM document.