org.glassfish.hk2
Interface NamedBinder<U>

All Known Subinterfaces:
Binder<T>

Deprecated.

@Deprecated
public interface NamedBinder<U>

Provides a means to more fully describe a binding that has already been named, or where the name has been assumed to be left blank.

This is a builder like pattern, where each method more fully builds up a binding description. The builder takes the caller through phases of the build process. This process actually begins in the Binder class. Once the Binder is bound to a name (or the name is assumed null), a NamedBinder provides a means to add annotations here. Once this phase is completed, a ResolvedBinder is produced once a target is provided - the target is the actual implementation strategy behing the binding (e.g., class name to load reflectively, a factory, etc.).

Author:
Jerome Dochez, Jeff Trent

Method Summary
 NamedBinder<U> annotatedWith(Class<? extends Annotation> annotation)
          Deprecated. Append annotation to the binding.
<T extends U>
ResolvedBinder<T>
to(Class<? extends T> serviceClass)
          Deprecated. Resolve this binder to a particular target implementation class type.
 ResolvedBinder<U> to(String className)
          Deprecated. Have this instance resolve to a particular target implementation class name.
<T extends U>
ResolvedBinder<T>
to(TypeLiteral<T> typeLiteral)
          Deprecated. Resolve this binder to a particular parameterized type.
<T extends U>
ResolvedBinder<T>
toFactory(Class<? extends Factory<? extends T>> factoryType)
          Deprecated. Have this instance resolve to a particular target factory class type.
<T extends U>
ResolvedBinder<T>
toFactory(Factory<T> factory)
          Deprecated. Have this instance resolve to a particular target factory implementation.
<T extends U>
ResolvedBinder<T>
toFactory(TypeLiteral<? extends Factory<? extends T>> factoryType)
          Deprecated. Have this instance resolve to a particular target type literal factory.
<T extends U>
void
toInstance(T instance)
          Deprecated. Have this instance resolve to a particular singleton implementation instance.
 

Method Detail

annotatedWith

NamedBinder<U> annotatedWith(Class<? extends Annotation> annotation)
Deprecated. 
Append annotation to the binding. The annotation should be annotated with Qualifier annotation

Parameters:
annotation - the annotation to append
Returns:
this instances, with additional annotations appended to it

to

ResolvedBinder<U> to(String className)
Deprecated. 
Have this instance resolve to a particular target implementation class name.

Parameters:
className - the class name target to resolve to
Returns:
a ResolvedBinder

to

<T extends U> ResolvedBinder<T> to(Class<? extends T> serviceClass)
Deprecated. 
Resolve this binder to a particular target implementation class type. The implementation type will be instantiated depending on its when this binding is requested for injection or through explicit lookup.

Type Parameters:
T - TODO javadoc.
Parameters:
serviceClass - the class type target to resolve to
Returns:
a ResolvedBinder

to

<T extends U> ResolvedBinder<T> to(TypeLiteral<T> typeLiteral)
Deprecated. 
Resolve this binder to a particular parameterized type. The implementation type will be instantiated depending on its when this binding is requested for injection or through explicit lookup.

Type Parameters:
T - TODO javadoc.
Parameters:
typeLiteral - the type literal target to resolve to
Returns:
a ResolvedBinder

toInstance

<T extends U> void toInstance(T instance)
Deprecated. 
Have this instance resolve to a particular singleton implementation instance. In this case the Scope is assumed to be singleton.

Type Parameters:
T - TODO javadoc.
Parameters:
instance - the instance used to satisfy this binding requests.

toFactory

<T extends U> ResolvedBinder<T> toFactory(Factory<T> factory)
Deprecated. 
Have this instance resolve to a particular target factory implementation.

Type Parameters:
T - TODO javadoc.
Parameters:
factory - the factory target to resolve to
Returns:
a ResolvedBinder

toFactory

<T extends U> ResolvedBinder<T> toFactory(Class<? extends Factory<? extends T>> factoryType)
Deprecated. 
Have this instance resolve to a particular target factory class type.

Type Parameters:
T - TODO javadoc.
Parameters:
factoryType - the factory class type target to resolve to
Returns:
a ResolvedBinder

toFactory

<T extends U> ResolvedBinder<T> toFactory(TypeLiteral<? extends Factory<? extends T>> factoryType)
Deprecated. 
Have this instance resolve to a particular target type literal factory.

Type Parameters:
T - TODO javadoc.
Parameters:
factoryType - the type literal factory to resolve to
Returns:
a ResolvedBinder


Copyright © 2013 Oracle Corporation. All Rights Reserved.