org.apache.tools.ant.taskdefs.optional.sitraka

Class XMLReport

public class XMLReport extends Object

Little hack to process XML report from JProbe. It will fix some reporting errors from JProbe 3.0 and makes use of a reference classpath to add classes/methods that were not reported by JProbe as being used (ie loaded)
Constructor Summary
XMLReport(File file)
create a new XML report, logging will be on stdout
XMLReport(Task task, File file)
create a new XML report, logging done on the task
Method Summary
protected ElementcreateClassElement(ClassFile classFile)
create an empty class element with its default cov.data (0)
DocumentcreateDocument(String[] classPath)
create the whole new document
protected ElementcreateMethodElement(MethodInfo method)
create an empty method element with its cov.data values
protected voidcreateNodeMaps()
create node maps so that we can access node faster by their name
protected ElementcreatePackageElement(String pkgname)
create an empty package element with its default cov.data (0)
protected Element[]getClasses(Element pkg)
protected ElementgetCovDataChild(Element parent)
protected VectorgetFilteredMethods(ClassFile classFile)
protected HashtablegetMethods(Element clazz)
protected StringgetMethodSignature(MethodInfo method)
JProbe does not put the java.lang prefix for classes in this package, so used this nice method so that I have the same signature for methods
protected StringgetMethodSignature(ClassFile clazz, MethodInfo method)
Convert to a CovReport-like signature - <classname>.<method>().
protected Element[]getPackages(Element snapshot)
voidlog(String message)
protected voidremoveAbstractMethods(ClassFile classFile, Element classNode)
Do additional work on an element to remove abstract methods that are reported by JProbe 3.0
protected voidserializeClass(ClassFile classFile)
serialize a classfile into XML
voidsetJProbehome(File home)
set the JProbe home path.
voidsetReportFilters(ReportFilters filters)
set the
protected voidupdate()
update the count of the XML, that is accumulate the stats on methods, classes and package so that the numbers are valid according to the info that was appended to the XML.

Constructor Detail

XMLReport

public XMLReport(File file)
create a new XML report, logging will be on stdout

XMLReport

public XMLReport(Task task, File file)
create a new XML report, logging done on the task

Method Detail

createClassElement

protected Element createClassElement(ClassFile classFile)
create an empty class element with its default cov.data (0)

createDocument

public Document createDocument(String[] classPath)
create the whole new document

createMethodElement

protected Element createMethodElement(MethodInfo method)
create an empty method element with its cov.data values

createNodeMaps

protected void createNodeMaps()
create node maps so that we can access node faster by their name

createPackageElement

protected Element createPackageElement(String pkgname)
create an empty package element with its default cov.data (0)

getClasses

protected Element[] getClasses(Element pkg)

getCovDataChild

protected Element getCovDataChild(Element parent)

getFilteredMethods

protected Vector getFilteredMethods(ClassFile classFile)

getMethods

protected Hashtable getMethods(Element clazz)

getMethodSignature

protected String getMethodSignature(MethodInfo method)
JProbe does not put the java.lang prefix for classes in this package, so used this nice method so that I have the same signature for methods

getMethodSignature

protected String getMethodSignature(ClassFile clazz, MethodInfo method)
Convert to a CovReport-like signature - <classname>.<method>().

getPackages

protected Element[] getPackages(Element snapshot)

log

public void log(String message)

removeAbstractMethods

protected void removeAbstractMethods(ClassFile classFile, Element classNode)
Do additional work on an element to remove abstract methods that are reported by JProbe 3.0

serializeClass

protected void serializeClass(ClassFile classFile)
serialize a classfile into XML

setJProbehome

public void setJProbehome(File home)
set the JProbe home path. Used to get the DTD

setReportFilters

public void setReportFilters(ReportFilters filters)
set the

update

protected void update()
update the count of the XML, that is accumulate the stats on methods, classes and package so that the numbers are valid according to the info that was appended to the XML.
Copyright