data.exporters
Class ExporterTXT

java.lang.Object
  extended by data.exporters.ExporterTXT

public class ExporterTXT
extends java.lang.Object

Class that allows generate the report of a WorkspaceManager. It uses a template text file to generate it.

Version:
1.0
Author:
Oscar Flores

Field Summary
private static java.io.File template
          Path to template file
 
Constructor Summary
ExporterTXT()
           
 
Method Summary
static java.lang.String getTXT(WorkspaceManager wm)
          Generates the report.
private static java.lang.String replaceVars(WorkspaceManager mg, java.io.File template)
          Given the template file and the WorkspaceManager, this method replaces the variables in the template with his concrete values for the WorspaceManager
static java.io.File writeTXT(WorkspaceManager wm)
          Creates a temporal file containing the report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

template

private static final java.io.File template
Path to template file

Constructor Detail

ExporterTXT

public ExporterTXT()
Method Detail

writeTXT

public static java.io.File writeTXT(WorkspaceManager wm)
                             throws DataException
Creates a temporal file containing the report. The default system Charset is used for the output

Parameters:
wm - WorkspaceManager wich report will be generated
Returns:
Temporal File with the report
Throws:
DataException

getTXT

public static java.lang.String getTXT(WorkspaceManager wm)
                               throws DataException
Generates the report.

Parameters:
wm - WorkspaceManager wich report will be generated
Returns:
String with the report
Throws:
DataException

replaceVars

private static java.lang.String replaceVars(WorkspaceManager mg,
                                            java.io.File template)
                                     throws java.io.IOException
Given the template file and the WorkspaceManager, this method replaces the variables in the template with his concrete values for the WorspaceManager

Parameters:
mg - WorkspaceManager wich report will be generated
template - Template file
Returns:
The template with replaced variables
Throws:
java.io.IOException