org.springframework.beandoc.output
Class DocumentCompilerImpl

java.lang.Object
  extended by org.springframework.beandoc.output.DocumentCompilerImpl
All Implemented Interfaces:
DocumentCompiler

public class DocumentCompilerImpl
extends Object
implements DocumentCompiler

Default implementation of the DocumentCompiler interface. This class invokes the GraphViz binary (where suitably configured) to create the graphs and image map HTML from the generated .dot files. Further, it copies media resources from the BeanDoc jar file to the output location.

Since:
1.0
Author:
Darren Davison

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
DocumentCompilerImpl()
           
 
Method Summary
 void compile(org.jdom.Document[] contextDocuments, File outputDir)
          Generates actual images and HTML image maps (as required) from the dot files created by DotFileTransformer.
 String getDotExe()
          Location of the GraphViz 'dot' executable program on the local machine
 String getDotFileMapFormat()
           
 boolean isRemoveDotFiles()
          Should intermediate .dot files be removed?
 void setDotExe(String dotExe)
          Set the location of the 'dot' executable file from the Graphviz installation.
 void setDotFileExtension(String dotFileExtension)
          sets the file extension of Graphviz 'dot' files.
 void setDotFileMapFormat(String dotFileMapFormat)
          The image map format that Dot should use to generate an image map for the context graphs.
 void setFilenameStrategy(org.springframework.beandoc.output.FilenameStrategy filenameStrategy)
          set a filename strategy for output files generated by this class
 void setRemoveDotFiles(boolean removeDotFiles)
          A series of intermediate files (.dot files) are created which is what GraphViz uses to actually generate the graphs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

DocumentCompilerImpl

public DocumentCompilerImpl()
Method Detail

compile

public void compile(org.jdom.Document[] contextDocuments,
                    File outputDir)
Generates actual images and HTML image maps (as required) from the dot files created by DotFileTransformer. Subsequently plugs the image maps into placeholders in the graph html files.

Specified by:
compile in interface DocumentCompiler
See Also:
DocumentCompiler.compile(Document[], File)

setDotExe

public void setDotExe(String dotExe)
Set the location of the 'dot' executable file from the Graphviz installation. This file will be called with appropriate parameters if graphing output is required using a Runtime.getRuntime().exec(...) call. If this value is not set, graphing output will be disabled.

Parameters:
dotExe - the platform dependent location of the binary, ie "/usr/local/bin/dot" or "C:/graphviz/dot.exe"

setRemoveDotFiles

public void setRemoveDotFiles(boolean removeDotFiles)
A series of intermediate files (.dot files) are created which is what GraphViz uses to actually generate the graphs. Usually these will not be needed after the graphs are generated and so by default are discarded. If you need to keep them for any reason, set this value to false

Parameters:
removeDotFiles - set to false to prevent intermediate .dot files being discarded. True by default.

getDotExe

public String getDotExe()
Location of the GraphViz 'dot' executable program on the local machine

Returns:
the platform-dependent location of the GraphViz 'dot' executable file

isRemoveDotFiles

public boolean isRemoveDotFiles()
Should intermediate .dot files be removed?

Returns:
true if intermediate .dot files will be removed after graphing output has completed, or false if they will be kept in the output directory. True by default.

getDotFileMapFormat

public String getDotFileMapFormat()
Returns:
the format string to denote output type of the image map

setDotFileMapFormat

public void setDotFileMapFormat(String dotFileMapFormat)
The image map format that Dot should use to generate an image map for the context graphs. Most likely to be "cmap" or "cmapx". See GraphViz documentation for more information.

Parameters:
dotFileMapFormat - the format string to denote output type of the image map

setDotFileExtension

public void setDotFileExtension(String dotFileExtension)
sets the file extension of Graphviz 'dot' files. Defaults to '.dot'

Parameters:
dotFileExtension - the extension to use

setFilenameStrategy

public void setFilenameStrategy(org.springframework.beandoc.output.FilenameStrategy filenameStrategy)
set a filename strategy for output files generated by this class

Parameters:
filenameStrategy - the filename strategy to be used


Copyright © 2004-2008 Spring BeanDoc. All Rights Reserved.