This commit is contained in:
r-ca 2024-01-07 19:22:57 +09:00
parent 95beda8cc2
commit c54967f016
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
3 changed files with 20 additions and 1 deletions

View File

@ -153,7 +153,11 @@ public class ScannerDataManagerStubFragment extends Fragment {
Log.d("ScannerDataManagerStubFragment", "button_init_document_processor clicked");
Toast.makeText(getActivity(), "button_init_document_processor clicked", Toast.LENGTH_LONG).show();
// TODO-rca: ここでDocumentProcessorを初期化する
// DocumentProcessor documentProcessor = documentProcessorFactory.create();
if (this.documentDetail == null) {
Toast.makeText(getActivity(), "documentDetail is null", Toast.LENGTH_LONG).show();
return;
}
DocumentProcessor documentProcessor = documentProcessorFactory.create(this.documentDetail);
});
}

View File

@ -45,6 +45,9 @@ public class DocumentProcessorImpl implements DocumentProcessor{
@AssistedInject
public DocumentProcessorImpl(@Assisted DocumentDetail documentDetail) {
if (documentDetail == null) {
throw new IllegalArgumentException("documentDetail must not be null");
}
this.documentDetail = documentDetail;
}

View File

@ -1,4 +1,16 @@
package one.nem.lacerta.processor.module;
import dagger.assisted.Assisted;
import dagger.assisted.AssistedInject;
import one.nem.lacerta.model.document.DocumentDetail;
public class DocumentProcessorModule {
private final DocumentDetail documentDetail;
@AssistedInject
public DocumentProcessorModule(@Assisted DocumentDetail documentDetail) {
this.documentDetail = documentDetail;
}
}