mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03: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{
|
||||
|
||||
String TAG = getClass().getSimpleName();
|
||||
|
||||
@Inject
|
||||
LacertaLogger logger;
|
||||
|
||||
|
@ -35,13 +37,18 @@ public class XmlMetaParserImpl implements XmlMetaParser{
|
|||
meta.setRevisionId(rootElement.getElementsByTagName("revisionId").item(0).getTextContent());
|
||||
|
||||
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);
|
||||
XmlMetaPageModel page = new XmlMetaPageModel();
|
||||
page.setFilename(pageElement.getElementsByTagName("filename").item(0).getTextContent());
|
||||
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);
|
||||
|
||||
return meta;
|
||||
|
|
Loading…
Reference in New Issue
Block a user