org.nuiton.jaxx.plugin
Class GenerateMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.jaxx.plugin.AbstractJaxxMojo
              extended by org.nuiton.jaxx.plugin.GenerateMojo
All Implemented Interfaces:
CompilerConfiguration, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.nuiton.plugin.Plugin

public class GenerateMojo
extends AbstractJaxxMojo
implements CompilerConfiguration

Generates some java code from jaxx files.

Author:
chemit
Is defined by the goal name:
generate
Is bound to the specified phase of the standard build lifecycle:
process-sources
Requires the dependencies in this specified scope:
compile
Requires a Maven project to run:
true

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  boolean addCompileClassPath
          flag to include in compiler classpath the compile class-path (can only be used in a test phase).
protected  boolean addLogger
          flag to add logger to each generated jaxx file.
protected  boolean addProjectClassPath
          flag to include in compiler classpath the project compile classpath.
protected  boolean addResourcesToClassPath
          flag to include in compiler classpath the java resources directories (src and outJava).
protected  boolean addSourcesToClassPath
          flag to include in compiler classpath the java sources directories (src and outJava).
protected  java.lang.String[] beanInfoSearchPath
          extra path to be added in java.beans.Introspector#setBeanInfoSearchPath(java.lang.String[]).
protected  java.lang.ClassLoader cl
           
protected  java.lang.String compilerFQN
          Le compilateur à utiliser (par défaut celui de Swing)
protected  java.lang.String defaultDecoratorFQN
          the FQN of the ui to use for error notification.
protected  java.lang.String defaultErrorUIFQN
          the FQN of the ui to use for error notification.
protected  java.lang.String[] excludes
          pour filter les fichiers a ne pas traiter
protected  java.lang.String extraImportList
          list of fqn of class toimport for all generated jaxx files
protected  java.lang.String[] files
          detected jaxx files in init() method
protected  java.lang.String helpBrokerFQN
          the FQN of help broker

By default, use the JAXX implementation JAXXHelpBroker.

protected  boolean i18nable
          to make compiler i18nable, says add the I18n._(String, Object...) method invocation on I18nHelper.I18N_ATTRIBUTES attributes.
protected  java.lang.String[] includes
          pour filter les fichiers a traiter
protected  java.lang.String jaxxContextFQN
          the name of implementation of JAXXContext to be used on JAXXObject.
protected  boolean optimize
          pour optimizer le code compile ou genere ?
protected  java.io.File outJava
          Repertoire de destination des fichiers java a generer.
protected  boolean profile
          flag to activate profile mode.
