org.fusesource.restygwt.rebind
Class BaseSourceCreator

java.lang.Object
  extended by com.google.gwt.user.rebind.AbstractSourceCreator
      extended by org.fusesource.restygwt.rebind.BaseSourceCreator
Direct Known Subclasses:
ExtendedJsonEncoderDecoderClassCreator, JsonEncoderDecoderClassCreator, RestServiceClassCreator

public abstract class BaseSourceCreator
extends com.google.gwt.user.rebind.AbstractSourceCreator

provides additional helper methods for generating source..

Author:
Hiram Chirino

Nested Class Summary
static interface BaseSourceCreator.Branch<R>
           
 
Field Summary
static TreeLogger.Type ALL
           
protected  GeneratorContext context
           
static TreeLogger.Type DEBUG
           
static TreeLogger.Type ERROR
           
static TreeLogger.Type INFO
           
protected  TreeLogger logger
           
protected  String name
           
protected  String packageName
           
protected  String shortName
           
protected  JClassType source
           
protected  com.google.gwt.user.rebind.SourceWriter sourceWriter
           
static TreeLogger.Type SPAM
           
static TreeLogger.Type TRACE
           
static TreeLogger.Type WARN
           
 
Constructor Summary
BaseSourceCreator(TreeLogger logger, GeneratorContext context, JClassType source, String suffix)
           
 
Method Summary
protected
<R> R
branch(String msg, BaseSourceCreator.Branch<R> callable)
           
protected
<R> R
branch(TreeLogger.Type level, String msg, BaseSourceCreator.Branch<R> callable)
           
static void clearGeneratedClasses()
           
 String create()
           
protected abstract  com.google.gwt.user.rebind.ClassSourceFileComposerFactory createComposerFactory()
           
protected  void debug(String msg)
           
protected  void error(String msg)
           
protected  JClassType find(Class<?> type)
           
protected  JClassType find(String type)
           
protected abstract  void generate()
           
static HashSet<String> getGeneratedClasses()
           
protected  BaseSourceCreator i(int i)
           
protected  void info(String msg)
           
protected  BaseSourceCreator p()
           
protected  BaseSourceCreator p(String value)
           
protected  void trace(String msg)
           
protected  void warn(String msg)
           
protected  PrintWriter writer()
           
 
Methods inherited from class com.google.gwt.user.rebind.AbstractSourceCreator
branch, error, error, error, getJavaObjectTypeFor, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final TreeLogger.Type ERROR

WARN

public static final TreeLogger.Type WARN

INFO

public static final TreeLogger.Type INFO

TRACE

public static final TreeLogger.Type TRACE

DEBUG

public static final TreeLogger.Type DEBUG

SPAM

public static final TreeLogger.Type SPAM

ALL

public static final TreeLogger.Type ALL

context

protected final GeneratorContext context

source

protected final JClassType source

packageName

protected final String packageName

shortName

protected final String shortName

name

protected final String name

logger

protected TreeLogger logger

sourceWriter

protected com.google.gwt.user.rebind.SourceWriter sourceWriter
Constructor Detail

BaseSourceCreator

public BaseSourceCreator(TreeLogger logger,
                         GeneratorContext context,
                         JClassType source,
                         String suffix)
Method Detail

getGeneratedClasses

public static HashSet<String> getGeneratedClasses()

clearGeneratedClasses

public static void clearGeneratedClasses()

writer

protected PrintWriter writer()
                      throws UnableToCompleteException
Throws:
UnableToCompleteException

branch

protected <R> R branch(String msg,
                       BaseSourceCreator.Branch<R> callable)
            throws UnableToCompleteException
Throws:
UnableToCompleteException

branch

protected <R> R branch(TreeLogger.Type level,
                       String msg,
                       BaseSourceCreator.Branch<R> callable)
            throws UnableToCompleteException
Throws:
UnableToCompleteException

error

protected void error(String msg)
              throws UnableToCompleteException
Throws:
UnableToCompleteException

warn

protected void warn(String msg)
             throws UnableToCompleteException
Throws:
UnableToCompleteException

info

protected void info(String msg)
             throws UnableToCompleteException
Throws:
UnableToCompleteException

debug

protected void debug(String msg)
              throws UnableToCompleteException
Throws:
UnableToCompleteException

trace

protected void trace(String msg)
              throws UnableToCompleteException
Throws:
UnableToCompleteException

find

protected JClassType find(Class<?> type)
                   throws UnableToCompleteException
Throws:
UnableToCompleteException

find

protected JClassType find(String type)
                   throws UnableToCompleteException
Throws:
UnableToCompleteException

i

protected BaseSourceCreator i(int i)

p

protected BaseSourceCreator p(String value)

p

protected BaseSourceCreator p()

create

public final String create()
                    throws UnableToCompleteException
Throws:
UnableToCompleteException

createComposerFactory

protected abstract com.google.gwt.user.rebind.ClassSourceFileComposerFactory createComposerFactory()
                                                                                            throws UnableToCompleteException
Throws:
UnableToCompleteException

generate

protected abstract void generate()
                          throws UnableToCompleteException
Throws:
UnableToCompleteException


Copyright © 2010-2011 FuseSource, Corp.. All Rights Reserved.