From 4fd490ee12ab7c8c5b090b7cc9d4cf3bf05fa700 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 7 Jan 2024 17:47:47 +0900 Subject: [PATCH] =?UTF-8?q?Factory=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../processor/factory/DocumentProcessorFactory.java | 8 +++++++- .../nem/lacerta/processor/impl/DocumentProcessorImpl.java | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/processor/src/main/java/one/nem/lacerta/processor/factory/DocumentProcessorFactory.java b/processor/src/main/java/one/nem/lacerta/processor/factory/DocumentProcessorFactory.java index 1d0bdcda..2741a8a9 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/factory/DocumentProcessorFactory.java +++ b/processor/src/main/java/one/nem/lacerta/processor/factory/DocumentProcessorFactory.java @@ -1,4 +1,10 @@ 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); } diff --git a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java index 19ebcd78..9b39dd60 100644 --- a/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java +++ b/processor/src/main/java/one/nem/lacerta/processor/impl/DocumentProcessorImpl.java @@ -9,6 +9,8 @@ import java.util.UUID; import javax.inject.Inject; +import dagger.assisted.Assisted; +import dagger.assisted.AssistedInject; import one.nem.lacerta.processor.DocumentProcessor; import one.nem.lacerta.model.document.DocumentDetail; @@ -41,6 +43,11 @@ public class DocumentProcessorImpl implements DocumentProcessor{ @Inject XmlMetaParser xmlMetaParser; + @AssistedInject + public DocumentProcessorImpl(@Assisted DocumentDetail documentDetail) { + this.documentDetail = documentDetail; + } + @Override public void init() { logger.debug("init", "called");