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 CompilerConfigurationGenerates 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 booleanaddCompileClassPathFlag to include in compiler classpath the compile class-path (can only be used in a test phase).protected booleanaddLoggerFlag to add logger to each generated jaxx file.protected booleanaddProjectClassPathFlag to include in compiler classpath the project compile classpath.protected booleanaddResourcesToClassPathFlag to include in compiler classpath the java resources directories (src and outJava).protected booleanaddSourcesToClassPathFlag to include in compiler classpath the java sources directories (src and outJava).protected booleanautoRecurseInCssTo let jaxx recurses in css when a JAXX Object auto import css files for a jaxx file.protected String[]beanInfoSearchPathExtra path to be added inIntrospector.setBeanInfoSearchPath(String[]).protected ClassLoaderclcustomized classloader to use in engineprotected StringcompilerFQNFQN of compiler to use (by default swing one).protected Map<String,CompiledObjectDecorator>decoratorsDecorators available in engine.protected StringdefaultDecoratorFQNThe FQN of the ui to use for error notification.protected StringdefaultErrorUIFQNThe FQN of the ui to use for error notification.protected String[]excludesTo filter files to NOt treat.protected StringextraImportListList of fqn of class toimport for all generated jaxx files.protected String[]filesdetected jaxx files ininit()methodprotected Map<String,JAXXCompilerFinalizer>finalizersFinalizers available in engine.protected StringhelpBrokerFQNthe FQN of help broker By default, use the JAXX implementationJAXXHelpBroker.protected booleani18nableTo make compiler i18nable, says add theI18n.t(String, Object...)method invocation onI18nHelper.I18N_ATTRIBUTESattributes.protected String[]includesTo filter file to treat.protected Map<String,Initializer>initializersInitializers available to init engine.protected StringjaxxContextFQNThe name of implementation ofJAXXContextto be used onJAXXObject.protected booleanoptimizeTo optimize generated code.protected FileoutJavaWhere to generate java files.protected booleanprofileflag to activate profile mode.protected booleanresetAfterCompileFlag to keep compilers after the generate operation (usefull for tests.protected booleanshowBindingTo show detected bindings.protected FilesrcDirectory where jaxx files are located.protected booleantestPhaseA flag to mark the mojo to be used in a test phase.protected org.nuiton.io.MirroredFileUpdaterupdaterfile updater used to detect jaxx files.protected booleanuseUIManagerForIconA flag to use UIManager to retreave icons.protected StringvalidatorFactoryFQNthe 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 srcDirectory where jaxx files are located.
-
outJava
@Parameter(property="jaxx.outJava", defaultValue="${basedir}/target/generated-sources/java") protected File outJavaWhere 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 compilerFQNFQN of compiler to use (by default swing one).
-
jaxxContextFQN
@Parameter(property="jaxx.jaxxContextFQN", defaultValue="jaxx.runtime.context.DefaultJAXXContext", required=true) protected String jaxxContextFQNThe name of implementation ofJAXXContextto 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 defaultDecoratorFQNThe 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 addSourcesToClassPathFlag to include in compiler classpath the java sources directories (src and outJava). By default, false.
-
addResourcesToClassPath
@Parameter(property="jaxx.addResourcesToClassPath", defaultValue="false") protected boolean addResourcesToClassPathFlag 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 addCompileClassPathFlag 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 addProjectClassPathFlag to include in compiler classpath the project compile classpath. By default, false.
-
testPhase
@Parameter(property="jaxx.testPhase", defaultValue="false") protected boolean testPhaseA 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 i18nableTo make compiler i18nable, says add theI18n.t(String, Object...)method invocation onI18nHelper.I18N_ATTRIBUTESattributes.- See Also:
I18nHelper
-
optimize
@Parameter(property="jaxx.optimize", defaultValue="false") protected boolean optimizeTo optimize generated code.
-
autoRecurseInCss
@Parameter(property="jaxx.autoRecurseInCss", defaultValue="true") protected boolean autoRecurseInCssTo 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 addLoggerFlag to add logger to each generated jaxx file. By default, always add it.
-
resetAfterCompile
@Parameter(property="jaxx.resetAfterCompile", defaultValue="true") protected boolean resetAfterCompileFlag 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 useUIManagerForIconA flag to use UIManager to retreave icons.
-
profile
@Parameter(property="jaxx.profile", defaultValue="false") protected boolean profileflag to activate profile mode. By default, not active.
-
showBinding
@Parameter(property="jaxx.showBinding", defaultValue="false") protected boolean showBindingTo 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 helpBrokerFQNthe 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 validatorFactoryFQNthe 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.verboseflag 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:
initin classorg.nuiton.plugin.AbstractPlugin- Throws:
Exception
-
checkSkip
protected boolean checkSkip()
- Overrides:
checkSkipin classorg.nuiton.plugin.AbstractPlugin
-
doAction
public void doAction() throws Exception- Specified by:
doActionin classorg.nuiton.plugin.AbstractPlugin- Throws:
Exception
-
getTargetDirectory
public File getTargetDirectory()
- Specified by:
getTargetDirectoryin interfaceCompilerConfiguration- Specified by:
getTargetDirectoryin classAbstractJaxxMojo
-
setTargetDirectory
public void setTargetDirectory(File targetDirectory)
- Specified by:
setTargetDirectoryin classAbstractJaxxMojo
-
getOptimize
public boolean getOptimize()
- Specified by:
getOptimizein interfaceCompilerConfiguration
-
isAutoRecurseInCss
public boolean isAutoRecurseInCss()
- Specified by:
isAutoRecurseInCssin interfaceCompilerConfiguration
-
isI18nable
public boolean isI18nable()
- Specified by:
isI18nablein interfaceCompilerConfiguration
-
isUseUIManagerForIcon
public boolean isUseUIManagerForIcon()
- Specified by:
isUseUIManagerForIconin interfaceCompilerConfiguration
-
isAddLogger
public boolean isAddLogger()
- Specified by:
isAddLoggerin interfaceCompilerConfiguration
-
isShowClassDescriptorLoading
public boolean isShowClassDescriptorLoading()
- Specified by:
isShowClassDescriptorLoadingin interfaceCompilerConfiguration
-
isAddAutoHandlerUI
public boolean isAddAutoHandlerUI()
- Specified by:
isAddAutoHandlerUIin interfaceCompilerConfiguration
-
setAddAutoHandlerUI
public void setAddAutoHandlerUI(boolean addAutoHandlerUI)
- Specified by:
setAddAutoHandlerUIin interfaceCompilerConfiguration
-
isGenerateMissingIdsAndStyleClassesInCss
public boolean isGenerateMissingIdsAndStyleClassesInCss()
- Specified by:
isGenerateMissingIdsAndStyleClassesInCssin interfaceCompilerConfiguration
-
setGenerateMissingIdsAndStyleClassesInCss
public void setGenerateMissingIdsAndStyleClassesInCss(boolean generateMissingIdsAndStyleClassesInCss)
- Specified by:
setGenerateMissingIdsAndStyleClassesInCssin interfaceCompilerConfiguration
-
getJaxxContextClass
public Class<? extends JAXXContext> getJaxxContextClass()
- Specified by:
getJaxxContextClassin interfaceCompilerConfiguration
-
getExtraImports
public String[] getExtraImports()
- Specified by:
getExtraImportsin interfaceCompilerConfiguration
-
isResetAfterCompile
public boolean isResetAfterCompile()
- Specified by:
isResetAfterCompilein interfaceCompilerConfiguration
-
isOptimize
public boolean isOptimize()
- Specified by:
isOptimizein interfaceCompilerConfiguration
-
getDefaultErrorUI
public Class<?> getDefaultErrorUI()
- Specified by:
getDefaultErrorUIin interfaceCompilerConfiguration
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfaceCompilerConfiguration
-
getCompilerClass
public Class<? extends JAXXCompiler> getCompilerClass()
- Specified by:
getCompilerClassin interfaceCompilerConfiguration
-
getDefaultDecoratorClass
public Class<? extends CompiledObjectDecorator> getDefaultDecoratorClass()
- Specified by:
getDefaultDecoratorClassin interfaceCompilerConfiguration
-
isProfile
public boolean isProfile()
- Specified by:
isProfilein interfaceCompilerConfiguration
-
isGenerateHelp
public boolean isGenerateHelp()
- Specified by:
isGenerateHelpin interfaceCompilerConfiguration
-
getHelpBrokerFQN
public String getHelpBrokerFQN()
- Specified by:
getHelpBrokerFQNin interfaceCompilerConfiguration
-
getValidatorFactoryFQN
public String getValidatorFactoryFQN()
- Specified by:
getValidatorFactoryFQNin interfaceCompilerConfiguration
-
getDecorators
public Map<String,CompiledObjectDecorator> getDecorators()
- Specified by:
getDecoratorsin interfaceCompilerConfiguration
-
getFinalizers
public Map<String,JAXXCompilerFinalizer> getFinalizers()
- Specified by:
getFinalizersin interfaceCompilerConfiguration
-
getInitializers
public Map<String,Initializer> getInitializers()
- Specified by:
getInitializersin interfaceCompilerConfiguration
-
getCommonCss
public File getCommonCss()
- Specified by:
getCommonCssin interfaceCompilerConfiguration
-
getCssExtension
public String getCssExtension()
- Specified by:
getCssExtensionin interfaceCompilerConfiguration
-
getEngine
public JAXXEngine getEngine()
-
fixCompileSourceRoots
protected void fixCompileSourceRoots()
-
report
protected void report(JAXXEngine engine)
-
-