public abstract class AbstractNlsBundleGenerator extends AbstractIncrementalGenerator
Generator for rebinding the
NlsBundleFactory implementation.| Modifier and Type | Field and Description |
|---|---|
protected static String |
VARIABLE_ARGUMENTS |
protected static String |
VARIABLE_MESSAGE |
| Constructor and Description |
|---|
AbstractNlsBundleGenerator()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
generateClassContents(com.google.gwt.core.ext.typeinfo.JClassType inputType,
com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter sourceWriter,
String simpleName,
com.google.gwt.core.ext.GeneratorContext context)
This method generates the actual contents of the
Class to generate. |
protected void |
generateClassDeclaration(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 additional things for the class declaration.
|
private void |
generateCreateMessageBlock(com.google.gwt.user.rebind.SourceWriter sourceWriter,
boolean hasArguments)
Generates the source code block to create a new
NlsMessage. |
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 |
generateLookupMethod(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.JMethod method,
com.google.gwt.core.ext.typeinfo.JMethod[] methods)
Generates the implementation of
NlsBundleWithLookup.getMessage(String, Map). |
protected void |
generateMethod(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.JMethod method)
Generates an implementation of an
NlsBundle-method. |
protected void |
generateMethodBody(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.JMethod method)
Generates an the body of an
NlsBundle-method. |
protected abstract 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 VARIABLE_MESSAGE excluding the String declaration. |
protected boolean |
isLookupMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
Determines if the given
JMethod is declared in NlsBundleWithLookup. |
createClassName, generate, generateDefaultConstructor, generateIncrementally, generateSourceCloseBlock, generateSourcePublicConstructorDeclaration, generateSourcePublicMethodDeclaration, generateSourcePublicMethodDeclaration, isCachedResultObsoleteprotected static final String VARIABLE_MESSAGE
protected static final String VARIABLE_ARGUMENTS
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)
AbstractIncrementalGeneratorClassSourceFileComposerFactory.addImport(String) to the given ClassSourceFileComposerFactory.generateImportStatements in class AbstractIncrementalGeneratorinputType - 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 generateClassDeclaration(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)
AbstractIncrementalGeneratorClassSourceFileComposerFactory.setSuperclass(String)ClassSourceFileComposerFactory.addImplementedInterface(String)ClassSourceFileComposerFactory.addAnnotationDeclaration(String)ClassSourceFileComposerFactory.makeInterface()ClassSourceFileComposerFactory.setJavaDocCommentForClass(String)ClassSourceFileComposerFactory. E.g.
sourceComposerFactory.addImplementedInterface(inputType.getQualifiedSourceName());
generateClassDeclaration in class AbstractIncrementalGeneratorinputType - 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 generateClassContents(com.google.gwt.core.ext.typeinfo.JClassType inputType,
com.google.gwt.core.ext.TreeLogger logger,
com.google.gwt.user.rebind.SourceWriter sourceWriter,
String simpleName,
com.google.gwt.core.ext.GeneratorContext context)
AbstractIncrementalGeneratorClass to generate.generateClassContents in class AbstractIncrementalGeneratorinputType - is the JClassType reflecting the input-type that triggered the generation via
GWT.create(Class).logger - is the TreeLogger.sourceWriter - is the SourceWriter where to write the source code
to.simpleName - is the simple name of the Class to generate.context - is the GeneratorContext.protected void generateLookupMethod(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.JMethod method,
com.google.gwt.core.ext.typeinfo.JMethod[] methods)
NlsBundleWithLookup.getMessage(String, Map).sourceWriter - is the SourceWriter.logger - is the TreeLogger.context - is the GeneratorContext.method - is the NlsBundleWithLookup.getMessage(String, Map)-method to generate an implementation for.methods - is the list of all declared methods of the bundle. Likely to be ignored but may be used to generate
a switch statement with delegations.protected void generateMethod(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.JMethod method)
NlsBundle-method.sourceWriter - is the SourceWriter.logger - is the TreeLogger.context - is the GeneratorContext.method - is the NlsBundle-method to generate an implementation for.protected void generateMethodBody(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.JMethod method)
NlsBundle-method.sourceWriter - is the SourceWriter.logger - is the TreeLogger.context - is the GeneratorContext.method - is the NlsBundle-method to generate an implementation for.private void generateCreateMessageBlock(com.google.gwt.user.rebind.SourceWriter sourceWriter,
boolean hasArguments)
NlsMessage.sourceWriter - is the SourceWriter.hasArguments - - true if arguments are given, false
otherwise.protected abstract 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)
NlsBundle-method body that creates the code block with the String
variable VARIABLE_MESSAGE excluding the String declaration.sourceWriter - is the SourceWriter.logger - is the TreeLogger.context - is the GeneratorContext.methodName - is the name of the NlsBundle-method to generate.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)
sourceWriter - is the SourceWriter.logger - is the TreeLogger.context - is the GeneratorContext.bundleClass - is the JClassType reflecting the NlsBundle.protected boolean isLookupMethod(com.google.gwt.core.ext.typeinfo.JMethod method)
JMethod is declared in NlsBundleWithLookup.method - is the JMethod to test.true if the given method is from NlsBundleWithLookup, false otherwise.NlsBundleWithLookup.getMessage(String, Map)Copyright © 2001–2016 mmm-Team. All rights reserved.