org.jvnet.hk2.component
Class ContractLocatorImpl<T>

java.lang.Object
  extended by org.jvnet.hk2.component.ContractLocatorImpl<T>
All Implemented Interfaces:
ContractLocator<T>, Providers<T>, ServiceLocator<T>

public class ContractLocatorImpl<T>
extends Object
implements ContractLocator<T>

Implementation of the ContractLocator interface.

This is used for location byType or byContract.

Author:
Jerome Dochez, Jeff Trent

Constructor Summary
ContractLocatorImpl(SimpleServiceLocator habitat, Type clazz, boolean byContract)
           
 
Method Summary
 Collection<Provider<T>> all()
           
 Collection<Provider<T>> all(boolean stopAtFirstMatch)
           
 ContractLocator<T> annotatedWith(Class<? extends Annotation> annotation)
           
 T get()
           
 Provider<T> getProvider()
           
 String getTypeName()
           
 ContractLocator<T> in(Scope scope)
           
 ContractLocator<T> named(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContractLocatorImpl

public ContractLocatorImpl(SimpleServiceLocator habitat,
                           Type clazz,
                           boolean byContract)
Method Detail

getTypeName

public String getTypeName()

named

public ContractLocator<T> named(String name)
Specified by:
named in interface ContractLocator<T>

in

public ContractLocator<T> in(Scope scope)
Specified by:
in in interface ContractLocator<T>

annotatedWith

public ContractLocator<T> annotatedWith(Class<? extends Annotation> annotation)
Specified by:
annotatedWith in interface ContractLocator<T>

get

public T get()
Specified by:
get in interface Providers<T>

getProvider

public Provider<T> getProvider()
Specified by:
getProvider in interface Providers<T>

all

public Collection<Provider<T>> all()
Specified by:
all in interface Providers<T>

all

public Collection<Provider<T>> all(boolean stopAtFirstMatch)


Copyright © 2011 Oracle Corporation. All Rights Reserved.