org.nuiton.i18n.plugin.parser.impl
Class ParserGWTJavaMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.i18n.plugin.AbstractI18nMojo
              extended by org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
                  extended by org.nuiton.i18n.plugin.parser.impl.ParserGWTJavaMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, I18nParserConfiguration, org.nuiton.plugin.Plugin, org.nuiton.plugin.PluginWithEncoding

public class ParserGWTJavaMojo
extends AbstractI18nParserMojo

To detect from GWT java files new I18n keys, says content of patterns :

Note: this goal must always be invoked before the process-resources phase, otherwise all files will be considered as uptodate.

Since:
2.1
Author:
tchemit
Is defined by the goal name:
parserGWTJava
Is bound to the specified phase of the standard build lifecycle:
generate-resources

Nested Class Summary
protected  class ParserGWTJavaMojo.GWTJavaFileParser
           
static class ParserGWTJavaMojo.GWTJavaProcessor
          To Extract i18n keys from GWT java files.
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.InitState, org.nuiton.plugin.Plugin.Packaging
 
Field Summary
protected  File defaultBasedir
          Root directory of the default entry.
protected  String defaultIncludes
          Default included files to process (ant-like expression).
protected  org.nuiton.io.MirroredFileUpdater entryUpdater
           
protected  String outputGetter
          Defines the file name of the getter where to put detected i18n keys while getter phase.
protected  File workdir
          Where to generated temporary processed files.
 
Fields inherited from class org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
backupGetter, cp, entries, force, oldLanguage, oldParser, showTouchedFiles, t0, treateDefaultEntry
 
Fields inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
artifactId, bundles, encoding, genSrc, locales, out, project, silent, src, strictMode, verbose
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ParserGWTJavaMojo()
           
 
Method Summary
 File getDefaultBasedir()
           
 String[] getDefaultExcludes()
           
 String[] getDefaultIncludes()
           
protected  String getOutGetter()
           
 FileParser newFileParser()
           
 org.nuiton.io.FileUpdater newFileUpdater(SourceEntry entry)
           
protected  boolean onEnterEntry(I18nSourceEntry entry)
           
 
Methods inherited from class org.nuiton.i18n.plugin.parser.AbstractI18nParserMojo
addDefaultEntry, doAction, getLogEntry, getResult, init, isForce, isShowTouchedFiles, isStrictMode, saveGetterFile
 
Methods inherited from class org.nuiton.i18n.plugin.AbstractI18nMojo
addGetter, backupFile, checkBundle, checkPackaging, getArtifactId, getBackupFile, getEncoding, getGetterFile, getI18nFile, getProject, isSilent, isVerbose, needGeneration, setEncoding, setProject, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, afterExecute, checkEncoding, checkResource, checkRunOnceDone, checkSkip, copyFile, createDirectoryIfNecessary, createNewFile, deleteFile, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getRootProject, getTemplate, hasClassPath, 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, toString, wait, wait, wait
 
Methods inherited from interface org.nuiton.i18n.plugin.parser.I18nParserConfiguration
getLog, isSilent, isVerbose
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute, getLog, setLog
 

Field Detail

defaultBasedir

protected File defaultBasedir
Root directory of the default entry.

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

defaultIncludes

protected String defaultIncludes
Default included files to process (ant-like expression).

Is defined by:
expression:
${i18n.defaultIncludes}
default-value:
**\/*.java

outputGetter

protected String outputGetter
Defines the file name of the getter where to put detected i18n keys while getter phase.

Since:
2.0
Is defined by:
expression:
${i18n.outputGetter}
default-value:
gwt-java.getter

workdir

protected File workdir
Where to generated temporary processed files.

Since:
2.0
Is defined by:
expression:
${i18n.workdir}
default-value:
${basedir}/target/i18n-workdir

entryUpdater

protected org.nuiton.io.MirroredFileUpdater entryUpdater
Constructor Detail

ParserGWTJavaMojo

public ParserGWTJavaMojo()
Method Detail

getDefaultIncludes

public String[] getDefaultIncludes()
Specified by:
getDefaultIncludes in class AbstractI18nParserMojo
Returns:
the default includes to add to directory scanner

getDefaultExcludes

public String[] getDefaultExcludes()
Specified by:
getDefaultExcludes in class AbstractI18nParserMojo
Returns:
the default excludes to add to directory scanner

getDefaultBasedir

public File getDefaultBasedir()
Specified by:
getDefaultBasedir in class AbstractI18nParserMojo
Returns:
the default src directory to use in directory scanner

onEnterEntry

protected boolean onEnterEntry(I18nSourceEntry entry)
Overrides:
onEnterEntry in class AbstractI18nParserMojo

newFileUpdater

public org.nuiton.io.FileUpdater newFileUpdater(SourceEntry entry)
Specified by:
newFileUpdater in class AbstractI18nParserMojo
Parameters:
entry - the incoming source entry to attach to the file updater
Returns:
a new file updater to detects files to treate

getOutGetter

protected String getOutGetter()
Specified by:
getOutGetter in class AbstractI18nParserMojo
Returns:
the outGetter to use for the instance (java.getter,...)

newFileParser

public FileParser newFileParser()
Specified by:
newFileParser in class AbstractI18nParserMojo
Returns:
a new file parser to be used in the parser consumer parserExecutor


Copyright © 2007-2011 CodeLutin. All Rights Reserved.