net.sf.xsltmp
Class ManyToManyBase

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by net.sf.xsltmp.XsltGeneratorBase
          extended by net.sf.xsltmp.FromManyBase
              extended by net.sf.xsltmp.ManyToManyBase
All Implemented Interfaces:
XsltGeneratorConstants, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ManyToDynamicMojo, ManyToManyMojo

public abstract class ManyToManyBase
extends FromManyBase

A base class for mojos with multiple destination files.


Field Summary
 
Fields inherited from class net.sf.xsltmp.XsltGeneratorBase
archiverManager, resolver
 
Fields inherited from interface net.sf.xsltmp.XsltGeneratorConstants
BASE_DIR, DEFAULT_DEST_DIR, DEFAULT_EMPTY_FILE_CONTENTS, DEFAULT_EMPTY_FILENAME, EXTRACTS_DIR, FILTERED_DIR, PREPARED_TIMESTAMP_FILENAME, TIMESTAMP_FILENAME
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ManyToManyBase()
           
 
Method Summary
protected  void addDestDir()
          Add the destination directory to the project.
protected  void cleanAfterFileTransformation(File destFile)
          Perform any clean-up after a source file has been transformed into the given destination file.
protected  void ensureDestDirExists()
           
 void execute()
          The main MOJO execution method.
 String getAddDestDirTo()
           
 File getDestDir()
           
protected abstract  File getDestFile(String sourceFileName)
          Return the destination file for a given source file name.
 void setAddDestDirTo(String addDestDirTo)
           
 void setDestDir(File destDir)
           
protected abstract  boolean shouldSkip(File srcFile, File destFile)
          Return true iff the transformation from the given source file to the given destination file should be skipped.
 
Methods inherited from class net.sf.xsltmp.FromManyBase
ensureDestFileDirExists, getResolver, getSourceFile, getSourceFiles, getSrcDir, getSrcExcludes, getSrcIncludes, logExecution, setSrcDir, setSrcExcludes, setSrcIncludes, verifySrcDirExist
 
Methods inherited from class net.sf.xsltmp.XsltGeneratorBase
getArchiverManager, getFilter, getFilterParameters, getForce, getHelper, getLogPrefix, getMojoName, getParameters, getProject, getSourceEncoding, getTimestamp, getTransformer, getXslFile, getXslTemplate, hasChanged, setArchiverManager, setFilter, setFilterParameters, setForce, setParameters, setProject, setSourceEncoding, setXslTemplate, verifyXsltFileExist
 
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
 

Constructor Detail

ManyToManyBase

public ManyToManyBase()
Method Detail

getDestDir

public File getDestDir()

setDestDir

public void setDestDir(File destDir)

getAddDestDirTo

public String getAddDestDirTo()

setAddDestDirTo

public void setAddDestDirTo(String addDestDirTo)

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
The main MOJO execution method. Perform a generic XSL transformation algorithm. The mojo-specific parts are implemented in called abstract methods in the class descendants.

Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

getDestFile

protected abstract File getDestFile(String sourceFileName)
Return the destination file for a given source file name.

Parameters:
sourceFileName -
Returns:
File

shouldSkip

protected abstract boolean shouldSkip(File srcFile,
                                      File destFile)
Return true iff the transformation from the given source file to the given destination file should be skipped.

Parameters:
srcFile -
destFile -
Returns:
boolean

cleanAfterFileTransformation

protected void cleanAfterFileTransformation(File destFile)
Perform any clean-up after a source file has been transformed into the given destination file.

Parameters:
destFile -

ensureDestDirExists

protected void ensureDestDirExists()
                            throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

addDestDir

protected void addDestDir()
Add the destination directory to the project.



Copyright © 2008-2010 SEAF. All Rights Reserved.