org.apache.tools.ant.taskdefs.optional.metamata
Class MAudit

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.MAudit

public class MAudit
extends AbstractMetamataTask

Invokes the Metamata Audit/ Webgain Quality Analyzer on a set of Java files.

maudit performs static analysis of the Java source code and byte code files to find and report errors of style and potential problems related to performance, maintenance and robustness. As a convenience, a stylesheet is given in etc directory, so that an HTML report can be generated from the XML file.

Author:
Stephane Bailliez

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
MAudit()
          default constructor
 
Method Summary
protected  void checkOptions()
          validate the settings
protected  void cleanUp()
          clean up all the mess that we did with temporary objects
 Path createRulespath()
          classpath for additional audit rules these must be placed before metamata.jar !!
 Path createSearchpath()
          search path to use for unused global declarations; required when unused is set.
protected  ExecuteStreamHandler createStreamHandler()
          create a stream handler that will be used to get the output since metamata tools do not report with convenient files such as XML.
protected  java.util.Vector getOptions()
          create the option vector for the command
 void setExit(boolean flag)
          flag to tell the task to exit after the first error.
 void setFix(boolean flag)
          Automatically fix certain errors (those marked as fixable in the manual); optional, default=false
 void setFullsemanticize(boolean flag)
          internal/testing only
 void setList(boolean flag)
          Creates listing file for each audited file; optional, default false.
 void setOffsets(boolean flag)
          internal/testing only
 void setQuiet(boolean flag)
          flag to suppress copyright and summary messages; default false.
 void setTofile(java.io.File outFile)
          The XML file to which the Audit result should be written to; required
 void setUnused(boolean flag)
          Finds declarations unused in search paths; optional, default false.
 void setVerbose(boolean flag)
          flag to print all messages; optional, default false.
 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.metamata.AbstractMetamataTask
addAllVector, addFileSet, createClasspath, createJvmarg, createSourcepath, createTmpFile, execute, execute0, 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

MAudit

public MAudit()
default constructor

Method Detail

setTofile

public void setTofile(java.io.File outFile)
The XML file to which the Audit result should be written to; required


setFix

public void setFix(boolean flag)
Automatically fix certain errors (those marked as fixable in the manual); optional, default=false


setList

public void setList(boolean flag)
Creates listing file for each audited file; optional, default false. When set, a .maudit file will be generated in the same location as the source file.


setUnused

public void setUnused(boolean flag)
Finds declarations unused in search paths; optional, default false. It will look for unused global declarations in the source code within a use domain specified by the searchpath element.


setQuiet

public void setQuiet(boolean flag)
flag to suppress copyright and summary messages; default false. internal/testing only


setExit

public void setExit(boolean flag)
flag to tell the task to exit after the first error. internal/testing only


setOffsets

public void setOffsets(boolean flag)
internal/testing only


setVerbose

public void setVerbose(boolean flag)
flag to print all messages; optional, default false. internal/testing only


setFullsemanticize

public void setFullsemanticize(boolean flag)
internal/testing only


createRulespath

public Path createRulespath()
classpath for additional audit rules these must be placed before metamata.jar !!


createSearchpath

public Path createSearchpath()
search path to use for unused global declarations; required when unused is set.


getOptions

protected java.util.Vector getOptions()
create the option vector for the command

Specified by:
getOptions in class AbstractMetamataTask

checkOptions

protected void checkOptions()
                     throws BuildException
validate the settings

Overrides:
checkOptions in class AbstractMetamataTask
BuildException

createStreamHandler

protected ExecuteStreamHandler createStreamHandler()
                                            throws BuildException
Description copied from class: AbstractMetamataTask
create a stream handler that will be used to get the output since metamata tools do not report with convenient files such as XML.

Specified by:
createStreamHandler in class AbstractMetamataTask
BuildException

cleanUp

protected void cleanUp()
                throws BuildException
Description copied from class: AbstractMetamataTask
clean up all the mess that we did with temporary objects

Overrides:
cleanUp in class AbstractMetamataTask
BuildException


Copyright © 2000-2004 Apache Software Foundation. All Rights Reserved.