org.glassfish.hk2.inject
Interface Injector


@Contract
public interface Injector

Defines a simple API for injecting HK2 components

Author:
Jerome Dochez

Method Summary
<T> T
inject(Class<T> type)
          Instantiate the passed type and injects all the Inject annotated fields and methods
<T> T
inject(T target)
          Injects all the Inject annotated fields and methods of the passed instance.
 

Method Detail

inject

<T> T inject(T target)
Injects all the Inject annotated fields and methods of the passed instance.

Parameters:
target - the instance to inject
Returns:
the passed parameter as a convenience

inject

<T> T inject(Class<T> type)
Instantiate the passed type and injects all the Inject annotated fields and methods

Type Parameters:
T - type of the requested instance
Parameters:
type - class of the requested instance
Returns:
the instantiated and injected instance


Copyright © 2012 Oracle Corporation. All Rights Reserved.