net.sf.jfxdplugin
Class AbstractJavafxdocMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by net.sf.jfxdplugin.AbstractJavafxdocMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JavafxdocJar, JavafxdocReport

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

Base class for the Javafxdoc mojo. This class contains the majority of the mojo functionality.

Based on the Maven Javadoc Plugin version 2.6.

Since:
1.0
Version:
$Revision: 69 $ $Date: 2010-05-13 10:21:43 -0400 (Thu, 13 May 2010) $
Author:
Nathan Erwin, Brett Porter, Vincent Siveton
See Also:
http://maven.apache.org/plugins/maven-javadoc-plugin/

Field Summary
protected static String DEBUG_JAVAFXDOC_SCRIPT_NAME
          The Javafxdoc script file name when the debug parameter is on, i.e.
static Properties DEFAULT_JAVA_API_LINKS
          The default Javafxdoc API URLs according to the Sun/Oracle API Specifications.
protected static float DEFAULT_JAVAFX_VERSION
          The default JavaFX version (1.0) to use if no other viable version can be found.
protected static String FILES_FILE_NAME
          The files file name in the output directory when calling javafxdoc.exe(or .sh) [@options] [packagenames] [sourcefiles] [@files].
protected static String OPTIONS_FILE_NAME
          The options file name in the output directory when calling javafxdoc.exe(or .sh) [@options] [packagenames] [sourcefiles] [@files].
protected static float SINCE_JAVAFXDOC_1_3
          For Javafxdoc options that appear since JavaFX 1.3.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJavafxdocMojo()
           
 
Method Summary
protected  boolean canGenerateReport(List<String> files)
          Method that indicates whether the javafxdoc can be generated or not.
protected  void executeReport()
          Runs the report for the given parameters.
protected  String formatMessage(String message, Object... args)
          Formats the messages from the resource bundle with the given arguments.
 String[] getAdditionalJOptions()
          Returns the additional -J option value.
 String[] getAdditionalXslOptions()
          Returns the additional Xsl options value.
 String getBootclasspath()
          Returns the boot class path.
protected  ResourceBundle getBundle(Locale specificLocale)
          Gets the resource bundle for the specified locale.
 String getDoclet()
          Returns the doclet for HTML generation.
 String getDocletPath()
          Returns the path to the doclet for HTML generation.
 String getEncoding()
          Returns the output encoding.
 String getExcludePackageNames()
          Returns the list of package names to exclude.
 String getExtdirs()
          Returns the extension directories.
 String getExtracss()
          Returns the extra CSS file to use.
 String getExtrajs()
          Returns the extra JavaScript file to use.
protected  List<String> getFiles(List<String> sourcePaths)
          Method to get the files on the specified source paths.
 File[] getInputFiles()
          Returns the XML input file.
 String getJavafxdocExecutable()
          Returns the location of the Javafxdoc executable.
protected  float getJavafxdocVersion()
          Returns the javafxdoc tool version.
 String getLocale()
          Returns the documentation locale.
protected  Locale getLocaleObject()
          Constructs a Locale object from the specified locale.
 String getMastercss()
          Returns the location of the master CSS file.
 File getOutputDirectory()
          Returns the output directory for the plugin.
 File getOutputFile()
          Returns the XML output file.
 String getProfile()
          Returns the JavaFX platform name.
 org.apache.maven.project.MavenProject getProject()
          Returns the Maven project object.
protected  List<org.apache.maven.artifact.Artifact> getProjectArtifacts(org.apache.maven.project.MavenProject p)
          Returns the artifacts for the project.
 org.apache.maven.execution.MavenSession getSession()
          Returns the Maven session object.
 String getShow()
          Returns the visibility level to show in the documentation.
 String getSource()
          Returns the version of the source code.
 String getSourcePath()
          Returns the path to the source code.
protected  List<String> getSourcePaths()
          Method to get the source paths.
 String getSubpackages()
          Returns the sub packages to document.
