com.vladium.emma.report.xml
Class ReportGenerator

java.lang.Object
  extended bycom.vladium.emma.report.AbstractItemVisitor
      extended bycom.vladium.emma.report.AbstractReportGenerator
          extended bycom.vladium.emma.report.xml.ReportGenerator
All Implemented Interfaces:
IAppErrorCodes, IItemVisitor, IReportGenerator

public final class ReportGenerator
extends AbstractReportGenerator
implements IAppErrorCodes

Author:
Vlad Roubtsov, (C) 2003

Nested Class Summary
private static class ReportGenerator.IndentingWriter
           
 
Field Summary
private static int IO_BUF_SIZE
           
private  ReportGenerator.IndentingWriter m_out
           
private static java.lang.String TYPE
           
 
Fields inherited from class com.vladium.emma.report.AbstractReportGenerator
m_cache, m_hasLineNumberInfo, m_hasSrcFileInfo, m_log, m_metrics, m_settings, m_srcView, m_typeSortComparators, m_verbose, m_view
 
Fields inherited from interface com.vladium.emma.IAppErrorCodes
ARGS_IO_FAILURE, CLASS_STAMP_MISMATCH, INSTR_IO_FAILURE, INVALID_COLUMN_NAME, INVALID_PARAMETER_VALUE, MAIN_CLASS_BAD_DELEGATION, MAIN_CLASS_LOAD_FAILURE, MAIN_CLASS_NOT_FOUND, MAIN_METHOD_FAILURE, MAIN_METHOD_NOT_FOUND, OUT_IO_FAILURE, OUT_MKDIR_FAILURE, REPORT_GEN_FAILURE, REPORT_IO_FAILURE, REQUIRED_PARAMETER_MISSING, SECURITY_RESTRICTION, UNEXPECTED_FAILURE
 
Constructor Summary
ReportGenerator()
           
 
Method Summary
 void cleanup()
           
private  void close()
           
private  void closeElementTag(boolean simple)
           
private  void emitItem(IItem item, ItemComparator childrenOrder)
           
private  void emitItemCoverage(IItem item, int[] columns)
           
private  void emitStatsCount(java.lang.String name, int value)
           
private  void endElement(java.lang.String tag)
           
private  void eol()
           
 java.lang.String getType()
           
private  void openElementTag(java.lang.String tag)
           
private  void openOutFile(java.io.File file, java.lang.String encoding, boolean mkdirs)
           
 void process(IMetaData mdata, ICoverageData cdata, SourcePathCache cache, IProperties properties)
           
 java.lang.Object visit(AllItem item, java.lang.Object ctx)
           
 java.lang.Object visit(ClassItem item, java.lang.Object ctx)
           
 java.lang.Object visit(MethodItem item, java.lang.Object ctx)
           
 java.lang.Object visit(PackageItem item, java.lang.Object ctx)
           
 java.lang.Object visit(SrcFileItem item, java.lang.Object ctx)
           
 
Methods inherited from class com.vladium.emma.report.AbstractReportGenerator
create, initialize, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_out

private ReportGenerator.IndentingWriter m_out

TYPE

private static final java.lang.String TYPE
See Also:
Constant Field Values

IO_BUF_SIZE

private static final int IO_BUF_SIZE
See Also:
Constant Field Values
Constructor Detail

ReportGenerator

public ReportGenerator()
Method Detail

getType

public java.lang.String getType()
Specified by:
getType in interface IReportGenerator

process

public void process(IMetaData mdata,
                    ICoverageData cdata,
                    SourcePathCache cache,
                    IProperties properties)
             throws EMMARuntimeException
Specified by:
process in interface IReportGenerator
Throws:
EMMARuntimeException

cleanup

public void cleanup()
Specified by:
cleanup in interface IReportGenerator
Overrides:
cleanup in class AbstractReportGenerator

visit

public java.lang.Object visit(AllItem item,
                              java.lang.Object ctx)
Specified by:
visit in interface IItemVisitor
Overrides:
visit in class AbstractItemVisitor

visit

public java.lang.Object visit(PackageItem item,
                              java.lang.Object ctx)
Specified by:
visit in interface IItemVisitor
Overrides:
visit in class AbstractItemVisitor

visit

public java.lang.Object visit(SrcFileItem item,
                              java.lang.Object ctx)
Specified by:
visit in interface IItemVisitor
Overrides:
visit in class AbstractItemVisitor

visit

public java.lang.Object visit(ClassItem item,
                              java.lang.Object ctx)
Specified by:
visit in interface IItemVisitor
Overrides:
visit in class AbstractItemVisitor

visit

public java.lang.Object visit(MethodItem item,
                              java.lang.Object ctx)
Specified by:
visit in interface IItemVisitor
Overrides:
visit in class AbstractItemVisitor

emitStatsCount

private void emitStatsCount(java.lang.String name,
                            int value)
                     throws java.io.IOException
Throws:
java.io.IOException

emitItem

private void emitItem(IItem item,
                      ItemComparator childrenOrder)
               throws java.io.IOException
Throws:
java.io.IOException

emitItemCoverage

private void emitItemCoverage(IItem item,
                              int[] columns)
                       throws java.io.IOException
Throws:
java.io.IOException

openElementTag

private void openElementTag(java.lang.String tag)
                     throws java.io.IOException
Throws:
java.io.IOException

closeElementTag

private void closeElementTag(boolean simple)
                      throws java.io.IOException
Throws:
java.io.IOException

endElement

private void endElement(java.lang.String tag)
                 throws java.io.IOException
Throws:
java.io.IOException

eol

private void eol()
          throws java.io.IOException
Throws:
java.io.IOException

close

private void close()

openOutFile

private void openOutFile(java.io.File file,
                         java.lang.String encoding,
                         boolean mkdirs)