org.apache.tools.ant.taskdefs.optional.metamata
Class MMetrics
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
- public class MMetrics
- extends AbstractMetamataTask
Calculates global complexity and quality metrics on Java source code.
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 :-(
For more information, visit the website at
www.metamata.com
- Author:
- Stephane Bailliez
Field Summary |
protected java.lang.String |
granularity
the granularity mode. |
protected java.io.File |
outFile
the XML output file |
protected Path |
path
|
protected java.io.File |
tmpFile
the location of the temporary txt report |
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(java.lang.String 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, scanFileSets, setMaxmemory, setMetamatahome, setUp |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
granularity
protected java.lang.String granularity
- the granularity mode. Should be one of 'files', 'methods' and 'types'.
outFile
protected java.io.File outFile
- the XML output file
tmpFile
protected java.io.File tmpFile
- the location of the temporary txt report
path
protected Path path
MMetrics
public MMetrics()
- default constructor
setGranularity
public void setGranularity(java.lang.String granularity)
- set the granularity of the audit. Should be one of 'files', 'methods'
or 'types'.
- Parameters:
granularity
- the audit reporting mode.
setTofile
public void setTofile(java.io.File file)
- Set the output XML file
- Parameters:
file
- the xml file to write the XML report to.
createPath
public Path createPath()
- Set a new path (directory) to measure metrics from.
- Returns:
- the path instance to use.
checkOptions
protected void checkOptions()
throws BuildException
- Description copied from class:
AbstractMetamataTask
- validate options set
- Overrides:
checkOptions
in class AbstractMetamataTask
execute0
protected void execute0(ExecuteStreamHandler handler)
throws BuildException
- Description copied from class:
AbstractMetamataTask
- execute the process with a specific handler
- Overrides:
execute0
in class AbstractMetamataTask
transformFile
protected void transformFile()
throws BuildException
- 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.
- See Also:
createStreamHandler()
cleanUp
protected void cleanUp()
throws BuildException
- cleanup the temporary txt report
- Overrides:
cleanUp
in class AbstractMetamataTask
createStreamHandler
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.
- Overrides:
createStreamHandler
in class AbstractMetamataTask
getOptions
protected java.util.Vector getOptions()
- Description copied from class:
AbstractMetamataTask
- return all options of the command line as string elements
- Overrides:
getOptions
in class AbstractMetamataTask
Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.