* @see com.ytec.jdap.reader.IXmlReader#getAppByName(java.lang.String)
*/
public Application getAppByName(String appName) throws Exception {
Element element = getDocument().getDocumentElement();
NodeList apps = element.getElementsByTagName(Constants.APPLICATION);
Application application = new Application();
for (int i = 0; i < apps.getLength(); i++) {
Element ele = (Element) apps.item(i);
if (appName.equals(ele.getAttribute(Constants.APP_NAME))) {
application.setProperties(ele);
NodeList params = ele.getElementsByTagName(Constants.PARAM);
if (params != null && params.getLength() > 0) {
Map<String, String> paramMap = new HashMap<String, String>();
for (int k = 0; k < params.getLength(); k++) {
Element param = (Element) params.item(k);
paramMap.put(param.getAttribute(Constants.PARAM_NAME), param.getAttribute(Constants.PARAM_VALUE));
}
application.setParams(paramMap);
}
}
}
return application;
}