Binding

play.api.inject.Binding
final case class Binding[T](key: BindingKey[T], target: Option[BindingTarget[T]], scope: Option[Class[_ <: Annotation]], eager: Boolean, source: 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 jakarta.inject.Singleton, then the binding may declare itself to be eagerly instantiated. In which case, it should be eagerly instantiated when Play starts up.

Value parameters

eager

Whether the binding should be eagerly instantiated.

key

The binding key.

scope

The JSR-330 scope.

source

Where this object was bound. Used in error reporting.

target

The binding target.

Attributes

See also

The Module class for information on how to provide bindings.

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def asJava: Binding[T]
def eagerly(): Binding[T]

Eagerly instantiate this binding when Play starts up.

Eagerly instantiate this binding when Play starts up.

Attributes

def in[A <: Annotation](scope: Class[A]): Binding[T]

Configure the scope for this binding.

Configure the scope for this binding.

Attributes

def in[A <: Annotation : ClassTag]: Binding[T]

Configure the scope for this binding.

Configure the scope for this binding.

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product