|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.Task | +--org.apache.tools.ant.taskdefs.optional.metamata.AbstractMetamataTask | +--org.apache.tools.ant.taskdefs.optional.metamata.MMetrics
Computes the metrics of a set of Java files and write the results to an XML file. As a convenience, a stylesheet is given in etc directory, so that an HTML report can be generated from the XML file.
You will not be able to use this task with the evaluation version since as of Metamata 2.0, Metrics does not support command line :-(
Nested Class Summary | |
static class |
MMetrics.GranularityAttribute
Attributes for granularity. |
Field Summary |
Fields inherited from class org.apache.tools.ant.taskdefs.optional.metamata.AbstractMetamataTask |
classPath, cmdl, fileSets, includedFiles, metamataHome, optionsFile, sourcePath |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
MMetrics()
default constructor |
Method Summary | |
protected void |
checkOptions()
validate options set |
protected void |
cleanUp()
cleanup the temporary txt report |
Path |
createPath()
Set a new path (directory) to measure metrics from. |
protected ExecuteStreamHandler |
createStreamHandler()
if the report is transform via a temporary txt file we should use a a normal logger here, otherwise we could use the metrics handler directly to capture and transform the output on stdout to XML. |
protected void |
execute0(ExecuteStreamHandler handler)
execute the process with a specific handler |
protected java.util.Vector |
getOptions()
return all options of the command line as string elements |
void |
setGranularity(MMetrics.GranularityAttribute granularity)
set the granularity of the audit. |
void |
setTofile(java.io.File file)
Set the output XML file |
protected void |
transformFile()
transform the generated file via the handler This function can either be called if the result is written to the output file via -output or we could use the handler directly on stdout if not. |
Methods inherited from class org.apache.tools.ant.taskdefs.optional.metamata.AbstractMetamataTask |
addAllVector, addFileSet, createClasspath, createJvmarg, createSourcepath, createTmpFile, execute, generateOptionsFile, getFileMapping, getMetamataJar, scanSources, scanSources, setHome, setMaxmemory, setMetamatahome, setUp |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MMetrics()
Method Detail |
public void setGranularity(MMetrics.GranularityAttribute granularity)
granularity
- the audit reporting mode.public void setTofile(java.io.File file)
file
- the xml file to write the XML report to.public Path createPath()
protected void checkOptions() throws BuildException
AbstractMetamataTask
checkOptions
in class AbstractMetamataTask
BuildException
protected void execute0(ExecuteStreamHandler handler) throws BuildException
AbstractMetamataTask
execute0
in class AbstractMetamataTask
BuildException
protected void transformFile() throws BuildException
BuildException
createStreamHandler()
protected void cleanUp() throws BuildException
cleanUp
in class AbstractMetamataTask
BuildException
protected ExecuteStreamHandler createStreamHandler()
createStreamHandler
in class AbstractMetamataTask
protected java.util.Vector getOptions()
AbstractMetamataTask
getOptions
in class AbstractMetamataTask
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |