public abstract class

AbstractGeneratorClassCreator

extends AbstractSourceCreator
java.lang.Object
   ↳ com.google.gwt.user.rebind.AbstractSourceCreator
     ↳ com.google.gwt.user.rebind.AbstractGeneratorClassCreator
Known Direct Subclasses

Class Overview

Abstract functionality needed to create classes needed to supply generators.

Summary

Fields
protected Map<JType, AbstractMethodCreator> methodFactories List of registered method factories associated with Constant method implementations.
Public Constructors
AbstractGeneratorClassCreator(SourceWriter writer, JClassType targetClass)
Creates a new class creator, supplies a place to write the class, the interface to conform to, and the new name.
Public Methods
void emitClass(TreeLogger logger, GwtLocale locale)
Emits the new class.
static JMethod[] getAllInterfaceMethods(JClassType type)
Returns all interface methods associated with the given type.
JClassType getTarget()
UnableToCompleteException logMissingResource(TreeLogger logger, String during, AbstractResource.MissingResourceException e)
void register(JType returnType, AbstractMethodCreator creator)
Registers a method creator.
Protected Methods
String branchMessage()
Returns the standard message when constructing a branch.
void classEpilog()
Entry point for subclass cleanup code.
void classPrologue()
Entry point for subclass setup code.
abstract void emitMethodBody(TreeLogger logger, JMethod method, GwtLocale locale)
Emit method body, arguments are arg1...argN.
AbstractMethodCreator getMethodCreator(TreeLogger logger, JMethod method)
Gets the method creator associated with the return type of the method.
SourceWriter getWriter()
Gets the associated writer.
[Expand]
Inherited Methods
From class com.google.gwt.user.rebind.AbstractSourceCreator
From class java.lang.Object

Fields

protected Map<JType, AbstractMethodCreator> methodFactories

List of registered method factories associated with Constant method implementations.

Public Constructors

public AbstractGeneratorClassCreator (SourceWriter writer, JClassType targetClass)

Creates a new class creator, supplies a place to write the class, the interface to conform to, and the new name.

Parameters
writer writer
targetClass class name

Public Methods

public void emitClass (TreeLogger logger, GwtLocale locale)

Emits the new class.

Throws
UnableToCompleteException

public static JMethod[] getAllInterfaceMethods (JClassType type)

Returns all interface methods associated with the given type.

Parameters
type associated type
Returns
  • interface methods.

public JClassType getTarget ()

public UnableToCompleteException logMissingResource (TreeLogger logger, String during, AbstractResource.MissingResourceException e)

public void register (JType returnType, AbstractMethodCreator creator)

Registers a method creator.

Parameters
returnType return type that this creator handles.
creator creator to register

Protected Methods

protected String branchMessage ()

Returns the standard message when constructing a branch.

Returns
  • branch message

protected void classEpilog ()

Entry point for subclass cleanup code.

protected void classPrologue ()

Entry point for subclass setup code.

protected abstract void emitMethodBody (TreeLogger logger, JMethod method, GwtLocale locale)

Emit method body, arguments are arg1...argN.

Parameters
logger TreeLogger for logging
method method to generate
locale locale for this generation
Throws
UnableToCompleteException

protected AbstractMethodCreator getMethodCreator (TreeLogger logger, JMethod method)

Gets the method creator associated with the return type of the method.

Parameters
method method to create
Returns
  • the method creator
Throws
UnableToCompleteException

protected SourceWriter getWriter ()

Gets the associated writer.

Returns
  • writer