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 pipe-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
static String SOURCE_FILE_NAMES_SEPARATOR
           
 
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
ManyToOneMojo()
           
 
Method Summary
 void execute()
           
 File getDestFile()
           
protected  String getMojoName()
          Return the name of the mojo.
 File getResolvedSrcFile()
           
 boolean getShouldRun()
           
 File getSrcFile()
           
 void prepare()
           
 void setDestFile(File destFile)
           
 void setSrcFile(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, getFilter, getFilterParameters, getForce, getHelper, getLogPrefix, 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
 

Field Detail

SOURCE_FILE_NAMES_SEPARATOR

public static final String SOURCE_FILE_NAMES_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

ManyToOneMojo

public ManyToOneMojo()
Method Detail

getSrcFile

public File getSrcFile()

setSrcFile

public void setSrcFile(File srcFile)

getDestFile

public File getDestFile()

setDestFile

public void setDestFile(File destFile)

getShouldRun

public boolean getShouldRun()

getResolvedSrcFile

public File getResolvedSrcFile()

getMojoName

protected 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

prepare

public void prepare()
             throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException


Copyright © 2008-2010 SEAF. All Rights Reserved.