com.github.jlgrock.javascriptframework.jsdocs
Class AbstractJsDocsMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by com.github.jlgrock.javascriptframework.jsdocs.AbstractJsDocsMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractJsDocsAggMojo, AbstractJsDocsNonAggMojo

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

The abstract jsdoc creation class.


Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJsDocsMojo()
           
 
Method Summary
protected  void archive(File archiveDir)
          Archive the directory of the jsdocs.
protected  List<String> createArgumentStack(Set<File> files)
          Create a list of arguments for the jsdoc toolkit.
static File generateArchive(AbstractJsDocsMojo mojo, File javadocFiles, String jarFileName)
          Method that creates the jar file.
 org.apache.maven.archiver.MavenArchiveConfiguration getArchive()
           
abstract  File getArchiveOutputDirectory()
          return the file location of where the archive of the jsdocs should be placed.
protected  File getBaseDir()
           
protected abstract  String getClassifier()
          The classifier that will be used for the file name.
 File getDefaultManifestFile()
           
 String getExtensionFormat()
           
protected  String getFinalName()
           
 org.codehaus.plexus.archiver.jar.JarArchiver getJarArchiver()
           
 File getJsDocAppLocation()
          The location of the JsDocApplication for use in the JsDocMojos.
abstract  File getOutputDirectory()
           
 org.apache.maven.project.MavenProject getProject()
           
 org.apache.maven.project.MavenProjectHelper getProjectHelper()
           
 int getRecurseDepth()
           
abstract  Set<File> getSourceFiles()
          This will get a listing of all of the files that should be used to create the jsdocs.
 File getTemplate()
           
 File getToolkitExtractDirectory()
           
 boolean isAllFunctions()
           
 boolean isForceUnique()
           
 boolean isIgnoreCode()
           
 boolean isIncludePrivate()
           
 boolean isIncludeSourceCode()
           
 boolean isUseDefaultManifestFile()
           
 
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
 

Constructor Detail

AbstractJsDocsMojo

public AbstractJsDocsMojo()
Method Detail

getToolkitExtractDirectory

public final File getToolkitExtractDirectory()
Returns:
the toolkitExtractDirectory

getFinalName

protected final String getFinalName()
Returns:
finalName

getBaseDir

protected final File getBaseDir()
Returns:
the base directory

getClassifier

protected abstract String getClassifier()
The classifier that will be used for the file name.

Returns:
the classifier

getDefaultManifestFile

public final File getDefaultManifestFile()
Returns:
defaultManifestFile

isUseDefaultManifestFile

public final boolean isUseDefaultManifestFile()
Returns:
useDefaultManifestFile

getProject

public final org.apache.maven.project.MavenProject getProject()
Returns:
project

getArchive

public final org.apache.maven.archiver.MavenArchiveConfiguration getArchive()
Returns:
archive

getJarArchiver

public final org.codehaus.plexus.archiver.jar.JarArchiver getJarArchiver()
Returns:
archive

isAllFunctions

public final boolean isAllFunctions()
Returns:
allFunctions parameter

isIgnoreCode

public final boolean isIgnoreCode()
Returns:
ignoreCode

isIncludeSourceCode

public final boolean isIncludeSourceCode()
Returns:
includeSourceCode

getOutputDirectory

public abstract File getOutputDirectory()
Returns:
outputDirectory

isIncludePrivate

public final boolean isIncludePrivate()
Returns:
the includePrivate

getRecurseDepth

public final int getRecurseDepth()
Returns:
recurseDepth;

getTemplate

public final File getTemplate()
Returns:
the template

isForceUnique

public final boolean isForceUnique()
Returns:
forceUnique

getJsDocAppLocation

public final File getJsDocAppLocation()
The location of the JsDocApplication for use in the JsDocMojos.

Returns:
the run.js file location

createArgumentStack

protected final List<String> createArgumentStack(Set<File> files)
                                          throws org.apache.maven.reporting.MavenReportException
Create a list of arguments for the jsdoc toolkit.

Parameters:
files - the files to create jsdocs for
Returns:
the list of arguments
Throws:
org.apache.maven.reporting.MavenReportException - whenever the necessary arguments have been passed in incorrectly or if there is a problem with one of the parameters sent in

archive

protected final void archive(File archiveDir)
                      throws IOException
Archive the directory of the jsdocs.

Parameters:
archiveDir - the location to write the archive
Throws:
IOException - If there is a problem unzipping to the directory

getSourceFiles

public abstract Set<File> getSourceFiles()
This will get a listing of all of the files that should be used to create the jsdocs.

Returns:
the set of files

generateArchive

public static File generateArchive(AbstractJsDocsMojo mojo,
                                   File javadocFiles,
                                   String jarFileName)
                            throws org.codehaus.plexus.archiver.ArchiverException,
                                   IOException
Method that creates the jar file.

Parameters:
mojo - the mojo to receive maven specific variables from.
javadocFiles - the directory where the generated jar file will be put
jarFileName - the filename of the generated jar file
Returns:
a File object that contains the generated jar file
Throws:
org.codehaus.plexus.archiver.ArchiverException - if any
IOException - if any

getProjectHelper

public final org.apache.maven.project.MavenProjectHelper getProjectHelper()
Returns:
the project helper

getExtensionFormat

public final String getExtensionFormat()
Returns:
the extension used throughout

getArchiveOutputDirectory

public abstract File getArchiveOutputDirectory()
return the file location of where the archive of the jsdocs should be placed. This should return null if no archive is expected to be created.

Returns:
the output directory or null in the case that it does not archive


Copyright © 2012. All Rights Reserved.