org.jboss.maven.plugins.jdocbook.gen.format
Class BasicFormatHandler

java.lang.Object
  extended by org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler
All Implemented Interfaces:
FormatHandler
Direct Known Subclasses:
PdfFormatHandler

public class BasicFormatHandler
extends java.lang.Object
implements FormatHandler

Provides basic support for renderers, mainly in the form of templating.

Author:
Steve Ebersole

Field Summary
static java.lang.String DTD_LOADING_FEATURE
           
static java.lang.String DTD_VALIDATION_FEATURE
           
protected  FormatHandlerFactory factory
           
protected  Formatting formatting
           
 
Constructor Summary
BasicFormatHandler(FormatHandlerFactory factory, Formatting formatting)
           
 
Method Summary
 void attachOutput(java.io.File sourceFile, org.apache.maven.project.MavenProjectHelper projectHelper)
          Attaches the formatting output (after possibly bundling it into an archive) to the maven project.
protected  javax.xml.transform.Result buildResult(java.io.File targetFile)
           
protected  javax.xml.transform.Transformer buildTransformer(java.io.File targetFile)
           
protected  javax.xml.parsers.SAXParserFactory createParserFactory()
           
protected  org.apache.maven.plugin.logging.Log getLog()
           
 java.io.File prepareDirectory()
          This is used during the prepare-resources phase to create and prepare the format specific output directory for rendering.
protected  void releaseResult(javax.xml.transform.Result transformationResult)
           
 void render(java.io.File sourceFile)
          Performs the actual rendering or transforming of the DocBook sources into the respective output format.
protected  java.net.URL resolveTransformationStylesheet()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DTD_VALIDATION_FEATURE

public static final java.lang.String DTD_VALIDATION_FEATURE
See Also:
Constant Field Values

DTD_LOADING_FEATURE

public static final java.lang.String DTD_LOADING_FEATURE
See Also:
Constant Field Values

factory

protected final FormatHandlerFactory factory

formatting

protected final Formatting formatting
Constructor Detail

BasicFormatHandler

public BasicFormatHandler(FormatHandlerFactory factory,
                          Formatting formatting)
Method Detail

prepareDirectory

public java.io.File prepareDirectory()
                              throws RenderingException
Description copied from interface: FormatHandler
This is used during the prepare-resources phase to create and prepare the format specific output directory for rendering. Generally, preparation might mean copying any format-specific resources to the format output directory.

Specified by:
prepareDirectory in interface FormatHandler
Returns:
The format output directory
Throws:
RenderingException - Indicates problem preparing output directory

attachOutput

public void attachOutput(java.io.File sourceFile,
                         org.apache.maven.project.MavenProjectHelper projectHelper)
                  throws RenderingException
Description copied from interface: FormatHandler
Attaches the formatting output (after possibly bundling it into an archive) to the maven project.

Specified by:
attachOutput in interface FormatHandler
Parameters:
sourceFile - The source DocBook file.
projectHelper - The project helper (used to attach produced artifact)
Throws:
RenderingException - Indicates problem performing attaching

render

public final void render(java.io.File sourceFile)
                  throws RenderingException,
                         XSLTException
Description copied from interface: FormatHandler
Performs the actual rendering or transforming of the DocBook sources into the respective output format.

Specified by:
render in interface FormatHandler
Parameters:
sourceFile - The source DocBook file.
Throws:
RenderingException - Problem writing the output file(s).
XSLTException - Problem performing XSL transformation.

buildTransformer

protected javax.xml.transform.Transformer buildTransformer(java.io.File targetFile)
                                                    throws RenderingException,
                                                           XSLTException
Throws:
RenderingException
XSLTException

resolveTransformationStylesheet

protected final java.net.URL resolveTransformationStylesheet()
                                                      throws RenderingException
Throws:
RenderingException

createParserFactory

protected final javax.xml.parsers.SAXParserFactory createParserFactory()

buildResult

protected javax.xml.transform.Result buildResult(java.io.File targetFile)
                                          throws RenderingException,
                                                 XSLTException
Throws:
RenderingException
XSLTException

releaseResult

protected void releaseResult(javax.xml.transform.Result transformationResult)

getLog

protected org.apache.maven.plugin.logging.Log getLog()


Copyright © 2007 JBoss, a division of Red Hat, Inc. All Rights Reserved.