org.apache.maven.plugin.javadoc
Class AbstractJavadocMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.javadoc.AbstractJavadocMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JavadocJar, JavadocReport

public abstract class AbstractJavadocMojo
extends org.apache.maven.plugin.AbstractMojo

Base class with majority of Javadoc functionalities.

Since:
2.0
Version:
$Id: AbstractJavadocMojo.java 633446 2008-03-04 12:28:11Z vsiveton $
Author:
Brett Porter, Vincent Siveton

Field Summary
protected  boolean aggregate
          Whether to build an aggregated report at the root, or build individual reports.
protected  java.io.File outputDirectory
          Specifies the destination directory where javadoc saves the generated HTML files.
protected  org.apache.maven.project.MavenProject project
          The Maven Project Object
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJavadocMojo()
           
 
Method Summary
protected  boolean canGenerateReport(java.util.List files)
          Method that indicates whether the javadoc can be generated or not.
protected  void executeReport(java.util.Locale locale)
           
protected  java.lang.String getDoctitle()
           
protected  java.util.List getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getFiles(java.util.List sourcePaths)
          Method to get the files on the specified source paths
protected  java.io.File getJavadocDirectory()
           
protected  java.lang.String getOutputDirectory()
           
protected  java.io.File getOverview()
           
protected  java.util.List getProjectArtifacts(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getProjectSourceRoots(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getSourcePaths()
          Method to get the source paths.
protected  java.lang.String getWindowtitle()
           
 
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
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

project

protected org.apache.maven.project.MavenProject project
The Maven Project Object


aggregate

protected boolean aggregate
Whether to build an aggregated report at the root, or build individual reports.


outputDirectory

protected java.io.File outputDirectory
Specifies the destination directory where javadoc saves the generated HTML files.
See d.

Constructor Detail

AbstractJavadocMojo

public AbstractJavadocMojo()
Method Detail

getOutputDirectory

protected java.lang.String getOutputDirectory()
Returns:
the output directory

getProjectBuildOutputDirs

protected java.util.List getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p)
Parameters:
p - a maven project
Returns:
the list of directories where compiled classes are placed for the given project. These dirs are added in the javadoc classpath.

getProjectSourceRoots

protected java.util.List getProjectSourceRoots(org.apache.maven.project.MavenProject p)
Parameters:
p - a maven project
Returns:
the list of source paths for the given project

getExecutionProjectSourceRoots

protected java.util.List getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)
Parameters:
p - a maven project
Returns:
the list of source paths for the execution project of the given project

getProjectArtifacts

protected java.util.List getProjectArtifacts(org.apache.maven.project.MavenProject p)
Parameters:
p - a maven project
Returns:
the list of artifacts for the given project

getJavadocDirectory

protected java.io.File getJavadocDirectory()
Returns:
the current javadoc directory

getDoctitle

protected java.lang.String getDoctitle()
Returns:
the title to be placed near the top of the overview summary file

getOverview

protected java.io.File getOverview()
Returns:
the overview documentation file from the user parameter or from the javadocdirectory

getWindowtitle

protected java.lang.String getWindowtitle()
Returns:
the title to be placed in the HTML title tag

executeReport

protected void executeReport(java.util.Locale locale)
                      throws org.apache.maven.reporting.MavenReportException
Parameters:
locale - the wanted locale (actually unused).
Throws:
org.apache.maven.reporting.MavenReportException - if any

getFiles

protected java.util.List getFiles(java.util.List sourcePaths)
Method to get the files on the specified source paths

Parameters:
sourcePaths - a List that contains the paths to the source files
Returns:
a List that contains the specific path for every source file

getSourcePaths

protected java.util.List getSourcePaths()
Method to get the source paths. If no source path is specified in the parameter, the compile source roots of the project will be used.

Returns:
a List of the project source paths

canGenerateReport

protected boolean canGenerateReport(java.util.List files)
Method that indicates whether the javadoc can be generated or not. If the project does not contain any source files and no subpackages are specified, the plugin will terminate.

Parameters:
files - the project files
Returns:
a boolean that indicates whether javadoc report can be generated or not


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