com.sun.hk2.component
Class Holder.Impl<T>

java.lang.Object
  extended by com.sun.hk2.component.Holder.Impl<T>
All Implemented Interfaces:
Holder<T>, Factory<T>
Enclosing interface:
Holder<T>

public static final class Holder.Impl<T>
extends Object
implements Holder<T>

Holder implementation that doesn't do any deferred computation, where the value is given in the constructor.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sun.hk2.component.Holder
Holder.Impl<T>
 
Constructor Summary
Holder.Impl(T t)
           
 
Method Summary
 T get()
          The system calls this method to obtain a reference to the component/service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Holder.Impl

public Holder.Impl(T t)
Method Detail

get

public T get()
Description copied from interface: Factory
The system calls this method to obtain a reference to the component/service.

Specified by:
get in interface Factory<T>
Returns:
null is a valid return value. This is useful when a factory primarily does a look-up and it fails to find the specified component, yet you don't want that by itself to be an error. If the injection wants a non-null value (i.e., @Inject(optional=false)).


Copyright © 2013 Oracle Corporation. All Rights Reserved.