net.codingwell

scalaguice

package scalaguice

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. scalaguice
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type AnnotationClass[T <: Annotation] = Class[T]

  2. trait ScalaModule extends AbstractModule

    Allows binding via type parameters.

    Allows binding via type parameters. Mix into AbstractModule (or subclass) to allow using a type parameter instead of classOf[Foo] or new TypeLiteral[Bar[Foo]] {}.

    For example, instead of

    class MyModule extends AbstractModule {
      def configure {
        bind(classOf[Service]).to(classOf[ServiceImpl]).in(classOf[Singleton])
        bind(classOf[CreditCardPaymentService])
        bind(new TypeLiteral[Bar[Foo]]{}).to(classOf[FooBarImpl])
        bind(classOf[PaymentService]).to(classOf[CreditCardPaymentService])
      }
    }

    use

    class MyModule extends AbstractModule with ScalaModule {
      def configure {
        bind[Service].to[ServiceImpl].in[Singleton]
        bind[CreditCardPaymentService]
        bind[Bar[Foo]].to[FooBarImpl]
        bind[PaymentService].to[CreditCardPaymentService]
      }
    }

    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.

  3. class ScalaMultibinder[T] extends AnyRef

    Analog to the Guice Multibinder

  4. trait ScalaPrivateModule extends PrivateModule

  5. class SetProvider[T] extends ProviderWithDependencies[Set[T]]

    Provider for a Scala Immutable Set from a Java Set.

    Provider for a Scala Immutable Set from a Java Set.

    Example:

    .toProvider( new SetProvider[T]( Key.get( typeLiteral[JSet[T]] ) ) )

Value Members

  1. object InjectorExtensions

  2. object KeyExtensions

  3. object ScalaModule

  4. object ScalaMultibinder

    Analog to the Guice Multibinder

    Analog to the Guice Multibinder

    Use newSetBinder to create a multibinder instance

  5. def annotation[T <: Annotation](implicit arg0: Manifest[T]): AnnotationClass[T]

    Get the class for a Java Annotation using a scala.Manifest.

  6. package binder

  7. def typeLiteral[T](implicit arg0: Manifest[T]): TypeLiteral[T]

    Create a com.google.inject.TypeLiteral from a scala.Manifest.

    Create a com.google.inject.TypeLiteral from a scala.Manifest. Subtypes of scala.AnyVal will be converted to their corresponding Java wrapper classes.

Inherited from AnyRef

Inherited from Any

Ungrouped