protected  boolean resetAfterCompile
          flag to keep compilers after the generate operation (usefull for tests.
protected  boolean showBinding
          To show detected bindings.
protected  java.io.File src
          Repertoire sources des fichiers jaxx a generer.
protected  boolean testPhase
          A flag to mark themojo to be used in a test phase.
protected  org.nuiton.io.MirroredFileUpdater updater
          file updater used to detect jaxx files.
protected  boolean useUIManagerForIcon
          a flag to use UIManager to retreave icons.
protected  java.lang.String validatorFQN
          Le compilateur à utiliser (par défaut celui de Swing)
 
Fields inherited from class org.nuiton.jaxx.plugin.AbstractJaxxMojo
generateHelp
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
GenerateMojo()
           
 
Method Summary
protected  boolean checkSkip()
           
 void doAction()
           
protected  void fixCompileSourceRoots()
           
 java.lang.ClassLoader getClassLoader()
           
 java.lang.Class<? extends JAXXCompiler> getCompilerClass()
           
 java.lang.Class<? extends CompiledObjectDecorator> getDefaultDecoratorClass()
           
 java.lang.Class<?> getDefaultErrorUI()
           
 JAXXEngine getEngine()
           
 java.lang.String[] getExtraImports()
           
 java.lang.String getHelpBrokerFQN()
           
 java.lang.Class<? extends JAXXContext> getJaxxContextClass()
           
 boolean getOptimize()
           
 java.io.File getTargetDirectory()
           
 java.lang.Class<?> getValidatorClass()
           
 void init()
           
 boolean isAddLogger()
           
 boolean isGenerateHelp()
           
 boolean isI18nable()
           
 boolean isOptimize()
           
 boolean isProfile()
           
 boolean isResetAfterCompile()
           
 boolean isUseUIManagerForIcon()
           
protected  void report(JAXXEngine engine)
           
 void setTargetDirectory(java.io.File targetDirectory)
           
 java.lang.String toString()
           
 
Methods inherited from class org.nuiton.jaxx.plugin.AbstractJaxxMojo
checkPackaging, getEncoding, getLastModified, getProject, isForce, isVerbose, setEncoding, setForce, setProject, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkResource, checkRunOnceDone, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getBackupFile, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getTemplate, 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, wait, wait, wait
 
Methods inherited from interface jaxx.compiler.CompilerConfiguration
getEncoding, isVerbose
 
Methods inherited from interface org.apache.maven.plugin.Mojo
getLog, setLog
 

Field Detail

src

protected java.io.File src
Repertoire sources des fichiers jaxx a generer.

Is defined by:
expression:
${jaxx.src}
default-value:
${basedir}/src/main/java

outJava

protected java.io.File outJava
Repertoire de destination des fichiers java a generer.

Is defined by:
expression:
${jaxx.outJava}
default-value:
${basedir}/target/generated-sources/java

includes

protected java.lang.String[] includes
pour filter les fichiers a traiter

Is defined by:
expression:
${jaxx.includes}

excludes

protected java.lang.String[] excludes
pour filter les fichiers a ne pas traiter

Is defined by:
expression:
${jaxx.excludes}

compilerFQN

protected java.lang.String compilerFQN
Le compilateur à utiliser (par défaut celui de Swing)

Is defined by:
expression:
${jaxx.compilerFQN}
default-value:
jaxx.compiler.JAXXCompiler

validatorFQN

protected java.lang.String validatorFQN
Le compilateur à utiliser (par défaut celui de Swing)

Is defined by:
expression:
${jaxx.validatorFQN}
default-value:
jaxx.runtime.validator.swing.SwingValidator

jaxxContextFQN

protected java.lang.String jaxxContextFQN
the name of implementation of JAXXContext to be used on JAXXObject.

Must not be abstract.

Is defined by:
expression:
${jaxx.jaxxContextFQN}
default-value:
jaxx.runtime.context.DefaultJAXXContext
Is required.

defaultErrorUIFQN

protected java.lang.String defaultErrorUIFQN
the FQN of the ui to use for error notification.

If not given, will use the one defined in validator

Is defined by:
expression:
${jaxx.defaultErrorUIFQN}

defaultDecoratorFQN

protected java.lang.String defaultDecoratorFQN
the FQN of the ui to use for error notification.

If not given, will use the one defined in validator

See Also:
CompiledObjectDecorator
Is defined by:
expression:
${jaxx.defaultDecoratorFQN}
default-value:
jaxx.compiler.decorators.DefaultCompiledObjectDecorator

addSourcesToClassPath

protected boolean addSourcesToClassPath
flag to include in compiler classpath the java sources directories (src and outJava).

By default, false.

Is defined by:
expression:
${jaxx.addSourcesToClassPath}
default-value:
false

addResourcesToClassPath

protected boolean addResourcesToClassPath
flag to include in compiler classpath the java resources directories (src and outJava).

By default, false.

Since:
1.6.0
Is defined by:
expression:
${jaxx.addResourcesToClassPath}
default-value:
false

addCompileClassPath

protected boolean addCompileClassPath
flag to include in compiler classpath the compile class-path (can only be used in a test phase).

By default, false.

Since:
1.6.0
Is defined by:
expression:
${jaxx.addCompileClassPath}
default-value:
false

addProjectClassPath

protected boolean addProjectClassPath
flag to include in compiler classpath the project compile classpath.

By default, false.

Is defined by:
expression:
${jaxx.addProjectClassPath}
default-value:
false

testPhase

protected boolean testPhase
A flag to mark themojo to be used in a test phase. This will permits to add generated sources in test compile roots.

Since:
1.6.0
Is defined by:
expression:
${jaxx.testPhase}
default-value:
false

i18nable

protected boolean i18nable
to make compiler i18nable, says add the I18n._(String, Object...) method invocation on I18nHelper.I18N_ATTRIBUTES attributes.

See Also:
I18nHelper
Is defined by:
expression:
${jaxx.i18nable}
default-value:
true

optimize

protected boolean optimize
pour optimizer le code compile ou genere ?

Is defined by:
expression:
${jaxx.optimize}
default-value:
false

addLogger

protected boolean addLogger
flag to add logger to each generated jaxx file.

By default, always add it.

Is defined by:
expression:
${jaxx.addLogger}
default-value:
true

resetAfterCompile

protected boolean resetAfterCompile
flag to keep compilers after the generate operation (usefull for tests.

By default, always reset.

Is defined by:
expression:
${jaxx.resetAfterCompile}
default-value:
true

beanInfoSearchPath

protected java.lang.String[] beanInfoSearchPath
extra path to be added in java.beans.Introspector#setBeanInfoSearchPath(java.lang.String[]).

add beanInfoSearchPath to be registred by BeanInfoUtil.addJaxxBeanInfoPath(java.lang.String...)

and then will be use by DefaultInitializer.

This permit to use real beanInfo of imported graphic libraries.

Is defined by:
expression:
${jaxx.beanInfoSearchPath}

extraImportList

protected java.lang.String extraImportList
list of fqn of class toimport for all generated jaxx files

Is defined by:
expression:
${jaxx.extraImportList}

useUIManagerForIcon

protected boolean useUIManagerForIcon
a flag to use UIManager to retreave icons.

Is defined by:
expression:
${jaxx.useUIManagerForIcon}
default-value:
false

profile

protected boolean profile
flag to activate profile mode.

By default, not active.

Is defined by:
expression:
${jaxx.profile}
default-value:
false

showBinding

protected boolean showBinding
To show detected bindings.

By default, do not show them.

Since:
2.0.0
Is defined by:
expression:
${jaxx.showBinding}
default-value:
false

helpBrokerFQN

protected java.lang.String helpBrokerFQN
the FQN of help broker

By default, use the JAXX implementation JAXXHelpBroker.

Since:
1.3
Is defined by:
expression:
${jaxx.helpBrokerFQN}
default-value:
jaxx.runtime.swing.help.JAXXHelpBroker

files

protected java.lang.String[] files
detected jaxx files in init() method


updater

protected org.nuiton.io.MirroredFileUpdater updater
file updater used to detect jaxx files.

Note: if AbstractJaxxMojo.verbose flag is on, will ne be used


cl

protected java.lang.ClassLoader cl
Constructor Detail

GenerateMojo

public GenerateMojo()
Method Detail

init

public void init()
          throws java.lang.Exception
Specified by:
init in class org.nuiton.plugin.AbstractPlugin
Throws:
java.lang.Exception

checkSkip

protected boolean checkSkip()
Overrides:
checkSkip in class org.nuiton.plugin.AbstractPlugin

doAction

public void doAction()
              throws java.lang.Exception
Specified by:
doAction in class org.nuiton.plugin.AbstractPlugin
Throws:
java.lang.Exception

getTargetDirectory

public java.io.File getTargetDirectory()
Specified by:
getTargetDirectory in interface CompilerConfiguration
Specified by:
getTargetDirectory in class AbstractJaxxMojo

setTargetDirectory

public void setTargetDirectory(java.io.File targetDirectory)
Specified by:
setTargetDirectory in class AbstractJaxxMojo

getOptimize

public boolean getOptimize()
Specified by:
getOptimize in interface CompilerConfiguration

isI18nable

public boolean isI18nable()
Specified by:
isI18nable in interface CompilerConfiguration

isUseUIManagerForIcon

public boolean isUseUIManagerForIcon()
Specified by:
isUseUIManagerForIcon in interface CompilerConfiguration

isAddLogger

public boolean isAddLogger()
Specified by:
isAddLogger in interface CompilerConfiguration

getJaxxContextClass

public java.lang.Class<? extends JAXXContext> getJaxxContextClass()
Specified by:
getJaxxContextClass in interface CompilerConfiguration

getExtraImports

public java.lang.String[] getExtraImports()
Specified by:
getExtraImports in interface CompilerConfiguration

isResetAfterCompile

public boolean isResetAfterCompile()
Specified by:
isResetAfterCompile in interface CompilerConfiguration

isOptimize

public boolean isOptimize()
Specified by:
isOptimize in interface CompilerConfiguration

getDefaultErrorUI

public java.lang.Class<?> getDefaultErrorUI()
Specified by:
getDefaultErrorUI in interface CompilerConfiguration

getClassLoader

public java.lang.ClassLoader getClassLoader()
Specified by:
getClassLoader in interface CompilerConfiguration

getCompilerClass

public java.lang.Class<? extends JAXXCompiler> getCompilerClass()
Specified by:
getCompilerClass in interface CompilerConfiguration

getDefaultDecoratorClass

public java.lang.Class<? extends CompiledObjectDecorator> getDefaultDecoratorClass()
Specified by:
getDefaultDecoratorClass in interface CompilerConfiguration

isProfile

public boolean isProfile()
Specified by:
isProfile in interface CompilerConfiguration

isGenerateHelp

public boolean isGenerateHelp()
Specified by:
isGenerateHelp in interface CompilerConfiguration

getHelpBrokerFQN

public java.lang.String getHelpBrokerFQN()
Specified by:
getHelpBrokerFQN in interface CompilerConfiguration

getValidatorClass

public java.lang.Class<?> getValidatorClass()
Specified by:
getValidatorClass in interface CompilerConfiguration

getEngine

public JAXXEngine getEngine()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

fixCompileSourceRoots

protected void fixCompileSourceRoots()

report

protected void report(JAXXEngine engine)


Copyright © 2008-2010 CodeLutin. All Rights Reserved.