org.jvnet.hk2.annotations
Annotation Type Inject


@Retention(value=RUNTIME)
@Target(value={METHOD,FIELD})
public @interface Inject

Annotation to define a required resource for a component. The HK2 runtime injects all instance variables annotated with

Author:
Jerome Dochez
See Also:
Habitat

Optional Element Summary
 java.lang.String name
          Returns the name.
 boolean optional
          When true, it is not an error if not present.
 

name

public abstract java.lang.String name
Returns the name.

Returns:
name of the resource
Default:
""

optional

public abstract boolean optional
When true, it is not an error if not present. When false, a failure occurs when not present.

Returns:
true if optional, false otherwise
Default:
false


Copyright © 2011 Oracle Corporation. All Rights Reserved.