Package org.tentackle.maven.i18n
Class AbstractI18nMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.tentackle.maven.AbstractTentackleMojo
-
- org.tentackle.maven.i18n.AbstractI18nMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,org.tentackle.pdo.DomainContextProvider
public abstract class AbstractI18nMojo extends org.tentackle.maven.AbstractTentackleMojo implements org.tentackle.pdo.DomainContextProviderBase class for i18n mojos.- Author:
- harald
-
-
Field Summary
Fields Modifier and Type Field Description protected intbundleCountBundle bundleCount.protected java.util.List<java.lang.String>classpathElementsProject classpath.protected org.tentackle.pdo.DomainContextcontextThe domain context to access the stored bundles.protected interrorsError bundleCount.protected java.lang.StringlocalesAdditional locales except the default one.protected java.util.List<java.lang.String>localeSuffixesAdditional locale suffixes to scan for property files.
Without leading underscore.java.lang.StringpasswordThe backend password.protected intupdatesNumber of updated translations.protected java.lang.StringurlThe backend URL.java.lang.StringuserThe backend username.protected intwarningsWarning bundleCount.
-
Constructor Summary
Constructors Constructor Description AbstractI18nMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidexecute()org.tentackle.pdo.DomainContextgetDomainContext()abstract voidprocessBundle(java.lang.ClassLoader classLoader, java.lang.String bundleName, java.lang.String locale, java.lang.String resourceName)Process the given bundle resource name.
The resource name must not start with a leading slash because this method directly uses the classloader's getResourceAsStream method.protected booleanvalidate()-
Methods inherited from class org.tentackle.maven.AbstractTentackleMojo
determineEncoding, determineVerbosity, findResourceDirs, getCanonicalPath, getPathRelativeToBasedir, getResourceDirName
-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
classpathElements
@Parameter(defaultValue="${project.compileClasspathElements}", readonly=true, required=true) protected java.util.List<java.lang.String> classpathElementsProject classpath.
-
url
@Parameter(required=true) protected java.lang.String url
The backend URL.
-
user
@Parameter(required=true) public java.lang.String user
The backend username.
-
password
@Parameter public java.lang.String password
The backend password.
-
locales
@Parameter protected java.lang.String locales
Additional locales except the default one.
-
localeSuffixes
protected java.util.List<java.lang.String> localeSuffixes
Additional locale suffixes to scan for property files.
Without leading underscore.
-
context
protected org.tentackle.pdo.DomainContext context
The domain context to access the stored bundles.
-
bundleCount
protected int bundleCount
Bundle bundleCount.
-
errors
protected int errors
Error bundleCount.
-
warnings
protected int warnings
Warning bundleCount.
-
updates
protected int updates
Number of updated translations.
-
-
Method Detail
-
getDomainContext
public org.tentackle.pdo.DomainContext getDomainContext()
- Specified by:
getDomainContextin interfaceorg.tentackle.pdo.DomainContextProvider
-
validate
protected boolean validate() throws org.apache.maven.plugin.MojoExecutionException- Overrides:
validatein classorg.tentackle.maven.AbstractTentackleMojo- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
processBundle
public abstract void processBundle(java.lang.ClassLoader classLoader, java.lang.String bundleName, java.lang.String locale, java.lang.String resourceName)Process the given bundle resource name.
The resource name must not start with a leading slash because this method directly uses the classloader's getResourceAsStream method.- Parameters:
classLoader- the project classloaderresourceName- the bundle resource name without leading slashbundleName- the original bundle class namelocale- the locale, null if default
-
-