com.google.gwt.resources.rebind.context
Class AbstractClientBundleGenerator

java.lang.Object
  extended by Generator
      extended by com.google.gwt.resources.rebind.context.AbstractClientBundleGenerator
Direct Known Subclasses:
InlineClientBundleGenerator, MhtmlClientBundleGenerator, StaticClientBundleGenerator

public abstract class AbstractClientBundleGenerator
extends Generator

The base class for creating new ClientBundle implementations.

The general structure of the generated class is as follows:

 public ResourceType resource() {
   return resource;
 }
 private void _init0() {
   resource = new Resource();
 }
 // Other ResourceGenerator-defined fields
 private static ResourceType resource;
 static {
   new ClientBundle()._init0();
 }
 public ResourcePrototype[] getResources() {
   return new ResourcePrototype[] { resource() };
 }
 public native ResourcePrototype getResource(String name) /-{
   switch (name) {
     case 'resource': return this.@...::resource()();
   }
   return null;
 }-/
 
The instantiation of the individual ResourcePrototypes is done in the content of an instance of the ClientBundle type so that resources can refer to one another by simply emitting a call to resource().


Constructor Summary
AbstractClientBundleGenerator()
           
 
Method Summary
 java.lang.String generate(TreeLogger logger, GeneratorContext generatorContext, java.lang.String typeName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractClientBundleGenerator

public AbstractClientBundleGenerator()
Method Detail

generate

public final java.lang.String generate(TreeLogger logger,
                                       GeneratorContext generatorContext,
                                       java.lang.String typeName)
                                throws UnableToCompleteException
Throws:
UnableToCompleteException