Class TransformExtensionModelMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.nuiton.plugin.AbstractPlugin
org.nuiton.eugene.plugin.TransformExtensionModelMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin

@Mojo(name="transform-extension-model")
public class TransformExtensionModelMojo
extends org.nuiton.plugin.AbstractPlugin
To a transform some object model extension files from an input format to an output format. Available formats are
  • ini
  • properties

Example of ini format

 [model]
 modeTagValue=value
 modelStereotype=true

 [package fr.ird.observe.entities]
 packageTagValue=value
 packageStereotype=true

 [class fr.ird.observe.entities.CommentableEntity]
 classTagValue=value
 classStereotype=true
 attribute.attributeTagValue=value
 attribute.attributeStereotype=true
 

Example of properties format

 model.tagValue.modeTagValue=value
 model.stereotype.modelStereotype
 package.fr.ird.observe.entities.tagValue.packageTagValue=value
 package.fr.ird.observe.entities.stereotype=packageStereotype
 fr.ird.observe.entities.CommentableEntity.class.tagValue.classTagValue=value
 fr.ird.observe.entities.CommentableEntity.class.stereotype=classStereotype
 fr.ird.observe.entities.CommentableEntity.attribute.attribute.tagValue.attributeTagValue=value
 fr.ird.observe.entities.CommentableEntity.attribute.attribute.stereotype=attributeStereotype*
 
Created on 09/09/16.
Since:
3.0
Author:
Tony Chemit - chemit@codelutin.com
  • 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

    Fields 
    Modifier and Type Field Description
    protected File directory
    Where to find and generate files.
    protected boolean dryRun
    Display transformation result, but do not generate file.
    protected String encoding
    Encoding to be used for generation of files.
    protected String inputFormat
    The input format to read extension model.
    protected String modelName
    Name of model (the generated file name is modelName.properties).
    protected String outputFormat
    The output format to write extension model.
    protected org.apache.maven.project.MavenProject project
    Maven project.
    protected boolean verbose
    Verbose mode.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors 
    Constructor Description
    TransformExtensionModelMojo()  
  • Method Summary

    Modifier and Type Method Description
    protected void doAction()  
    org.apache.maven.project.MavenProject getProject()  
    protected void init()  
    boolean isVerbose()  
    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, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, needInvoke, needInvoke, 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

    getLog, setLog
  • Field Details

    • modelName

      @Parameter(property="modelName", required=true) protected String modelName
      Name of model (the generated file name is modelName.properties).
    • inputFormat

      @Parameter(property="inputFormat", required=true) protected String inputFormat
      The input format to read extension model.
    • outputFormat

      @Parameter(property="outputFormat", required=true) protected String outputFormat
      The output format to write extension model.
    • dryRun

      @Parameter(property="dryRun") protected boolean dryRun
      Display transformation result, but do not generate file.
    • verbose

      @Parameter(defaultValue="${maven.verbose}") protected boolean verbose
      Verbose mode.
    • directory

      @Parameter(property="eugene.directory", defaultValue="${project.basedir}/src/main/xmi", required=true) protected File directory
      Where to find and generate files.
    • project

      @Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project
      Maven project.
    • encoding

      @Parameter(property="eugene.encoding", defaultValue="${project.build.sourceEncoding}") protected String encoding
      Encoding to be used for generation of files. Note: If nothing is filled here, we will use the system property file.encoding.
  • Constructor Details

  • Method Details

    • init

      protected void init() throws Exception
      Specified by:
      init in class org.nuiton.plugin.AbstractPlugin
      Throws:
      Exception
    • doAction

      protected void doAction() throws Exception
      Specified by:
      doAction in class org.nuiton.plugin.AbstractPlugin
      Throws:
      Exception
    • getProject

      public org.apache.maven.project.MavenProject getProject()
    • setProject

      public void setProject​(org.apache.maven.project.MavenProject project)
    • isVerbose

      public boolean isVerbose()
    • setVerbose

      public void setVerbose​(boolean verbose)