org.jvnet.hk2.annotations
Annotation Type Factory
@Retention(value=RUNTIME)
@Target(value=TYPE)
@Documented
public @interface Factory
Indicates that the object should be created by using the given factory component,
instead of calling the constructor.
If specified, the factory component is activated, and
Provider.get() is used to obtain the instance,
instead of the default action, which is to call the constructor.
The resource injection and extraction happens like it normally
does, after the factory returns the object.
- Author:
- Kohsuke Kawaguchi
- See Also:
FactoryFor
value
public abstract Class<? extends Factory> value
Copyright © 2012 Oracle Corporation. All Rights Reserved.