org.codehaus.mojo.rat
Class RatReportMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.rat.AbstractRatMojo
          extended by org.codehaus.mojo.rat.RatReportMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.apache.maven.reporting.MavenReport

public class RatReportMojo
extends AbstractRatMojo
implements org.apache.maven.reporting.MavenReport

Generates a report with RAT's output.


Field Summary
 
Fields inherited from class org.codehaus.mojo.rat.AbstractRatMojo
basedir, ECLIPSE_DEFAULT_EXCLUDES, IDEA_DEFAULT_EXCLUDES, MAVEN_DEFAULT_EXCLUDES
 
Fields inherited from interface org.apache.maven.reporting.MavenReport
CATEGORY_PROJECT_INFORMATION, CATEGORY_PROJECT_REPORTS, ROLE
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
RatReportMojo()
           
 
Method Summary
 boolean canGenerateReport()
          Returns, whether the report may be generated.
 void execute()
          Called from Maven to invoke the plugin.
 void generate(org.apache.maven.doxia.sink.Sink sink, Locale locale)
          Writes the report to the Doxia sink.
 String getCategoryName()
          Returns the reports category name.
 String getDescription(Locale locale)
          Returns the reports description.
 String getName(Locale locale)
          Returns the reports name.
 String getOutputName()
          Returns the reports file name.
 File getReportOutputDirectory()
          Returns the reports output directory.
 boolean isExternalReport()
          Returns, whether this is an external report.
 void setReportOutputDirectory(File pOutputDirectory)
          Sets the reports output directory.
 
Methods inherited from class org.codehaus.mojo.rat.AbstractRatMojo
createReport, getLicenseMatchers, getProject, getResources
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatReportMojo

public RatReportMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Called from Maven to invoke the plugin.

Specified by:
execute in interface org.apache.maven.plugin.Mojo
Throws:
org.apache.maven.plugin.MojoFailureException - An error in the plugin configuration was detected.
org.apache.maven.plugin.MojoExecutionException - An error occurred while creating the report.

canGenerateReport

public boolean canGenerateReport()
Returns, whether the report may be generated.

Specified by:
canGenerateReport in interface org.apache.maven.reporting.MavenReport
Returns:
Always true.

generate

public void generate(org.apache.maven.doxia.sink.Sink sink,
                     Locale locale)
              throws org.apache.maven.reporting.MavenReportException
Writes the report to the Doxia sink.

Specified by:
generate in interface org.apache.maven.reporting.MavenReport
Parameters:
sink - The doxia sink, kind of a SAX handler.
locale - The locale to use for writing the report.
Throws:
org.apache.maven.reporting.MavenReportException - Writing the report failed.

getCategoryName

public String getCategoryName()
Returns the reports category name.

Specified by:
getCategoryName in interface org.apache.maven.reporting.MavenReport
Returns:
MavenReport.CATEGORY_PROJECT_REPORTS

getDescription

public String getDescription(Locale locale)
Returns the reports description.

Specified by:
getDescription in interface org.apache.maven.reporting.MavenReport
Parameters:
locale - Requested locale of the bundle
Returns:
Report description, as given by the key "report.rat.description" in the bundle.

getName

public String getName(Locale locale)
Returns the reports name.

Specified by:
getName in interface org.apache.maven.reporting.MavenReport
Parameters:
locale - Requested locale of the bundle
Returns:
Report name, as given by the key "report.rat.name" in the bundle.

getOutputName

public String getOutputName()
Returns the reports file name.

Specified by:
getOutputName in interface org.apache.maven.reporting.MavenReport
Returns:
"rat-report"

getReportOutputDirectory

public File getReportOutputDirectory()
Returns the reports output directory.

Specified by:
getReportOutputDirectory in interface org.apache.maven.reporting.MavenReport
Returns:
Value of the "outputDirectory" parameter.

isExternalReport

public boolean isExternalReport()
Returns, whether this is an external report.

Specified by:
isExternalReport in interface org.apache.maven.reporting.MavenReport
Returns:
Always false.

setReportOutputDirectory

public void setReportOutputDirectory(File pOutputDirectory)
Sets the reports output directory.

Specified by:
setReportOutputDirectory in interface org.apache.maven.reporting.MavenReport
Parameters:
pOutputDirectory - Reports target directory.


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.