mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
XmlMetaのパース処理を修正
This commit is contained in:
parent
c1151b778c
commit
8c71dedd85
|
@ -17,6 +17,8 @@ import one.nem.lacerta.utils.LacertaLogger;
|
||||||
|
|
||||||
public class XmlMetaParserImpl implements XmlMetaParser{
|
public class XmlMetaParserImpl implements XmlMetaParser{
|
||||||
|
|
||||||
|
String TAG = getClass().getSimpleName();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
LacertaLogger logger;
|
LacertaLogger logger;
|
||||||
|
|
||||||
|
@ -35,13 +37,18 @@ public class XmlMetaParserImpl implements XmlMetaParser{
|
||||||
meta.setRevisionId(rootElement.getElementsByTagName("revisionId").item(0).getTextContent());
|
meta.setRevisionId(rootElement.getElementsByTagName("revisionId").item(0).getTextContent());
|
||||||
|
|
||||||
ArrayList<XmlMetaPageModel> pages = new ArrayList<>();
|
ArrayList<XmlMetaPageModel> pages = new ArrayList<>();
|
||||||
for(int i = 0; i < rootElement.getElementsByTagName("pages").getLength(); i++) {
|
for (int i = 0; i < rootElement.getElementsByTagName("page").getLength(); i++) {
|
||||||
Element pageElement = (Element) rootElement.getElementsByTagName("page").item(i);
|
Element pageElement = (Element) rootElement.getElementsByTagName("page").item(i);
|
||||||
XmlMetaPageModel page = new XmlMetaPageModel();
|
XmlMetaPageModel page = new XmlMetaPageModel();
|
||||||
page.setFilename(pageElement.getElementsByTagName("filename").item(0).getTextContent());
|
page.setFilename(pageElement.getElementsByTagName("filename").item(0).getTextContent());
|
||||||
pages.add(page);
|
pages.add(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.debug(TAG, "Parsed Meta: " + meta.getRevisionId() + " " + pages.size() + " pages.");
|
||||||
|
for (XmlMetaPageModel page : pages) {
|
||||||
|
logger.debug(TAG, "\tPage: " + page.getFilename());
|
||||||
|
}
|
||||||
|
|
||||||
meta.setPages(pages);
|
meta.setPages(pages);
|
||||||
|
|
||||||
return meta;
|
return meta;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user