Package org.restlet.rebind
Class ClientProxyGenerator
- java.lang.Object
-
- com.google.gwt.core.ext.Generator
-
- org.restlet.rebind.ClientProxyGenerator
-
public class ClientProxyGenerator extends Generator
Deferred binding generator capable of creating a subclass ofClientProxy
implementing a custom Java interface, extending the markerClientProxy
interface, and annotated with Restlet annotations such asGet
,Post
,Put
orDelete
.- Author:
- Jerome Louvel
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.gwt.core.ext.Generator
Generator.RunsLocal
-
-
Constructor Summary
Constructors Constructor Description ClientProxyGenerator()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
generate(TreeLogger logger, GeneratorContext context, java.lang.String typeQName)
protected void
generateContructor()
Generates the default constructor.protected void
generateFields(com.google.gwt.user.rebind.rpc.SerializableTypeOracle serializableTypeOracle)
Generates the private members of the proxy class.protected void
generateMethod(java.lang.reflect.Method method)
Generates the code of a given Java method (must be correctly annotated using Restlet annotation).protected void
generateProxy()
Generates the code of the proxy class.protected void
generateSerializers()
Generates the code of the necessary object serializers.protected java.lang.String
getClassName()
Returns the name of the proxy class that will be generated.protected JClassType
getClassType()
Returns the parent type.protected GeneratorContext
getContext()
Returns the context object that provides metadata to defered binding generators.protected TreeLogger
getLogger()
Returns the logger used by the deferred binding generator.protected java.lang.String
getPackageName()
Returns the package name of the parent type.protected com.google.gwt.user.rebind.SourceWriter
getSourceWriter()
Returns the writer used for the content of the proxy class.protected com.google.gwt.user.rebind.rpc.SerializableTypeOracle
getSto()
Returns the serializer class.protected com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder
getStob()
Returns the builder of the serializer class.protected TypeOracle
getTypeOracle()
Returns the type oracle for the current generator context.protected java.lang.String
getTypeQName()
Returns the parent type for which a default constructible subclass will be generated.protected void
indent()
Increments the indentation of the generated source code.protected void
outdent()
Decrements the indentation of the generated source code.protected void
print(java.lang.String value)
Prints the given value in the generated source code.protected void
println()
Terminates the current line with a new line separator.protected void
println(java.lang.String value)
Prints the given value in the generated source code and terminates the current line with a new line separator.-
Methods inherited from class com.google.gwt.core.ext.Generator
escape, escapeClassName
-
-
-
-
Method Detail
-
generate
public java.lang.String generate(TreeLogger logger, GeneratorContext context, java.lang.String typeQName) throws UnableToCompleteException
- Specified by:
generate
in classGenerator
- Throws:
UnableToCompleteException
-
generateContructor
protected void generateContructor()
Generates the default constructor.
-
generateFields
protected void generateFields(com.google.gwt.user.rebind.rpc.SerializableTypeOracle serializableTypeOracle)
Generates the private members of the proxy class.- Parameters:
serializableTypeOracle
- The type of the object serializer/deserializer.
-
generateMethod
protected void generateMethod(java.lang.reflect.Method method) throws java.lang.Exception
Generates the code of a given Java method (must be correctly annotated using Restlet annotation).- Parameters:
method
- The Java method.- Throws:
java.lang.Exception
-
generateProxy
protected void generateProxy() throws java.lang.Exception
Generates the code of the proxy class.- Throws:
java.lang.Exception
-
generateSerializers
protected void generateSerializers() throws UnableToCompleteException
Generates the code of the necessary object serializers.- Throws:
UnableToCompleteException
-
getClassName
protected java.lang.String getClassName()
Returns the name of the proxy class that will be generated.- Returns:
- The name of the proxy class that will be generated.
-
getClassType
protected JClassType getClassType()
Returns the parent type.- Returns:
- The parent type.
-
getContext
protected GeneratorContext getContext()
Returns the context object that provides metadata to defered binding generators.- Returns:
- The context object that provides metadata to defered binding generators.
-
getLogger
protected TreeLogger getLogger()
Returns the logger used by the deferred binding generator.- Returns:
- The logger used by the deferred binding generator.
-
getPackageName
protected java.lang.String getPackageName()
Returns the package name of the parent type.- Returns:
- The package name of the parent type.
-
getSourceWriter
protected com.google.gwt.user.rebind.SourceWriter getSourceWriter()
Returns the writer used for the content of the proxy class.- Returns:
- The writer used for the content of the proxy class.
-
getSto
protected com.google.gwt.user.rebind.rpc.SerializableTypeOracle getSto()
Returns the serializer class.- Returns:
- The serializer class.
-
getStob
protected com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder getStob()
Returns the builder of the serializer class.- Returns:
- The builder of the serializer class.
-
getTypeOracle
protected TypeOracle getTypeOracle()
Returns the type oracle for the current generator context.- Returns:
- The type oracle for the current generator context.
-
getTypeQName
protected java.lang.String getTypeQName()
Returns the parent type for which a default constructible subclass will be generated.- Returns:
- The parent type for which a default constructible subclass will be generated.
-
indent
protected void indent()
Increments the indentation of the generated source code.
-
outdent
protected void outdent()
Decrements the indentation of the generated source code.
-
print
protected void print(java.lang.String value)
Prints the given value in the generated source code.- Parameters:
value
- The value to write.
-
println
protected void println()
Terminates the current line with a new line separator.
-
println
protected void println(java.lang.String value)
Prints the given value in the generated source code and terminates the current line with a new line separator.- Parameters:
value
- The value to write.
-
-