Package play.inject

Class Binding<T>


  • public final class Binding<T>
    extends Object
    A binding.

    Bindings are used to bind classes, optionally qualified by a JSR-330 qualifier annotation, to instances, providers or implementation classes.

    Bindings may also specify a JSR-330 scope. If, and only if that scope is javax.inject.Singleton, then the binding may declare itself to be eagerly instantiated. In which case, it should be eagerly instantiated when Play starts up.

    See the Module class for information on how to provide bindings.

    • Constructor Detail

      • Binding

        public Binding​(BindingKey<T> key,
                       Optional<BindingTarget<T>> target,
                       Optional<Class<? extends Annotation>> scope,
                       Boolean eager,
                       Object source)
        Parameters:
        key - The binding key.
        target - The binding target.
        scope - The JSR-330 scope.
        eager - Whether the binding should be eagerly instantiated.
        source - Where this object was bound. Used in error reporting.
      • Binding

        public Binding​(play.api.inject.Binding<T> underlying)