org.apache.torque.mojo
Class TexenTaskMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.torque.mojo.BaseMojo
          extended by org.apache.torque.mojo.AntTaskMojo
              extended by org.apache.torque.mojo.TexenTaskMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
DataModelTaskMojo

public abstract class TexenTaskMojo
extends AntTaskMojo

The base class for mojos that wrap Texen Ant Tasks


Field Summary
 
Fields inherited from class org.apache.torque.mojo.BaseMojo
FS, SKIP_PACKAGING_TYPE
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
TexenTaskMojo()
           
 
Method Summary
protected  void configureTask()
          Configures the Texen task wrapped by this mojo.
 void executeMojo()
          Executes the wrapped Texen task.
protected  void generateContextProperties()
          Generates the context properties file for Texen.
 String getContextPropertiesPath()
          Returns the path to the generated property file used as Texen's context properties.
protected  org.apache.texen.ant.TexenTask getGeneratorTask()
          returns the generator Task for this mojo.
protected abstract  org.apache.commons.configuration.PropertiesConfiguration getMojoContextProperties()
          Returns the context properties for the Texen task which are defined in the configuration of the child mojo.
 String getOutputDir()
          Returns the path to Torque's output directory.
 String getTemplatePath()
          Returns the path to Torque's templates, if the classpath is not used to load the templates.
 boolean getUseClasspath()
          Returns whether the classpath is used to locate the templates.
 Map<?,?> getUserContextProperties()
          Returns the map which defines user-defined context properties.
 void setContextPropertiesPath(String contextPropertiesPath)
          Sets the path to the generated property file used as Texen's context properties.
 void setOutputDir(String outputDir)
          Sets the path to Torque's output directory.
 void setTemplatePath(String templatePath)
          Sets the path to Torque's templates, if the classpath is not used to load the templates.
 void setUseClasspath(boolean useClasspath)
          Sets whether the classpath should be used to locate the templates.
 void setUserContextProperties(Map<?,?> userContextProperties)
          Sets the map which defines user-defined context properties.
 
Methods inherited from class org.apache.torque.mojo.AntTaskMojo
getAntProject, getAntTask, getIniatializedAntProject, setAntProject, setAntTask
 
Methods inherited from class org.apache.torque.mojo.BaseMojo
afterExecution, beforeExecution, execute, getEncoding, getMavenSession, getProject, getSettings, isForceMojoExecution, isSkip, isStartMavenLogger, setEncoding, setForceMojoExecution, setMavenSession, setProject, setSettings, setSkip, setStartMavenLogger, skipMojo
 
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

TexenTaskMojo

public TexenTaskMojo()
Method Detail

setOutputDir

public void setOutputDir(String outputDir)
Sets the path to Torque's output directory.

Parameters:
outputDir - the path to Torque's output directory.

getOutputDir

public String getOutputDir()
Returns the path to Torque's output directory.

Returns:
the path to Torque's output directory. Not null if initialized correctly.

setTemplatePath

public void setTemplatePath(String templatePath)
Sets the path to Torque's templates, if the classpath is not used to load the templates.

Parameters:
templatePath - the path to Torque's templates.

getTemplatePath

public String getTemplatePath()
Returns the path to Torque's templates, if the classpath is not used to load the templates.

Returns:
the path to Torque's templates.

setUseClasspath

public void setUseClasspath(boolean useClasspath)
Sets whether the classpath should be used to locate the templates.

Parameters:
templatePath - the path to Torque's templates.

getUseClasspath

public boolean getUseClasspath()
Returns whether the classpath is used to locate the templates.

Returns:
true if the classpath is used to locate the templates, false otherwise

setContextPropertiesPath

public void setContextPropertiesPath(String contextPropertiesPath)
Sets the path to the generated property file used as Texen's context properties.

Parameters:
generatedPropertyFilePath - the path to the generated context properties file.

getContextPropertiesPath

public String getContextPropertiesPath()
Returns the path to the generated property file used as Texen's context properties.

Returns:
the path to the generated context properties file.

setUserContextProperties

public void setUserContextProperties(Map<?,?> userContextProperties)
Sets the map which defines user-defined context properties. The settings override all other mojo configuration settings which are mapped to context properties.

Parameters:
contextProperties - the user-defined context properties.

getUserContextProperties

public Map<?,?> getUserContextProperties()
Returns the map which defines user-defined context properties.

Returns:
the map containing user-defined context properties, or null if not set.

getGeneratorTask

protected org.apache.texen.ant.TexenTask getGeneratorTask()
returns the generator Task for this mojo.

Returns:
the generator Task, not null.

generateContextProperties

protected void generateContextProperties()
                                  throws org.apache.maven.plugin.MojoExecutionException
Generates the context properties file for Texen. The file is written to the path contextPropertiesPath.

Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurs.

configureTask

protected void configureTask()
                      throws org.apache.maven.plugin.MojoExecutionException
Configures the Texen task wrapped by this mojo.

Overrides:
configureTask in class AntTaskMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

executeMojo

public void executeMojo()
                 throws org.apache.maven.plugin.MojoExecutionException
Executes the wrapped Texen task. Before this is done, the context properties file is generated and the Texen task is configured.

Overrides:
executeMojo in class AntTaskMojo
Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurs during execution.
See Also:
Mojo.execute()

getMojoContextProperties

protected abstract org.apache.commons.configuration.PropertiesConfiguration getMojoContextProperties()
Returns the context properties for the Texen task which are defined in the configuration of the child mojo. This method needs to be overwritten in subclasses.

Returns:
The PropertiesConfiguration containing all context properties, not null.


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.