com.google.inject.spi.RequireAtInjectOnConstructorsOption Maven / Gradle / Ivy
package com.google.inject.spi;
import com.google.inject.Binder;
import com.google.inject.Inject;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* A request to require explicit {@literal @}{@link Inject} annotations on constructors.
*/
public final class RequireAtInjectOnConstructorsOption implements Element {
private final Object source;
RequireAtInjectOnConstructorsOption(Object source) {
this.source = checkNotNull(source, "source");
}
public Object getSource() {
return source;
}
public void applyTo(Binder binder) {
binder.withSource(getSource()).requireAtInjectOnConstructors();
}
public T acceptVisitor(ElementVisitor visitor) {
return visitor.visit(this);
}
}