public interface GinModule
Module
. A GinModule
implementation is compiled both by the regular Java compiler and
by the GWT compiler.
The regular-compiled version is used at GWT compile time as part
of the implementation of the Generator
that outputs the generated
Ginjector
class. Notably, the Generator
calls the
configure
method on the module class.
The GWT-compiled version is used client-side at runtime. This is
necessary to support provider methods. Important, the GWT client
code never actually calls the configure
method on the module class
and it is eliminated as dead code by the compiler. So configure
needs to be GWT compilable, but the resulting code will never execute.
Because GinModule
classes need to compile as GWT code,
all types that modules reference must be GWT translatable. This
is a problem for types like Key
and
TypeLiteral
, since they normally
reference Type
instances and other untranslatable
things. But since the configure
method that uses them won't actually
be executed, all we need is to satisfy the compiler. Thus, we can get away
with using super-source
to provide dummy stubs of Key
and
TypeLiteral
.
Modifier and Type | Method and Description |
---|---|
void |
configure(GinBinder binder)
Contributes bindings and other configurations for this module to
binder . |
void configure(GinBinder binder)
binder
.Copyright © 2008–2018. All rights reserved.