org.codehaus.mojo.cobertura.tasks
Class AbstractTask

java.lang.Object
  extended by org.codehaus.mojo.cobertura.tasks.AbstractTask
Direct Known Subclasses:
CheckTask, InstrumentTask, ReportTask

public abstract class AbstractTask
extends Object

Base Abstract Class for all of the Tasks.

Author:
Joakim Erdfelt

Field Summary
protected  CommandLineArguments cmdLineArgs
          The shared command line args.
 
Constructor Summary
protected AbstractTask(String taskClassname)
          Initialize AbstractTask.
 
Method Summary
 String createClasspath()
          Using the ${project.compileClasspathElements} and the ${plugin.artifacts}, create a classpath string that is suitable to be used from a forked cobertura process.
abstract  void execute()
          Run the task.
protected  int executeJava()
          Run a jvm to execute something.
 CommandLineArguments getCmdLineArgs()
          Return the command line args.
 org.apache.maven.plugin.logging.Log getLog()
           
 String getMaxmem()
           
 List<org.apache.maven.artifact.Artifact> getPluginClasspathList()
           
 boolean isQuiet()
          Getter for quiet.
 void setCmdLineArgs(CommandLineArguments cmdLineArgs)
          Set the entire command line args.
 void setLog(org.apache.maven.plugin.logging.Log log)
          Set the logger.
 void setMaxmem(String maxmem)
          Set the -Xmx value for the jvm.
 void setPluginClasspathList(List<org.apache.maven.artifact.Artifact> pluginClasspathList)
           
 void setQuiet(boolean quiet)
          Setter for quiet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cmdLineArgs

protected CommandLineArguments cmdLineArgs
The shared command line args.

Constructor Detail

AbstractTask

protected AbstractTask(String taskClassname)
Initialize AbstractTask.

Parameters:
taskClassname - the classname for the task.
Method Detail

setQuiet

public void setQuiet(boolean quiet)
Setter for quiet.

Parameters:
quiet - The quiet to set.

isQuiet

public boolean isQuiet()
Getter for quiet.

Returns:
Returns the quiet.

createClasspath

public String createClasspath()
                       throws org.apache.maven.plugin.MojoExecutionException
Using the ${project.compileClasspathElements} and the ${plugin.artifacts}, create a classpath string that is suitable to be used from a forked cobertura process.

Returns:
the classpath string
Throws:
org.apache.maven.plugin.MojoExecutionException - if the pluginArtifacts cannot be properly resolved to a full system path.

execute

public abstract void execute()
                      throws org.apache.maven.plugin.MojoExecutionException,
                             org.apache.maven.plugin.MojoFailureException
Run the task.

Throws:
org.apache.maven.plugin.MojoExecutionException - for a full-out execution problem.
org.apache.maven.plugin.MojoFailureException - for an anticipated failure.

executeJava

protected int executeJava()
                   throws org.apache.maven.plugin.MojoExecutionException
Run a jvm to execute something.

Returns:
the exit code.
Throws:
org.apache.maven.plugin.MojoExecutionException - for an error launching the jvm.

getCmdLineArgs

public CommandLineArguments getCmdLineArgs()
Return the command line args.

Returns:
the command line args.

getLog

public org.apache.maven.plugin.logging.Log getLog()
Returns:
a log object.

getMaxmem

public String getMaxmem()
Returns:
the configured -Xmx option.

getPluginClasspathList

public List<org.apache.maven.artifact.Artifact> getPluginClasspathList()
Returns:
Returns the pluginClasspathList.

setCmdLineArgs

public void setCmdLineArgs(CommandLineArguments cmdLineArgs)
Set the entire command line args.

Parameters:
cmdLineArgs - new args.

setLog

public void setLog(org.apache.maven.plugin.logging.Log log)
Set the logger.

Parameters:
log - the new logger.

setMaxmem

public void setMaxmem(String maxmem)
Set the -Xmx value for the jvm.

Parameters:
maxmem - the memory size.

setPluginClasspathList

public void setPluginClasspathList(List<org.apache.maven.artifact.Artifact> pluginClasspathList)
Parameters:
pluginClasspathList - The pluginClasspathList to set.


Copyright © 2005-2011 Codehaus. All Rights Reserved.