提案したようにPlaceHistoryMapperWithFactoryを試しましたhere。だから私のAppPlaceHistoryMapperは、以下のようになります。"PlaceHistoryMapperWithFactoryを複数回実装することはできません..."
@WithTokenizers({ InfoPlace.Tokenizer.class, LogPlace.Tokenizer.class })
public interface AppPlaceHistoryMapper extends PlaceHistoryMapperWithFactory<TokenizerFactory> {
}
私はまた、TEHジンモジュール変更:
bind(PlaceHistoryMapperWithFactory.class).to(AppPlaceHistoryMapper.class);
をしかし、私はGWT-コンパイルをしません。私は
[INFO] Compiling module de.stalabw.zensus2011.adb.AuswertungsDB
[INFO] Scanning for additional dependencies: ...ClientInjectorImpl.java
[INFO] Adding '57' new generated units
[INFO] Validating newly compiled units
[INFO] Ignored 1 unit with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO] [ERROR] Errors in '...PlaceHistoryMapperWithFactoryImpl.java'
[INFO] [ERROR] Line 10: The interface PlaceHistoryMapperWithFactory cannot be implemented more than once with different arguments: PlaceHistory
MapperWithFactory<Void> and PlaceHistoryMapperWithFactory
[INFO] [ERROR] Cannot proceed due to previous errors
私の単体テストで同じエラーを修正しました。そこに私は擬似実装を持っています。私はちょうど
public class PlaceHistoryMapperMock extends AbstractPlaceHistoryMapper<TokenizerFactory> implements
AppPlaceHistoryMapper
に
public class PlaceHistoryMapperMock extends AbstractPlaceHistoryMapper<void> implements
AppPlaceHistoryMapper
を変更し、エラーが消えていました。私の「本当の」コードを修正する方法は?
THX:、あなたが
TypeLiteral
を使用してGINにマッピングする必要があるパラメータ化された型PlaceHistoryMapperWithFactory<TokenizerFactory>
、上の依存関係を持っている必要があります(あなたがsetFactory
を呼び出すところだから)の場合では、その依存関係を必要とします私のプロバイダ。 – dermoritz