com.google.inject.assistedinject.AssistedInject Maven / Gradle / Ivy
package com.google.inject.assistedinject;
import com.google.inject.Inject;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
*
* When used in tandem with {@link FactoryModuleBuilder}, constructors annotated with
* {@code @AssistedInject} indicate that multiple constructors can be injected, each with different
* parameters. AssistedInject annotations should not be mixed with {@literal @}{@link Inject}
* annotations. The assisted parameters must exactly match one corresponding factory method within
* the factory interface, but the parameters do not need to be in the same order. Constructors
* annotated with AssistedInject are created by Guice and receive all the benefits
* (such as AOP).
*
*
* Constructor parameters must be either supplied by the factory interface and marked with
* @Assisted
, or they must be injectable.
*/
@Target({CONSTRUCTOR})
@Retention(RUNTIME)
public @interface AssistedInject {
}