public class SourceViewMojo
extends org.apache.maven.plugin.AbstractMojo
This goal produces a syntax highlighted version of the as, mxml and html documents in the sources, and just copies other types of files. It also generates a navigation to browse the sources.
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.io.filefilter.IOFileFilter |
filter
The file filter to use when processing source files.
|
protected String |
outputEncoding
Encoding to use for the generated documentation.
|
protected org.apache.maven.project.MavenProject |
project
The Maven project.
|
protected String |
sourceViewDirectoryName
The name of the directory containing the "View source" documentation.
|
protected org.apache.velocity.VelocityContext |
velocityContext
The instance of
VelocityContext. |
protected org.apache.velocity.app.VelocityEngine |
velocityEngine
The instance of
VelocityEngine. |
| Constructor and Description |
|---|
SourceViewMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute() |
protected String |
getContentFrameSource()
Resolve the file to assign as the source of the content frame in the generated documentation.
|
protected String |
getHighlightFilter(String fileExtension)
Get the syntax highlighting filter to use for a file extension.
|
protected void |
processDirectory(File directory,
File targetDirectory)
Loop through source files in the directory and syntax highlight and/or copy them to the target directory.
|
protected void |
processFile(File file,
File targetDirectory)
Syntax highlight and/or copy the source file to the target directory.
|
protected void |
processTemplate(String templateName,
File targetDirectory)
Merge the given template with the
velocityContext and produce the file in the output
documentation. |
protected org.apache.maven.project.MavenProject project
protected String sourceViewDirectoryName
It must be the same as the one declared in the Flex application:
<mx:Application [...] viewSourceURL="srcview">
[...]
</mx:Application>
protected String outputEncoding
protected org.apache.velocity.app.VelocityEngine velocityEngine
VelocityEngine.protected org.apache.velocity.VelocityContext velocityContext
VelocityContext.protected org.apache.commons.io.filefilter.IOFileFilter filter
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void processDirectory(File directory, File targetDirectory)
directory - The source directory to process.targetDirectory - The directory where to store the output.protected void processFile(File file, File targetDirectory) throws IOException
file - The file to process.targetDirectory - The directory where to store the output.IOException - If there was a file read/write exception.protected String getHighlightFilter(String fileExtension)
fileExtension - the file extension to test.XhtmlRendererFactory#getSupportedTypes()}protected void processTemplate(String templateName, File targetDirectory) throws org.apache.maven.plugin.MojoFailureException
velocityContext and produce the file in the output
documentation.templateName - The name of the template to process.targetDirectory - The directory where to store the output file.org.apache.maven.plugin.MojoFailureException - If the template could not be loaded, parsed, or the output file could not be
written.protected String getContentFrameSource()
Tries to resolve the main source and defaults to a blank page if not found.
Copyright © 2008–2017 Sonatype, Inc.. All rights reserved.