Injectできるように

This commit is contained in:
r-ca 2023-12-25 15:45:42 +09:00
parent 73f553cff3
commit ca153f5602
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 23 additions and 0 deletions

View File

@ -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 {

View File

@ -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);
}