Package org.nuiton.jaxx.plugin
Class GenerateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.nuiton.plugin.AbstractPlugin
-
- org.nuiton.jaxx.plugin.AbstractJaxxMojo
-
- org.nuiton.jaxx.plugin.GenerateMojo
-
- All Implemented Interfaces:
CompilerConfiguration
,org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,org.nuiton.plugin.Plugin
,org.nuiton.plugin.PluginWithEncoding
@Mojo(name="generate", defaultPhase=PROCESS_SOURCES, requiresDependencyResolution=COMPILE, requiresProject=true) public class GenerateMojo extends AbstractJaxxMojo implements CompilerConfiguration
Generates some java code from jaxx files.- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.nuiton.jaxx.plugin.AbstractJaxxMojo
AbstractJaxxMojo.JaxxFileUpdater
-
-
Field Summary
Fields Modifier and Type Field Description 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 boolean
autoRecurseInCss
To let jaxx recurses in css when a JAXX Object auto import css files for a jaxx file.protected String[]
beanInfoSearchPath
Extra path to be added inIntrospector.setBeanInfoSearchPath(String[])
.protected ClassLoader
cl
customized classloader to use in engineprotected String
compilerFQN
FQN of compiler to use (by default swing one).protected Map<String,CompiledObjectDecorator>
decorators
Decorators available in engine.protected String
defaultDecoratorFQN
The FQN of the ui to use for error notification.protected String
defaultErrorUIFQN
The FQN of the ui to use for error notification.protected String[]
excludes
To filter files to NOt treat.protected String
extraImportList
List of fqn of class toimport for all generated jaxx files.protected String[]
files
detected jaxx files ininit()
methodprotected Map<String,JAXXCompilerFinalizer>
finalizers
Finalizers available in engine.protected String
helpBrokerFQN
the FQN of help broker By default, use the JAXX implementationJAXXHelpBroker
.protected boolean
i18nable
To make compiler i18nable, says add theI18n.t(String, Object...)
method invocation onI18nHelper.I18N_ATTRIBUTES
attributes.protected String[]
includes
To filter file to treat.protected Map<String,Initializer>
initializers
Initializers available to init engine.protected String
jaxxContextFQN
The name of implementation ofJAXXContext
to be used onJAXXObject
.protected boolean
optimize
To optimize generated code.protected File
outJava
Where to generate java files.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 File
src
Directory where jaxx files are located.protected boolean
testPhase
A flag to mark the mojo 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 String
validatorFactoryFQN
the FQN of validator factory.-
Fields inherited from class org.nuiton.jaxx.plugin.AbstractJaxxMojo
generateHelp
-
Fields inherited from interface jaxx.compiler.CompilerConfiguration
DEFAULT_CSS_EXTENSION
-
-
Constructor Summary
Constructors Constructor Description GenerateMojo()
-
Method Summary
-
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, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, backupFile, checkEncoding, checkResource, checkRunOnceDone, 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, wait, wait, wait
-
Methods inherited from interface jaxx.compiler.CompilerConfiguration
getEncoding, isVerbose
-
-
-
-
Field Detail
-
src
@Parameter(property="jaxx.src", defaultValue="${basedir}/src/main/java") protected File src
Directory where jaxx files are located.
-
outJava
@Parameter(property="jaxx.outJava", defaultValue="${basedir}/target/generated-sources/java") protected File outJava
Where to generate java files.
-
includes
@Parameter(property="jaxx.includes") protected String[] includes
To filter file to treat.
-
excludes
@Parameter(property="jaxx.excludes") protected String[] excludes
To filter files to NOt treat.
-
compilerFQN
@Parameter(property="jaxx.compilerFQN", defaultValue="jaxx.compiler.JAXXCompiler", required=true) protected String compilerFQN
FQN of compiler to use (by default swing one).
-
jaxxContextFQN
@Parameter(property="jaxx.jaxxContextFQN", defaultValue="jaxx.runtime.context.DefaultJAXXContext", required=true) protected String jaxxContextFQN
The name of implementation ofJAXXContext
to be used onJAXXObject
. Must not be abstract.
-
defaultErrorUIFQN
@Parameter(property="jaxx.defaultErrorUIFQN") protected String defaultErrorUIFQN
The FQN of the ui to use for error notification. If not given, will use the one defined in validator
-
defaultDecoratorFQN
@Parameter(property="jaxx.defaultDecoratorFQN", defaultValue="jaxx.compiler.decorators.DefaultCompiledObjectDecorator") protected 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
-
addSourcesToClassPath
@Parameter(property="jaxx.addSourcesToClassPath", defaultValue="false") protected boolean addSourcesToClassPath
Flag to include in compiler classpath the java sources directories (src and outJava). By default, false.
-
addResourcesToClassPath
@Parameter(property="jaxx.addResourcesToClassPath", defaultValue="false") protected boolean addResourcesToClassPath
Flag to include in compiler classpath the java resources directories (src and outJava). By default, false.- Since:
- 1.6.0
-
addCompileClassPath
@Parameter(property="jaxx.addCompileClassPath", defaultValue="false") 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
-
addProjectClassPath
@Parameter(property="jaxx.addProjectClassPath", defaultValue="false") protected boolean addProjectClassPath
Flag to include in compiler classpath the project compile classpath. By default, false.
-
testPhase
@Parameter(property="jaxx.testPhase", defaultValue="false") protected boolean testPhase
A flag to mark the mojo to be used in a test phase. This will permits to add generated sources in test compile roots.- Since:
- 1.6.0
-
i18nable
@Parameter(property="jaxx.i18nable", defaultValue="true") protected boolean i18nable
To make compiler i18nable, says add theI18n.t(String, Object...)
method invocation onI18nHelper.I18N_ATTRIBUTES
attributes.- See Also:
I18nHelper
-
optimize
@Parameter(property="jaxx.optimize", defaultValue="false") protected boolean optimize
To optimize generated code.
-
autoRecurseInCss
@Parameter(property="jaxx.autoRecurseInCss", defaultValue="true") protected boolean autoRecurseInCss
To let jaxx recurses in css when a JAXX Object auto import css files for a jaxx file. Warning: This option will be removed in version 3.0 or at least default value will becomefalse
.- Since:
- 2.0.2
-
addLogger
@Parameter(property="jaxx.addLogger", defaultValue="true") protected boolean addLogger
Flag to add logger to each generated jaxx file. By default, always add it.
-
resetAfterCompile
@Parameter(property="jaxx.resetAfterCompile", defaultValue="true") protected boolean resetAfterCompile
Flag to keep compilers after the generate operation (usefull for tests. By default, always reset.
-
beanInfoSearchPath
@Parameter(property="jaxx.beanInfoSearchPath") protected String[] beanInfoSearchPath
Extra path to be added inIntrospector.setBeanInfoSearchPath(String[])
. add beanInfoSearchPath to be registred byBeanInfoUtil.addJaxxBeanInfoPath(String...)
and then will be use byDefaultInitializer.initialize()
. This permit to use real beanInfo of imported graphic libraries.
-
extraImportList
@Parameter(property="jaxx.extraImportList") protected String extraImportList
List of fqn of class toimport for all generated jaxx files.
-
useUIManagerForIcon
@Parameter(property="jaxx.useUIManagerForIcon", defaultValue="false") protected boolean useUIManagerForIcon
A flag to use UIManager to retreave icons.
-
profile
@Parameter(property="jaxx.profile", defaultValue="false") protected boolean profile
flag to activate profile mode. By default, not active.
-
showBinding
@Parameter(property="jaxx.showBinding", defaultValue="false") protected boolean showBinding
To show detected bindings. By default, do not show them.- Since:
- 2.0.0
-
helpBrokerFQN
@Parameter(property="jaxx.helpBrokerFQN", defaultValue="jaxx.runtime.swing.help.JAXXHelpBroker") protected String helpBrokerFQN
the FQN of help broker By default, use the JAXX implementationJAXXHelpBroker
.- Since:
- 1.3
-
validatorFactoryFQN
@Parameter(property="jaxx.validatorFactoryFQN", defaultValue="jaxx.runtime.validator.swing.SwingValidator") protected String validatorFactoryFQN
the FQN of validator factory. By default, use the JAXX implementationSwingValidator
.- Since:
- 2.6
-
decorators
@Component(role=jaxx.compiler.CompiledObjectDecorator.class) protected Map<String,CompiledObjectDecorator> decorators
Decorators available in engine.- Since:
- 2.0.2
-
finalizers
@Component(role=jaxx.compiler.finalizers.JAXXCompilerFinalizer.class) protected Map<String,JAXXCompilerFinalizer> finalizers
Finalizers available in engine.- Since:
- 2.0.2
-
initializers
@Component(role=jaxx.compiler.spi.Initializer.class) protected Map<String,Initializer> initializers
Initializers available to init engine.- Since:
- 2.0.2
-
updater
protected org.nuiton.io.MirroredFileUpdater updater
file updater used to detect jaxx files. Note: ifAbstractJaxxMojo.verbose
flag is on, will ne be used
-
cl
protected ClassLoader cl
customized classloader to use in engine
-
-
Method Detail
-
init
public void init() throws Exception
- Specified by:
init
in classorg.nuiton.plugin.AbstractPlugin
- Throws:
Exception
-
checkSkip
protected boolean checkSkip()
- Overrides:
checkSkip
in classorg.nuiton.plugin.AbstractPlugin
-
doAction
public void doAction() throws Exception
- Specified by:
doAction
in classorg.nuiton.plugin.AbstractPlugin
- Throws:
Exception
-
getTargetDirectory
public File getTargetDirectory()
- Specified by:
getTargetDirectory
in interfaceCompilerConfiguration
- Specified by:
getTargetDirectory
in classAbstractJaxxMojo
-
setTargetDirectory
public void setTargetDirectory(File targetDirectory)
- Specified by:
setTargetDirectory
in classAbstractJaxxMojo
-
getOptimize
public boolean getOptimize()
- Specified by:
getOptimize
in interfaceCompilerConfiguration
-
isAutoRecurseInCss
public boolean isAutoRecurseInCss()
- Specified by:
isAutoRecurseInCss
in interfaceCompilerConfiguration
-
isI18nable
public boolean isI18nable()
- Specified by:
isI18nable
in interfaceCompilerConfiguration
-
isUseUIManagerForIcon
public boolean isUseUIManagerForIcon()
- Specified by:
isUseUIManagerForIcon
in interfaceCompilerConfiguration
-
isAddLogger
public boolean isAddLogger()
- Specified by:
isAddLogger
in interfaceCompilerConfiguration
-
isShowClassDescriptorLoading
public boolean isShowClassDescriptorLoading()
- Specified by:
isShowClassDescriptorLoading
in interfaceCompilerConfiguration
-
isAddAutoHandlerUI
public boolean isAddAutoHandlerUI()
- Specified by:
isAddAutoHandlerUI
in interfaceCompilerConfiguration
-
setAddAutoHandlerUI
public void setAddAutoHandlerUI(boolean addAutoHandlerUI)
- Specified by:
setAddAutoHandlerUI
in interfaceCompilerConfiguration
-
isGenerateMissingIdsAndStyleClassesInCss
public boolean isGenerateMissingIdsAndStyleClassesInCss()
- Specified by:
isGenerateMissingIdsAndStyleClassesInCss
in interfaceCompilerConfiguration
-
setGenerateMissingIdsAndStyleClassesInCss
public void setGenerateMissingIdsAndStyleClassesInCss(boolean generateMissingIdsAndStyleClassesInCss)
- Specified by:
setGenerateMissingIdsAndStyleClassesInCss
in interfaceCompilerConfiguration
-
getJaxxContextClass
public Class<? extends JAXXContext> getJaxxContextClass()
- Specified by:
getJaxxContextClass
in interfaceCompilerConfiguration
-
getExtraImports
public String[] getExtraImports()
- Specified by:
getExtraImports
in interfaceCompilerConfiguration
-
isResetAfterCompile
public boolean isResetAfterCompile()
- Specified by:
isResetAfterCompile
in interfaceCompilerConfiguration
-
isOptimize
public boolean isOptimize()
- Specified by:
isOptimize
in interfaceCompilerConfiguration
-
getDefaultErrorUI
public Class<?> getDefaultErrorUI()
- Specified by:
getDefaultErrorUI
in interfaceCompilerConfiguration
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfaceCompilerConfiguration
-
getCompilerClass
public Class<? extends JAXXCompiler> getCompilerClass()
- Specified by:
getCompilerClass
in interfaceCompilerConfiguration
-
getDefaultDecoratorClass
public Class<? extends CompiledObjectDecorator> getDefaultDecoratorClass()
- Specified by:
getDefaultDecoratorClass
in interfaceCompilerConfiguration
-
isProfile
public boolean isProfile()
- Specified by:
isProfile
in interfaceCompilerConfiguration
-
isGenerateHelp
public boolean isGenerateHelp()
- Specified by:
isGenerateHelp
in interfaceCompilerConfiguration
-
getHelpBrokerFQN
public String getHelpBrokerFQN()
- Specified by:
getHelpBrokerFQN
in interfaceCompilerConfiguration
-
getValidatorFactoryFQN
public String getValidatorFactoryFQN()
- Specified by:
getValidatorFactoryFQN
in interfaceCompilerConfiguration
-
getDecorators
public Map<String,CompiledObjectDecorator> getDecorators()
- Specified by:
getDecorators
in interfaceCompilerConfiguration
-
getFinalizers
public Map<String,JAXXCompilerFinalizer> getFinalizers()
- Specified by:
getFinalizers
in interfaceCompilerConfiguration
-
getInitializers
public Map<String,Initializer> getInitializers()
- Specified by:
getInitializers
in interfaceCompilerConfiguration
-
getCommonCss
public File getCommonCss()
- Specified by:
getCommonCss
in interfaceCompilerConfiguration
-
getCssExtension
public String getCssExtension()
- Specified by:
getCssExtension
in interfaceCompilerConfiguration
-
getEngine
public JAXXEngine getEngine()
-
fixCompileSourceRoots
protected void fixCompileSourceRoots()
-
report
protected void report(JAXXEngine engine)
-
-