|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.eugene.plugin.SmartGenerateMojo
public class SmartGenerateMojo
Smart file generator.
Fill inputs and mojo will chained needed writer. User: chemit Date: 24 nov. 2009 Time: 00:22:37
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin |
|---|
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging |
| Field Summary | |
|---|---|
protected Map<String,Model> |
_models
All available models (obtain by plexus, keys are plexus roles, values are a instance of corresponding model). |
protected String |
defaultPackage
Nom par défaut du paquetage généré (model input specific). |
protected boolean |
dryRun
Ne génère rien, analyse juste la configuration. |
protected String |
encoding
Encoding to be used for generation of files. |
protected ChainedWriterEngine |
engine
The engine to compute ChainedFileWriter from inputs entries. |
protected String[] |
excludeTemplates
Templates à ne pas utiliser lors de la transformations des models (model input sepcific). |
protected File |
extractDirectory
Where to copy extracted files (when using class-path data). |
protected String |
extractedPackages
List of package to extract from xmi to models. |
protected ClassLoader |
fixedClassLoader
fixed classloader |
protected String |
fullPackagePath
Nom du paquetage pour les fichiers générés (xmi input sepcific). |
protected String |
generatedPackages
List of packages to generate (comma separated). |
protected String[] |
inputs
Inputs files to used to generate the required model files. |
protected Map<String,ModelReader<?>> |
modelReaders
All available writers introspects via plexus |
protected Map<String,Template<?>> |
modelTemplates
All available templates introspects via plexus |
protected String |
modelType
The type of model to be used. |
protected File |
outputDirectory
Where to generate files. |
protected boolean |
overwrite
Ecrase les fichiers générés. |
protected org.apache.maven.project.MavenProject |
project
Maven project. |
protected Map<String,Object> |
properties
Properties to pass to writer. |
protected String |
resolver
Nom du resolver a utiliser pour les transformations xmi vers model (xmi input sepcific). |
protected org.apache.maven.settings.Settings |
settings
Le settings (pour obtenir le mode offline). |
protected String |
skipInputs
List of input (protocol) not to treate separated by comma. |
protected String |
templates
Templates à utiliser, séparés par des virgules pour les transformations depuis les models (model input sepcific). |
protected boolean |
testPhase
A flag to mark the mojo to be used in a test phase. |
protected boolean |
verbose
Pour activer le mode verbeux. |
protected Map<String,ChainedFileWriter> |
writers
All available writers introspects via plexus |
| Fields inherited from interface org.apache.maven.plugin.Mojo |
|---|
ROLE |
| Constructor Summary | |
|---|---|
SmartGenerateMojo()
|
|
| Method Summary | |
|---|---|
protected boolean |
checkSkip()
|
protected void |
doAction()
|
protected void |
fixCompileSourceRoots(File destDirGen)
permet d'ajout le répertoire de génération des fichiers java dans les répertoires de compilation du projet Maven. |
File |
getBasedir()
|
ClassLoader |
getClassLoader()
|
String |
getEncoding()
|
protected String |
getExcludeTemplatesAsString()
|
File |
getExtractDirectory()
|
ClassLoader |
getFixedClassLoader()
Prepare le classLoader a utiliser dans le generateur. |
Map<String,ModelReader<?>> |
getModelReaders()
|
Map<String,Template<?>> |
getModelTemplates()
|
String |
getModelType()
|
File |
getOutputDirectory()
|
org.apache.maven.project.MavenProject |
getProject()
|
Map<String,Object> |
getProperties()
|
Map<String,ChainedFileWriter> |
getWriters()
|
protected void |
init()
|
boolean |
isOffline()
|
boolean |
isOverwrite()
|
boolean |
isTestPhase()
|
boolean |
isVerbose()
|
String |
reportGeneratedFiles(ChainedFileWriter writer,
long t0)
|
void |
setEncoding(String encoding)
|
void |
setInputs(String inputs)
Add a single input to the inputs property. |
void |
setProject(org.apache.maven.project.MavenProject project)
|
void |
setVerbose(boolean verbose)
|
| Methods inherited from class org.nuiton.plugin.AbstractPlugin |
|---|
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, checkPackaging, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, renameFile, writeFile |
| 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 |
| Methods inherited from interface org.apache.maven.plugin.Mojo |
|---|
execute, getLog, setLog |
| Field Detail |
|---|
protected String[] inputs
writer:when you want to use a specific writer with his default io values. Can also write :
[writer:]directory:includeswhere
includes is the pattern to find files from the directory
given and must be terminated by the extension of files.
Specifying the writer can be usefull when you want to use a
writer for an unknown extension by any writer.
Example :
<inputs>
<input>zargo:</input>
<input>src/main/xmi2:**\/*.zargo</input>
<input>zargo:src/main/xmi:**\/*.zargo2</input>
</inputs>
Note: If your using a single input, you can just write :
<inputs>zargo</inputs>
protected String skipInputs
<skipInputs>xmi</skipInputs> <skipInputs>xmi,model</skipInputs>
protected File outputDirectory
protected File extractDirectory
protected boolean overwrite
protected boolean verbose
protected String encoding
file.encoding.
protected boolean testPhase
protected String modelType
objectmodel.
protected Map<String,Object> properties
protected boolean dryRun
protected String fullPackagePath
protected String resolver
protected String templates
protected String[] excludeTemplates
protected String defaultPackage
protected String generatedPackages
protected String extractedPackages
protected org.apache.maven.project.MavenProject project
protected org.apache.maven.settings.Settings settings
protected Map<String,Model> _models
protected Map<String,ChainedFileWriter> writers
protected Map<String,ModelReader<?>> modelReaders
protected Map<String,Template<?>> modelTemplates
protected ChainedWriterEngine engine
ChainedFileWriter from inputs entries.
protected ClassLoader fixedClassLoader
| Constructor Detail |
|---|
public SmartGenerateMojo()
| Method Detail |
|---|
protected void init()
throws Exception
init in class org.nuiton.plugin.AbstractPluginExceptionprotected boolean checkSkip()
checkSkip in class org.nuiton.plugin.AbstractPlugin
protected void doAction()
throws Exception
doAction in class org.nuiton.plugin.AbstractPluginException
public String reportGeneratedFiles(ChainedFileWriter writer,
long t0)
public void setInputs(String inputs)
inputs property.
Note: This is a convinient way to allow in pom to write
<inputs>zargo</inputs>in stead of array notation :
<inputs>
<input>zargo:</input>
</inputs>
inputs - unique input to addpublic File getOutputDirectory()
getOutputDirectory in interface ChainedFileWriterConfigurationpublic File getExtractDirectory()
getExtractDirectory in interface ChainedFileWriterConfigurationpublic Map<String,Object> getProperties()
getProperties in interface ChainedFileWriterConfigurationpublic ClassLoader getClassLoader()
getClassLoader in interface ChainedFileWriterConfigurationpublic org.apache.maven.project.MavenProject getProject()
getProject in interface org.nuiton.plugin.Pluginpublic void setProject(org.apache.maven.project.MavenProject project)
setProject in interface org.nuiton.plugin.Pluginpublic boolean isVerbose()
isVerbose in interface ChainedFileWriterConfigurationisVerbose in interface org.nuiton.plugin.Pluginpublic void setVerbose(boolean verbose)
setVerbose in interface org.nuiton.plugin.Pluginpublic String getEncoding()
getEncoding in interface ChainedFileWriterConfigurationgetEncoding in interface org.nuiton.plugin.PluginWithEncodingpublic void setEncoding(String encoding)
setEncoding in interface org.nuiton.plugin.PluginWithEncodingpublic boolean isOverwrite()
isOverwrite in interface ChainedFileWriterConfigurationpublic boolean isOffline()
isOffline in interface ChainedFileWriterConfigurationpublic boolean isTestPhase()
isTestPhase in interface ChainedFileWriterConfigurationpublic String getModelType()
getModelType in interface ChainedFileWriterConfigurationpublic Map<String,ChainedFileWriter> getWriters()
getWriters in interface ChainedFileWriterConfigurationpublic Map<String,ModelReader<?>> getModelReaders()
getModelReaders in interface ChainedFileWriterConfigurationpublic Map<String,Template<?>> getModelTemplates()
getModelTemplates in interface ChainedFileWriterConfigurationpublic File getBasedir()
getBasedir in interface ChainedFileWriterConfigurationprotected String getExcludeTemplatesAsString()
public ClassLoader getFixedClassLoader()
throws org.apache.maven.plugin.MojoExecutionException
testPhase a été renseigné,
target/classes est rajouté.
Si des références à des sibling modules, ils seront rajoutés aussi.
org.apache.maven.plugin.MojoExecutionException - if any pbprotected void fixCompileSourceRoots(File destDirGen)
destDirGen - le repertoire a traiter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||