org.springframework.beandoc.output
Class DotFileTransformer

java.lang.Object
  extended by org.springframework.beandoc.output.XslTransformer
      extended by org.springframework.beandoc.output.DotFileTransformer
All Implemented Interfaces:
Transformer

public class DotFileTransformer
extends XslTransformer

Generates graphs from the context files, firstly transforming the XML to an intermediate .dot file that GraphViz uses to generate the actual images. In addition, it will generate a consolidated image from all supplied context documents.

Since:
1.0
Author:
Darren Davison, Marat Radchenko

Field Summary
 
Fields inherited from class org.springframework.beandoc.output.XslTransformer
filenameStrategy, logger, staticParameters
 
Constructor Summary
DotFileTransformer()
          constructs the Transformer with a default stylesheet included in the beandoc tool.
DotFileTransformer(String templateName)
          constructs the Transformer with the stylesheet provided.
 
Method Summary
protected  String getOutputForDocument(String inputFileName)
          Adds input files to a list for post-processing prior to returning the name of the output file.
protected  void initTransform(org.jdom.Document[] contextDocuments, File outputDirectory)
          Stores references to the context documents and output directory which it later uses to build a consolidated graph.
protected  void postTransform()
          Generate a consolidated graph of the entire context using the same stylesheet reference provided on construction.
 
Methods inherited from class org.springframework.beandoc.output.XslTransformer
doXslTransform, getParameters, getStaticParameters, getTemplateName, handleTransform, setFilenameStrategy, setLocale, setStaticParameters, setTemplateName, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotFileTransformer

public DotFileTransformer()
constructs the Transformer with a default stylesheet included in the beandoc tool.


DotFileTransformer

public DotFileTransformer(String templateName)
constructs the Transformer with the stylesheet provided. The templateName can be any resolvable Spring Resource.

Parameters:
templateName -
Method Detail

initTransform

protected void initTransform(org.jdom.Document[] contextDocuments,
                             File outputDirectory)
                      throws Exception
Stores references to the context documents and output directory which it later uses to build a consolidated graph.

Overrides:
initTransform in class XslTransformer
Parameters:
contextDocuments - the array of DOM trees about to be transformed
outputDirectory - the file handle for the output directory
Throws:
Exception
See Also:
XslTransformer.initTransform(org.jdom.Document[], java.io.File)

getOutputForDocument

protected String getOutputForDocument(String inputFileName)
Adds input files to a list for post-processing prior to returning the name of the output file.

Overrides:
getOutputForDocument in class XslTransformer
Parameters:
inputFileName - the original file name (not including path) of the context file
Returns:
the output file name to use
See Also:
XslTransformer.getOutputForDocument(java.lang.String)

postTransform

protected void postTransform()
Generate a consolidated graph of the entire context using the same stylesheet reference provided on construction.

Overrides:
postTransform in class XslTransformer
See Also:
XslTransformer.postTransform()


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