protected  org.apache.maven.toolchain.ToolchainManager getToolchainManager()
          Returns the toolchain manager.
 File getXsltfile()
          Returns the XSL transformation file.
 boolean isBreakiterator()
          Returns whether the sentence break iterator is used.
 boolean isDebug()
          Returns whether the plugin is in debug mode.
 boolean isFailOnError()
          Returns whether the plugin fails on errors.
 boolean isNohtml()
          Returns whether HTML files are generated.
 boolean isQuiet()
          Returns whether the plugin operates in quiet mode.
 boolean isVerbose()
          Returns whether the plugin operates in verbose mode.
 void setAdditionalJOptions(String[] additionalJOptions)
          Specifies the additional -J option value.
 void setAdditionalXslOptions(String[] additionalXslOptions)
          Specifies the additional Xsl option value.
 void setBootclasspath(String bootclasspath)
          Specifies the boot class path.
 void setBreakiterator(boolean breakiterator)
          Specifies whether the sentence break iterator is used.
 void setDebug(boolean debug)
          Specifies whether the plugin is in debug mode.
 void setDoclet(String doclet)
          Specifies the doclet for HTML generation.
 void setDocletPath(String docletPath)
          Specifies the path to the doclet for HTML generation.
 void setEncoding(String encoding)
          Specifies the output encoding.
 void setExcludePackageNames(String excludePackageNames)
          Specifies the list of package names to exclude.
 void setExtdirs(String extdirs)
          Specifies the extension directories.
 void setExtracss(String extracss)
          Specifies the extra CSS file to use.
 void setExtrajs(String extrajs)
          Specifies the extra JavaScript file to use.
 void setFailOnError(boolean failOnError)
          Specifies whether the plugin fails on errors.
 void setInputFiles(File[] inputFiles)
          Specifies the XML input file.
 void setJavafxdocExecutable(String javafxdocExecutable)
          Specifies the location of the Javafxdoc executable.
 void setLocale(String locale)
          Specifies the documentation locale.
 void setMastercss(String mastercss)
          Specifies the location of the master CSS file.
 void setNohtml(boolean nohtml)
          Specifies whether HTML files are generated.
 void setOutputDirectory(File outputDirectory)
          Specifies the output directory for the plugin.
 void setOutputFile(File outputFile)
          Specifies the XML output file.
 void setProfile(String profile)
          Specifies the JavaFX platform name (desktop, mobile, tv).
 void setProject(org.apache.maven.project.MavenProject project)
          Specifies the Maven project object.
 void setQuiet(boolean quiet)
          Specifies whether the plugin operates in quiet mode.
 void setShow(String show)
          Specifies the visibility level to show in the documentation.
 void setSource(String source)
          Specifies the version of the source code.
 void setSourcePath(String sourcePath)
          Specifies the path to the source code.
 void setSubpackages(String subpackages)
          Specifies the sub packages to document.
protected  void setToolchainManager(org.apache.maven.toolchain.ToolchainManager toolchainManager)
          Specifies the toolchain manager.
 void setVerbose(boolean verbose)
          Specifies whether the plugin operates in verbose mode.
 void setXsltfile(File xsltfile)
          Specifies the XSL transformation file.
 
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

DEFAULT_JAVA_API_LINKS

public static final Properties DEFAULT_JAVA_API_LINKS
The default Javafxdoc API URLs according to the Sun/Oracle API Specifications.
 <javaFXApiLinks>
   <property>
     <name>api_1.0</name>
     <value>http://java.sun.com/javafx/1/docs/api/</value>
   </property>
   <property>
     <name>api_1.1</name>
     <value>http://java.sun.com/javafx/1.1/docs/api/</value>
   </property>
   <property>
     <name>api_1.2</name>
     <value>http://java.sun.com/javafx/1.2/docs/api/</value>
   </property>
   <property>
     <name>api_1.3</name>
     <value>http://java.sun.com/javafx/1.3/docs/api/</value>
 </javaFXApiLinks>
 


DEBUG_JAVAFXDOC_SCRIPT_NAME

protected static final String DEBUG_JAVAFXDOC_SCRIPT_NAME
The Javafxdoc script file name when the debug parameter is on, i.e. javafxdoc.bat or javafxdoc.sh.


FILES_FILE_NAME

protected static final String FILES_FILE_NAME
The files file name in the output directory when calling javafxdoc.exe(or .sh) [@options] [packagenames] [sourcefiles] [@files].

See Also:
Constant Field Values

OPTIONS_FILE_NAME

protected static final String OPTIONS_FILE_NAME
The options file name in the output directory when calling javafxdoc.exe(or .sh) [@options] [packagenames] [sourcefiles] [@files].

See Also:
Constant Field Values

DEFAULT_JAVAFX_VERSION

protected static final float DEFAULT_JAVAFX_VERSION
The default JavaFX version (1.0) to use if no other viable version can be found.

See Also:
Constant Field Values

SINCE_JAVAFXDOC_1_3

protected static final float SINCE_JAVAFXDOC_1_3
For Javafxdoc options that appear since JavaFX 1.3.

See Also:
Constant Field Values
Constructor Detail

AbstractJavafxdocMojo

public AbstractJavafxdocMojo()
Method Detail

getAdditionalJOptions

public String[] getAdditionalJOptions()
Returns the additional -J option value.

Returns:
the additional -J option value

setAdditionalJOptions

public void setAdditionalJOptions(String[] additionalJOptions)
Specifies the additional -J option value.

Parameters:
additionalJOptions - the additional -J option value

getAdditionalXslOptions

public String[] getAdditionalXslOptions()
Returns the additional Xsl options value.

