Factory作成

This commit is contained in:
r-ca 2024-01-07 17:47:47 +09:00
parent d453c0705f
commit 4fd490ee12
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,10 @@
package one.nem.lacerta.processor.factory; package one.nem.lacerta.processor.factory;
public class DocumentProcessorFactory { import dagger.assisted.AssistedFactory;
import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.processor.impl.DocumentProcessorImpl;
@AssistedFactory
public interface DocumentProcessorFactory {
DocumentProcessorImpl create(DocumentDetail documentDetail);
} }

View File

@ -9,6 +9,8 @@ import java.util.UUID;
import javax.inject.Inject; import javax.inject.Inject;
import dagger.assisted.Assisted;
import dagger.assisted.AssistedInject;
import one.nem.lacerta.processor.DocumentProcessor; import one.nem.lacerta.processor.DocumentProcessor;
import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.DocumentDetail;
@ -41,6 +43,11 @@ public class DocumentProcessorImpl implements DocumentProcessor{
@Inject @Inject
XmlMetaParser xmlMetaParser; XmlMetaParser xmlMetaParser;
@AssistedInject
public DocumentProcessorImpl(@Assisted DocumentDetail documentDetail) {
this.documentDetail = documentDetail;
}
@Override @Override
public void init() { public void init() {
logger.debug("init", "called"); logger.debug("init", "called");