|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer uk.ac.ebi.microarray.zooma.reports.ReportWriter
public class ReportWriter
A writer implementation that writes all output lines supplied into a buffer, alphabetically sorts them, and flushes them to file when this writer is closed.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
ReportWriter(java.io.File file)
Creates a ReportWriter that buffers written lines, sorting them alphabetically. |
Method Summary | |
---|---|
void |
close()
Writes the header, the footer, and the content of the buffer to disk. |
ReportWriter |
endReport(int exitCode)
Finalises the report, setting the exit code of the process, sorting alphabetically and flushing to disk. |
protected java.lang.String |
extractOntologyTermFromURI(java.lang.String termURI)
|
protected java.lang.String |
fetchOntologyName(uk.ac.ebi.ontocat.OntologyTerm term)
Fetches the name of the ontology for the supplied term. |
void |
flush()
Sorts the current buffer of report output, and flushes everything to a temporary file. |
protected org.slf4j.Logger |
getLog()
|
protected java.lang.String |
lookupVersionFromMavenProperties()
Retrieves the version number of the application, by locating the version property from the automatically generated maven pom.properties file. |
ReportWriter |
startReport()
Initialises the report, setting useful information about the outcome such as start time, working directory etc. |
void |
write(char[] cbuf,
int off,
int len)
|
protected void |
writeReportFooter(java.io.PrintWriter writer)
Writes the footer of the report into the supplied print writer |
protected void |
writeReportHeader(java.io.PrintWriter writer)
Writes the header of the report into the supplied print writer. |
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReportWriter(java.io.File file)
file
- the file to write the report toMethod Detail |
---|
protected org.slf4j.Logger getLog()
public ReportWriter startReport() throws java.io.IOException
java.io.IOException
- if something failed whilst creating the filepublic ReportWriter endReport(int exitCode) throws java.io.IOException
exitCode
- the exit code that our mapping process should return
java.io.IOException
- if writing to the file failedpublic void write(char[] cbuf, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.Writer
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.Writer
java.io.IOException
- if closing this writer failedprotected void writeReportHeader(java.io.PrintWriter writer)
super.writeReportHeader()
first followed by
writer.println(<my line here>)
;
writer
- the writer to write the header data toprotected void writeReportFooter(java.io.PrintWriter writer)
writer
- the writer to write the footer data intoprotected java.lang.String lookupVersionFromMavenProperties()
protected java.lang.String fetchOntologyName(uk.ac.ebi.ontocat.OntologyTerm term)
term
- the term we want the ontology name for
protected java.lang.String extractOntologyTermFromURI(java.lang.String termURI)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |