From ca153f5602f2af85cf3c96c94081651198df9587 Mon Sep 17 00:00:00 2001 From: r-ca Date: Mon, 25 Dec 2023 15:45:42 +0900 Subject: [PATCH] =?UTF-8?q?Inject=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/utils/impl/XmlMetaParserImpl.java | 6 ++++++ .../utils/module/XmlMetaParserModule.java | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 utils/src/main/java/one/nem/lacerta/utils/module/XmlMetaParserModule.java diff --git a/utils/src/main/java/one/nem/lacerta/utils/impl/XmlMetaParserImpl.java b/utils/src/main/java/one/nem/lacerta/utils/impl/XmlMetaParserImpl.java index 368ea78b..890d2ca0 100644 --- a/utils/src/main/java/one/nem/lacerta/utils/impl/XmlMetaParserImpl.java +++ b/utils/src/main/java/one/nem/lacerta/utils/impl/XmlMetaParserImpl.java @@ -8,6 +8,7 @@ import java.io.StringReader; import java.nio.file.Path; import java.util.ArrayList; +import javax.inject.Inject; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -16,6 +17,11 @@ import one.nem.lacerta.model.document.internal.XmlMetaPageModel; import one.nem.lacerta.utils.XmlMetaParser; public class XmlMetaParserImpl implements XmlMetaParser{ + + @Inject + public XmlMetaParserImpl() { + } + @Override public XmlMetaModel parse(String xml) { try { diff --git a/utils/src/main/java/one/nem/lacerta/utils/module/XmlMetaParserModule.java b/utils/src/main/java/one/nem/lacerta/utils/module/XmlMetaParserModule.java new file mode 100644 index 00000000..8e2f61f2 --- /dev/null +++ b/utils/src/main/java/one/nem/lacerta/utils/module/XmlMetaParserModule.java @@ -0,0 +1,17 @@ +package one.nem.lacerta.utils.module; + + +import dagger.Binds; +import dagger.Module; +import dagger.hilt.InstallIn; +import dagger.hilt.components.SingletonComponent; + +import one.nem.lacerta.utils.XmlMetaParser; +import one.nem.lacerta.utils.impl.XmlMetaParserImpl; +@Module +@InstallIn(SingletonComponent.class) +abstract public class XmlMetaParserModule { + + @Binds + public abstract XmlMetaParser bindXmlMetaParser(XmlMetaParserImpl impl); +}