Returns:
the additional Xsl options value

setAdditionalXslOptions

public void setAdditionalXslOptions(String[] additionalXslOptions)
Specifies the additional Xsl option value.

Parameters:
additionalXslOptions - the additional Xsl option value

getBootclasspath

public String getBootclasspath()
Returns the boot class path.

Returns:
the boot class path

setBootclasspath

public void setBootclasspath(String bootclasspath)
Specifies the boot class path.

Parameters:
bootclasspath - the boot class path

isBreakiterator

public boolean isBreakiterator()
Returns whether the sentence break iterator is used.

Returns:
whether the sentence break iterator is used

setBreakiterator

public void setBreakiterator(boolean breakiterator)
Specifies whether the sentence break iterator is used.

Parameters:
breakiterator - whether the sentence break iterator is used

isDebug

public boolean isDebug()
Returns whether the plugin is in debug mode.

Returns:
whether the plugin is in debug mode

setDebug

public void setDebug(boolean debug)
Specifies whether the plugin is in debug mode.

Parameters:
debug - whether the plugin is in debug mode

getDoclet

public String getDoclet()
Returns the doclet for HTML generation.

Returns:
the doclet for HTML generation

setDoclet

public void setDoclet(String doclet)
Specifies the doclet for HTML generation.

Parameters:
doclet - the doclet for HTML generation

getDocletPath

public String getDocletPath()
Returns the path to the doclet for HTML generation.

Returns:
the path to the doclet for HTML generation

setDocletPath

public void setDocletPath(String docletPath)
Specifies the path to the doclet for HTML generation.

Parameters:
docletPath - the path to the doclet for HTML generation

getEncoding

public String getEncoding()
Returns the output encoding.

Returns:
the output encoding

setEncoding

public void setEncoding(String encoding)
Specifies the output encoding.

Parameters:
encoding - the output encoding

getExcludePackageNames

public String getExcludePackageNames()
Returns the list of package names to exclude.

Returns:
the list of package names to exclude

setExcludePackageNames

public void setExcludePackageNames(String excludePackageNames)
Specifies the list of package names to exclude.

Parameters:
excludePackageNames - the list of package names to exclude

getExtdirs

public String getExtdirs()
Returns the extension directories.

Returns:
the extension directories

setExtdirs

public void setExtdirs(String extdirs)
Specifies the extension directories.

Parameters:
extdirs - the extension directories

getExtracss

public String getExtracss()
Returns the extra CSS file to use.

Returns:
the extra CSS file to use

setExtracss

public void setExtracss(String extracss)
Specifies the extra CSS file to use.

Parameters:
extracss - the extra CSS file to use

getExtrajs

public String getExtrajs()
Returns the extra JavaScript file to use.

Returns:
the extra JavaScript file to use

setExtrajs

public void setExtrajs(String extrajs)
Specifies the extra JavaScript file to use.

Parameters:
extrajs - the extra JavaScript file to use

isFailOnError

public boolean isFailOnError()
Returns whether the plugin fails on errors.

Returns:
whether the plugin fails on errors

setFailOnError

public void setFailOnError(boolean failOnError)
Specifies whether the plugin fails on errors.

Parameters:
failOnError - whether the plugin fails on errors

getInputFiles

public File[] getInputFiles()
Returns the XML input file.

Returns:
the XML input file

setInputFiles

public void setInputFiles(File[] inputFiles)
Specifies the XML input file.

Parameters:
inputFiles - the XML input file

getJavafxdocExecutable

public String getJavafxdocExecutable()
Returns the location of the Javafxdoc executable.

Returns:
the location of the Javafxdoc executable

setJavafxdocExecutable

public void setJavafxdocExecutable(String javafxdocExecutable)
Specifies the location of the Javafxdoc executable.

Parameters:
javafxdocExecutable - the location of the Javafxdoc executable

getLocale

public String getLocale()
Returns the documentation locale.

Returns:
the documentation locale

setLocale

public void setLocale(String locale)
Specifies the documentation locale.

Parameters:
locale - the documentation locale

getMastercss

public String getMastercss()
Returns the location of the master CSS file.

Returns:
the location of the master CSS file

setMastercss

public void setMastercss(String mastercss)
Specifies the location of the master CSS file.

Parameters:
mastercss - the location of the master CSS file

isNohtml

public boolean isNohtml()
Returns whether HTML files are generated.

Returns:
whether HTML files are generated

setNohtml

public void setNohtml(boolean nohtml)
Specifies whether HTML files are generated.

Parameters:
nohtml - whether HTML files are generated

getOutputDirectory

public File getOutputDirectory()
Returns the output directory for the plugin.

Returns:
the output directory for the plugin

setOutputDirectory

public void setOutputDirectory(File outputDirectory)
Specifies the output directory for the plugin.

