com.google.gwt.core.ext

## Class Generator

- java.lang.Object
- - com.google.gwt.core.ext.Generator

- Direct Known Subclasses:
    IncrementalGenerator

      public abstract class Generator
      extends java.lang.Object

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Generator()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `escape(java.lang.String unescaped)` Escapes string content to be a valid string literal.
    `abstract java.lang.String` | `generate(TreeLogger logger, GeneratorContext context, java.lang.String typeName)` Generate a default constructible subclass of the requested type.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Generator

          public Generator()

  - ### Method Detail

    - #### escape

          public static java.lang.String escape(java.lang.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

    - #### generate

          public abstract java.lang.String generate(TreeLogger logger,
                                  GeneratorContext context,
                                  java.lang.String typeName)
                                             throws UnableToCompleteException

      Generate a default constructible subclass of the requested type. The generator throws `UnableToCompleteException` if for any reason it cannot provide a substitute class
      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`