public interface Factory {
PowershellFileWriter create(@Assisted Queryable<VariableSymbol> variables,
@Assisted @NotModified ToolTemplate toolTemplate,
@Assisted Path outputPath);
}
@Inject
public PowershellFileWriter(FileSystem fileSystem,
ResourceEnvironment.Factory envFactory,
@Assisted Queryable<VariableSymbol> variables,
@Assisted Path scriptPath,
@Assisted Path outputPath) {
//...
}
public interface Factory {
PowershellFileWriter create(Queryable<VariableSymbol> variables,
@Assisted("script") Path scriptPath,
@Assisted("out") Path outputPath);
}
@Inject
public PowershellFileWriter(FileSystem fileSystem,
ResourceEnvironment.Factory envFactory,
@Assisted Queryable<VariableSymbol> variables,
@Assisted("script") Path scriptPath,
@Assisted("out") Path outputPath) {This is a "feature" (albeit, not the best one) of AssistedInject -- the @Inject constructors don't need to consume all the assisted param. This helps when you want to bind the implementation to a stub that does less.
If you want the error checking, I believe you can annotate the cxtor @AssistedInject instead of @Inject, and it will be a bit stricter.
sam
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice...@googlegroups.com.
To post to this group, send email to google...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/52237a42-109d-41e9-abb4-545dbbfc577a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.