BindingExtensions
net.codingwell.scalaguice.BindingExtensions$
object BindingExtensions
Extensions for Guice's binding DSL.
These allow using a type parameter instead of classOf[Foo]
or new TypeLiteral[Bar[Foo]] {}
. The extra methods are
named as those in the normal binding DSL suffixed with Type
.
For example, instead of
binder.bind(new TypeLiteral[Bar[Foo]]{}).to(classOf[FooBarImpl])
use
import BindingExtensions._
binder.bindType[Bar[Foo]].toType[FooImpl]
'''Note''' This syntax allows binding to and from generic types. It doesn't currently allow bindings between wildcard types because the manifests for wildcard types don't provide access to type bounds.
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- BindingExtensions.type