use of org.w3c.dom.Element in project head by mifos.
the class TableTagParser method createPath.
protected Path[] createPath(Node table) throws TableTagParseException {
NodeList pathNodeList = ((Element) table).getElementsByTagName(TableTagConstants.PATH);
if (pathNodeList.getLength() == 0) {
throw new TableTagParseException(TableTagConstants.UNEXPECTED_ERROR);
}
Path[] path = new Path[pathNodeList.getLength()];
for (int i = 0; i < pathNodeList.getLength(); i++) {
path[i] = new Path();
path[i].setKey((pathNodeList.item(i).getAttributes().getNamedItem(TableTagConstants.KEY).getNodeValue()));
path[i].setAction((pathNodeList.item(i).getAttributes().getNamedItem(TableTagConstants.PATHACTION).getNodeValue()));
path[i].setForwardkey((pathNodeList.item(i).getAttributes().getNamedItem(TableTagConstants.FORWARDKEY).getNodeValue()));
}
return path;
}
use of org.w3c.dom.Element in project head by mifos.
the class TableTagParser method createDisplayName.
protected DisplayName createDisplayName(Node column) throws TableTagParseException {
NodeList displayNodeList = ((Element) column).getElementsByTagName(TableTagConstants.DISPLAYNAME);
DisplayName displayName = new DisplayName();
setFragmentDetails(displayName, displayNodeList.item(0));
displayName.setBold((displayNodeList.item(0).getAttributes().getNamedItem(TableTagConstants.BOLDDISPLAY).getNodeValue()));
return displayName;
}
use of org.w3c.dom.Element in project head by mifos.
the class TypeParser method createFileName.
private FileName[] createFileName(Node file) throws TableTagTypeParserException {
NodeList fileNameNodeList = ((Element) file).getElementsByTagName(TableTagConstants.FILENAME);
if (fileNameNodeList.getLength() == 0) {
throw new TableTagTypeParserException(fileNameNodeList.toString());
}
FileName[] fileName = new FileName[fileNameNodeList.getLength()];
for (int i = 0; i < fileNameNodeList.getLength(); i++) {
fileName[i] = new FileName();
fileName[i].setName((fileNameNodeList.item(i).getAttributes().getNamedItem(TableTagConstants.NAME).getNodeValue()));
fileName[i].setPath((fileNameNodeList.item(i).getAttributes().getNamedItem(TableTagConstants.PATH).getNodeValue()));
}
return fileName;
}
use of org.w3c.dom.Element in project head by mifos.
the class TableTagParser method createHeaderDetails.
protected HeaderDetails createHeaderDetails(Node table) throws TableTagParseException {
NodeList headerNodeList = ((Element) table).getElementsByTagName(TableTagConstants.HEADERDETAILS);
if (headerNodeList.getLength() == 0) {
throw new TableTagParseException(headerNodeList.toString());
}
HeaderDetails headerDetails = new HeaderDetails();
headerDetails.setHeaderStyle(headerNodeList.item(0).getAttributes().getNamedItem(TableTagConstants.HEADERSTYLE).getNodeValue());
return headerDetails;
}
use of org.w3c.dom.Element in project head by mifos.
the class TableTagParser method createRow.
protected Row createRow(Node table) throws TableTagParseException {
NodeList rowNodeList = ((Element) table).getElementsByTagName(TableTagConstants.ROW);
if (rowNodeList.getLength() == 0) {
throw new TableTagParseException(rowNodeList.toString());
}
Row row = new Row();
row.setTotWidth((rowNodeList.item(0).getAttributes().getNamedItem(TableTagConstants.TOTWIDTH).getNodeValue()));
row.setBottomLineRequired((rowNodeList.item(0).getAttributes().getNamedItem(TableTagConstants.BOTTOMLINEREQUIRED).getNodeValue()));
row.setColumn(createColumn(rowNodeList.item(0)));
return row;
}
Aggregations