com.google.gwt.core.ext
Class Generator

java.lang.Object
  extended bycom.google.gwt.core.ext.Generator
Direct Known Subclasses:
JUnitTestCaseStubGenerator, ServiceInterfaceProxyGenerator

public abstract class Generator
extends Object

Generates source code for subclasses during deferred binding requests. Subclasses must be thread-safe.


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
Generator()
           
 
Method Summary
static String escape(String unescaped)
          Escapes string content to be a valid string literal.
abstract  String generate(TreeLogger logger, GeneratorContext context, String typeName)
          Generate a default constructible subclass of the requested type.
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode, toString
 

Constructor Detail

Generator

public Generator()
Method Detail

generate

public abstract String generate(TreeLogger logger,
                                GeneratorContext context,
                                String typeName)
                         throws UnableToCompleteException
Generate a default constructible subclass of the requested type.

Returns:
the name of a subclass to substitute for the requested class, or return null to cause the requested type itself to be used
Throws:
UnableToCompleteException - if for any reason the generator cannot provide a substitute class

escape

public static String escape(String unescaped)
Escapes string content to be a valid string literal.

Returns:
an escaped version of unescaped, suitable for being enclosed in double quotes in Java source


This javadoc distribution was not produced by Google. The official documentation is here.