Google Guice的Binder介面

梧桐雨—168發表於2008-03-19

三個bind方法
/**
* Creates a binding to a key.
*/
LinkedBindingBuilder bind(Key key);

/**
* Creates a binding to a type.
*/
AnnotatedBindingBuilder bind(TypeLiteral typeLiteral);

/**
* Creates a binding to a type.
*/
AnnotatedBindingBuilder bind(Class type);

繫結Scope的
/**
* Binds a scope to an annotation.
*/
void bindScope(Class annotationType, Scope scope);
幫定攔截器的
使用Module進行配置
/**
* Uses the given module to configure more bindings.
*/
void install(Module module);
連靜態方法也不放過):
/**
* Upon successful creation, the {@link Injector} will inject static fields
* and methods in the given classes.
*
* @param types for which static members will be injected
*/
void requestStaticInjection(Class... types);

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13270562/viewspace-211688/,如需轉載,請註明出處,否則將追究法律責任。

相關文章