net.sf.xsltmp
Class ManyToOneMojo

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.ManyToOneMojo
All Implemented Interfaces:
XsltGeneratorConstants, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class ManyToOneMojo
extends FromManyBase

Perform XSL transformation of multiple source files into a single destination file.

The names of the multiple source files are passed into the template as a comma-separated list in a parameter named 'source-file-names'. In the template, define a global template parameter as follows: <xsl:param name="source-file-names" />. Then the content of the files can be loaded as follows: <xsl:variable name="source-files" select="document(tokenize($source-file-names,','))" />.

From the XSL engine point of view, it is then in fact a single, 1:1 transformation: a single source file is transformed into a single destination file.

The content of the single source file can then be enriched in the template by the multiple source 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, PREPARED_TIMESTAMP_FILENAME, TIMESTAMP_FILENAME
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ManyToOneMojo()
           
 
Method Summary
 void execute()
           
 java.io.File getDestFile()
           
protected  java.lang.String getMojoName()
          Return the name of the mojo.
 java.io.File getSrcFile()
           
 void setDestFile(java.io.File destFile)
           
 void setSrcFile(java.io.File srcFile)
           
 
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, getForce, getHelper, getLogPrefix, getParameters, getProject, getTimestamp, getTransformer, getXslFile, getXslTemplate, isUpToDate, setArchiverManager, setForce, setParameters, setProject, 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

ManyToOneMojo

public ManyToOneMojo()
Method Detail

getSrcFile

public java.io.File getSrcFile()

setSrcFile

public void setSrcFile(java.io.File srcFile)

getDestFile

public java.io.File getDestFile()

setDestFile

public void setDestFile(java.io.File destFile)

getMojoName

protected java.lang.String getMojoName()
Description copied from class: XsltGeneratorBase
Return the name of the mojo. For logging purposes.

Specified by:
getMojoName in class XsltGeneratorBase
Returns:
String

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException


Copyright © 2008-2010 SEAF. All Rights Reserved.