Parameters:
outputDirectory - the output directory for the plugin

getOutputFile

public File getOutputFile()
Returns the XML output file.

Returns:
the XML output file

setOutputFile

public void setOutputFile(File outputFile)
Specifies the XML output file.

Parameters:
outputFile - the XML output file

getProject

public org.apache.maven.project.MavenProject getProject()
Returns the Maven project object.

Returns:
the Maven project object

setProject

public void setProject(org.apache.maven.project.MavenProject project)
Specifies the Maven project object.

Parameters:
project - the Maven project object

getProfile

public String getProfile()
Returns the JavaFX platform name.

Returns:
the JavaFX platform name

setProfile

public void setProfile(String profile)
Specifies the JavaFX platform name (desktop, mobile, tv).

Parameters:
profile - the JavaFX platform name

isQuiet

public boolean isQuiet()
Returns whether the plugin operates in quiet mode.

Returns:
whether the plugin operates in quiet mode

setQuiet

public void setQuiet(boolean quiet)
Specifies whether the plugin operates in quiet mode.

Parameters:
quiet - whether the plugin operates in quiet mode

getSession

public org.apache.maven.execution.MavenSession getSession()
Returns the Maven session object.

Returns:
the Maven session object

getShow

public String getShow()
Returns the visibility level to show in the documentation.

Returns:
the visibility level to show in the documentation

setShow

public void setShow(String show)
Specifies the visibility level to show in the documentation.

Parameters:
show - the visibility level to show in the documentation

getSource

public String getSource()
Returns the version of the source code.

Returns:
the version of the source code

setSource

public void setSource(String source)
Specifies the version of the source code.

Parameters:
source - the version of the source code

getSourcePath

public String getSourcePath()
Returns the path to the source code.

Returns:
the path to the source code

setSourcePath

public void setSourcePath(String sourcePath)
Specifies the path to the source code.

Parameters:
sourcePath - the path to the source code

getSubpackages

public String getSubpackages()
Returns the sub packages to document.

Returns:
the sub packages to document

setSubpackages

public void setSubpackages(String subpackages)
Specifies the sub packages to document.

Parameters:
subpackages - the sub packages to document

getToolchainManager

protected org.apache.maven.toolchain.ToolchainManager getToolchainManager()
Returns the toolchain manager.

Returns:
the toolchain manager

setToolchainManager

protected void setToolchainManager(org.apache.maven.toolchain.ToolchainManager toolchainManager)
Specifies the toolchain manager.

Parameters:
toolchainManager - the toolchain manager

isVerbose

public boolean isVerbose()
Returns whether the plugin operates in verbose mode.

Returns:
whether the plugin operates in verbose mode

setVerbose

public void setVerbose(boolean verbose)
Specifies whether the plugin operates in verbose mode.

Parameters:
verbose - whether the plugin operates in verbose mode

getXsltfile

public File getXsltfile()
Returns the XSL transformation file.

Returns:
the XSL transformation file

setXsltfile

public void setXsltfile(File xsltfile)
Specifies the XSL transformation file.

Parameters:
xsltfile - the XSL transformation file

canGenerateReport

protected boolean canGenerateReport(List<String> files)
Method that indicates whether the javafxdoc 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 javafxdoc report can be generated or not

executeReport

protected void executeReport()
                      throws org.apache.maven.reporting.MavenReportException
Runs the report for the given parameters.

Throws:
org.apache.maven.reporting.MavenReportException - if problems are found during generation

formatMessage

protected String formatMessage(String message,
                               Object... args)
Formats the messages from the resource bundle with the given arguments.

Parameters:
message - the message key in the resource bundle
args - variable list of arguments to the message
Returns:
a string containing the formatted message

getBundle

protected ResourceBundle getBundle(Locale specificLocale)
Gets the resource bundle for the specified locale.

Parameters:
specificLocale - the locale of the currently generated report
Returns:
the resource bundle for the requested locale

getFiles

protected List<String> getFiles(List<String> 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

getJavafxdocVersion

protected float getJavafxdocVersion()
Returns the javafxdoc tool version.

Returns:
the javafxdoc tool version

getLocaleObject

protected Locale getLocaleObject()
Constructs a Locale object from the specified locale.

Returns:
a Locale object based on the locale parameter
See Also:
setLocale(java.lang.String)

getProjectArtifacts

protected List<org.apache.maven.artifact.Artifact> getProjectArtifacts(org.apache.maven.project.MavenProject p)
Returns the artifacts for the project.

Parameters:
p - the Maven project
Returns:
the project artifacts

getSourcePaths

protected List<String> 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 absolute source paths
See Also:
JavafxdocUtil.pruneDirs(org.apache.maven.project.MavenProject, java.util.List)


Copyright © 2010 Maven Javafxdoc Plugin. All Rights Reserved.