public class NlsBundleGeneratorGwtI18n extends AbstractNlsBundleGenerator
Generator
for generation of NlsBundle
implementations.Modifier and Type | Field and Description |
---|---|
private static String |
VARIABLE_GWT_I18N
The name of the variable with the GWT i18n interface.
|
VARIABLE_ARGUMENTS, VARIABLE_MESSAGE
Constructor and Description |
---|
NlsBundleGeneratorGwtI18n()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
private String |
generateBundleInterface(com.google.gwt.core.ext.typeinfo.JClassType bundleClass,
com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.core.ext.GeneratorContext context)
This method generates the GWT-i18n-interface for the NLS-bundle.
|
protected void |
generateFields(com.google.gwt.user.rebind.SourceWriter sourceWriter,
com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.core.ext.GeneratorContext context,
com.google.gwt.core.ext.typeinfo.JClassType bundleClass)
Generates the (private) fields.
|
protected void |
generateImportStatements(com.google.gwt.core.ext.typeinfo.JClassType inputType,
com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.user.rebind.ClassSourceFileComposerFactory sourceComposerFactory,
com.google.gwt.core.ext.GeneratorContext context)
This method generates the import statements.
|
protected void |
generateMethodMessageBlock(com.google.gwt.user.rebind.SourceWriter sourceWriter,
com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.core.ext.GeneratorContext context,
String methodName)
Generates the block of the
NlsBundle -method body that creates the code block with the String
variable AbstractNlsBundleGenerator.VARIABLE_MESSAGE excluding the String declaration. |
long |
getVersionId() |
generateClassContents, generateClassDeclaration, generateLookupMethod, generateMethod, generateMethodBody, isLookupMethod
createClassName, generate, generateDefaultConstructor, generateIncrementally, generateSourceCloseBlock, generateSourcePublicConstructorDeclaration, generateSourcePublicMethodDeclaration, generateSourcePublicMethodDeclaration, isCachedResultObsolete
private static final String VARIABLE_GWT_I18N
protected void generateImportStatements(com.google.gwt.core.ext.typeinfo.JClassType inputType, com.google.gwt.core.ext.TreeLogger logger, com.google.gwt.user.rebind.ClassSourceFileComposerFactory sourceComposerFactory, com.google.gwt.core.ext.GeneratorContext context)
AbstractIncrementalGenerator
ClassSourceFileComposerFactory.addImport(String)
to the given ClassSourceFileComposerFactory
.generateImportStatements
in class AbstractNlsBundleGenerator
inputType
- is the JClassType
reflecting the input-type that triggered the generation via
GWT.create(Class)
.logger
- is the TreeLogger
.sourceComposerFactory
- is the ClassSourceFileComposerFactory
.context
- is the GeneratorContext
.protected void generateFields(com.google.gwt.user.rebind.SourceWriter sourceWriter, com.google.gwt.core.ext.TreeLogger logger, com.google.gwt.core.ext.GeneratorContext context, com.google.gwt.core.ext.typeinfo.JClassType bundleClass)
AbstractNlsBundleGenerator
generateFields
in class AbstractNlsBundleGenerator
sourceWriter
- is the SourceWriter
.logger
- is the TreeLogger
.context
- is the GeneratorContext
.bundleClass
- is the JClassType
reflecting the NlsBundle
.protected void generateMethodMessageBlock(com.google.gwt.user.rebind.SourceWriter sourceWriter, com.google.gwt.core.ext.TreeLogger logger, com.google.gwt.core.ext.GeneratorContext context, String methodName)
AbstractNlsBundleGenerator
NlsBundle
-method body that creates the code block with the String
variable AbstractNlsBundleGenerator.VARIABLE_MESSAGE
excluding the String
declaration.generateMethodMessageBlock
in class AbstractNlsBundleGenerator
sourceWriter
- is the SourceWriter
.logger
- is the TreeLogger
.context
- is the GeneratorContext
.methodName
- is the name of the NlsBundle
-method to generate.private String generateBundleInterface(com.google.gwt.core.ext.typeinfo.JClassType bundleClass, com.google.gwt.core.ext.TreeLogger logger, com.google.gwt.core.ext.GeneratorContext context)
bundleClass
- is the class
of the NlsBundle
to generate.logger
- is the TreeLogger
.context
- is the GeneratorContext
.public long getVersionId()
getVersionId
in class com.google.gwt.core.ext.IncrementalGenerator
Copyright © 2001–2016 mmm-Team. All rights reserved.