Class AbstractWizardMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.tentackle.maven.AbstractTentackleMojo
org.tentackle.maven.plugin.wizard.AbstractWizardMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
BrowseMojo, InitMojo, OperationMojo, PdoMojo

public abstract class AbstractWizardMojo extends org.tentackle.maven.AbstractTentackleMojo
Base wizard mojo.
Author:
harald
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The entity aliases.
    protected List<org.apache.maven.shared.model.fileset.FileSet>
    The list of file sets containing the model.
    If set, the modelDir is ignored.
    protected String
    The model defaults.
    protected File
    Directory holding the model files to be processed.
    Ignored if fileset explicitly given.

    Fields inherited from class org.tentackle.maven.AbstractTentackleMojo

    charset, JDK_TOOLCHAIN, minLogLevel, verbosity, verbosityLevel

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

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
     
    protected EntityAliases
    Gets the entity aliases.
    protected ModelDefaults
    Gets the model defaults.
    <T extends Profile>
    List<T>
    getProfiles(Class<T> clazz)
    Gets the profiles.
    protected abstract javafx.stage.Stage
    Gets the stage, if this an interactive FX application.
    Gets the status directory.
    Gets the template directory.
    protected void
    Copies the templates to the template directory.
    Overwrites any existing templates.
    protected void
    Loads the model.
    protected int
    processFileSet(org.apache.maven.shared.model.fileset.FileSet fileSet)
    Processes a fileset to load the model.
    protected void
    Registers a handler for uncaught exceptions.
    protected boolean
     

    Methods inherited from class org.tentackle.maven.AbstractTentackleMojo

    createFileSetManager, createPackageMap, determineEncoding, determineJavaToolVersion, determineVerbosity, execute, finishExecute, getCanonicalPath, getHostName, getIncludedFiles, getJavaHome, getMajorVersion, getMavenProject, getMavenSession, getMojoExecution, getPathRelativeToBasedir, getResourceDir, getResourceDirs, getSettings, getSettingsDecrypter, getToolchain, getToolchain, getToolchain, getToolchainManager, getToolFinder, installJavaLoggingHandler, isExecutionRecursive, isSkippedByDefault, loadResourceFileIntoString, prepareExecute, toDescriptorName

    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 Details

    • modelDir

      @Parameter(defaultValue="${project.build.directory}/wurbel/model", property="tentackle.modelDir") protected File modelDir
      Directory holding the model files to be processed.
      Ignored if fileset explicitly given.
    • modelDefaults

      @Parameter(property="tentackle.modelDefaults") protected String modelDefaults
      The model defaults.
    • entityAliases

      @Parameter(property="tentackle.entityAliases") protected String entityAliases
      The entity aliases.
    • filesets

      @Parameter protected List<org.apache.maven.shared.model.fileset.FileSet> filesets
      The list of file sets containing the model.
      If set, the modelDir is ignored.
  • Constructor Details

    • AbstractWizardMojo

      public AbstractWizardMojo()
  • Method Details

    • getProfiles

      public <T extends Profile> List<T> getProfiles(Class<T> clazz) throws org.apache.maven.plugin.MojoExecutionException
      Gets the profiles.
      Type Parameters:
      T - the profile type
      Parameters:
      clazz - the concrete profile class
      Returns:
      the list of profiles
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if profile names are not unique
    • getTemplateDir

      public File getTemplateDir()
      Gets the template directory.
      Returns:
      the directory holding the wizard templates
    • getStatusDir

      public File getStatusDir()
      Gets the status directory.
      Returns:
      the status dir
    • executeImpl

      public void executeImpl() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Specified by:
      executeImpl in class org.tentackle.maven.AbstractTentackleMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • getModelDefaults

      protected ModelDefaults getModelDefaults() throws org.apache.maven.plugin.MojoExecutionException
      Gets the model defaults.
      Returns:
      the defaults, null if none
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if parsing the model defaults failed
    • getEntityAliases

      protected EntityAliases getEntityAliases() throws org.apache.maven.plugin.MojoExecutionException
      Gets the entity aliases.
      Returns:
      the aliases, null if none
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if parsing the aliases failed
    • loadModel

      protected void loadModel() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Loads the model.

      Notice: the model is only needed by the PdoMojo, but we configure it for the whole plugin.

      Throws:
      org.apache.maven.plugin.MojoFailureException - if the model is inconsistent
      org.apache.maven.plugin.MojoExecutionException - if loading failed due to some other error
    • processFileSet

      protected int processFileSet(org.apache.maven.shared.model.fileset.FileSet fileSet) throws org.apache.maven.plugin.MojoExecutionException
      Processes a fileset to load the model.
      Parameters:
      fileSet - the fileset containing the model
      Returns:
      the number of errors
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if model defaults or entity aliases could not be determined
    • validate

      protected boolean validate() throws org.apache.maven.plugin.MojoExecutionException
      Overrides:
      validate in class org.tentackle.maven.AbstractTentackleMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • installTemplates

      protected void installTemplates() throws org.apache.maven.plugin.MojoExecutionException
      Copies the templates to the template directory.
      Overwrites any existing templates.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if failed
    • registerUncaughtExceptionHandler

      protected void registerUncaughtExceptionHandler()
      Registers a handler for uncaught exceptions.
    • configureFx

      protected void configureFx()
    • getStage

      protected abstract javafx.stage.Stage getStage()
      Gets the stage, if this an interactive FX application.
      Returns:
      the stage, null if console application